How to use int 13 while in protected mode linux

Programming, for all ages and all languages.
Post Reply
Jason Dictos

How to use int 13 while in protected mode linux

Post 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
kytf

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

Post 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 ..
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

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

Post 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 :).
Post Reply