Page 1 of 1

How to use int 13 while in protected mode linux

Posted: Thu Mar 11, 2004 12:38 am
by Jason Dictos
Helo,

I work for a company which is attempting to migrate some of its disaster recovery code from ms dos, to linux. I was wondering if anyone would know anything about being able to write/read/enum the bios addressable hard disks through the int 13 api while in a protected mode OS such as linux/FreeBSD. I can't seem to find anything other then video bios manipulation with this api (That and the bios disk code run in pre-os run mode under BSD).

The main goal here is to simply be able to read/write from a hard disk, without having to rely on any pre-made driver. This is where int 13 comes into play, since by reliing on this api provided by the bios, our dos mode code can reliably write/read boot sectors from any hard drive that is bootable-and we're looking to move away from dos and to linux for our recovery console code.

Is there a way to access int 13 calls through protected mode linux using a virtual 8086 monitor?

Thanks in advance,
-Jason

Re:How to use int 13 while in protected mode linux

Posted: Thu Mar 11, 2004 1:11 am
by kytf
ever tried to cat /dev/hda as root ?)

perhaps you would be insterested in the source of utilities like fdisk, which are commonly found inside floppies, where no much space for drivers exists
i had no idea you needed a driver to access a hard drive ..

Re:How to use int 13 while in protected mode linux

Posted: Thu Mar 11, 2004 1:19 am
by Candy
I doubt they'd give you the access, it's the same HD but under linux supervision. I'd either stick with dos methodics & dos, or move to linux methodics & linux. Read /dev/hda (for the entire harddisk) or /dev/hdaX where X from 1...9 and up, for the partitions. dd copies from/to them, gzip the dd stream to make it smaller. Why make your own tools?

dd -> gzip -> mkisofs -> cdrecord. Auto-burn your harddisk image (if it fits). Also burns DVD's btw :).