I could not find this question anywhere on the board, but is it possible to implement the two stage loader as well as the FAT12 filesystem on an image that boots as a hard drive instead of a floppy?
I ask because I don't even own a machine that has a floppy drive!
I could emulate one, but I'd rather not mess with floppies if I don't have to
If so, what changed will need to be made?
Do we need the floppy sector loading code in stage1 (I'd assume no)?
How do we jump to stage2? Just a jmp call? With segment:offset in place, how do yow know the offset to jump by?
Using a Hard Disk (or image) instead of floppy?
Moderator:Moderators
Re: Using a Hard Disk (or image) instead of floppy?
Hello,
You will need to write support for ATA (probably serial ATA) in order for the software to read and write from the hard disk. Serial ATA is fairly complicated however you can find some example code online including the specification.
Because most hard disks are not formatted with FAT12 (if any) you will most likely need to write a new filesystem minidriver for the kernel and rewriting all file system parsing code in the boot loader. If the hard disk (or partition) is formatted with FAT12, then you do not need to do this. Disk reading using BIOS INT 0x13 can still be used however.
Do keep in mind that there are alternative boot loaders that you can use to skip that stage that do support hard disk booting. Of course, you will still need to add ATA and filesystem driver support.
You will need to write support for ATA (probably serial ATA) in order for the software to read and write from the hard disk. Serial ATA is fairly complicated however you can find some example code online including the specification.
Because most hard disks are not formatted with FAT12 (if any) you will most likely need to write a new filesystem minidriver for the kernel and rewriting all file system parsing code in the boot loader. If the hard disk (or partition) is formatted with FAT12, then you do not need to do this. Disk reading using BIOS INT 0x13 can still be used however.
A lot of us dont. However the software can be used on a CD or DVD without modifications to run on real hardware due to floppy emulation.I ask because I don't even own a machine that has a floppy drive!
Do keep in mind that there are alternative boot loaders that you can use to skip that stage that do support hard disk booting. Of course, you will still need to add ATA and filesystem driver support.
Lead Programmer for BrokenThorn Entertainment, Co.
Website: http://www.brokenthorn.com
Email: webmaster@brokenthorn.com
Website: http://www.brokenthorn.com
Email: webmaster@brokenthorn.com
Re: Using a Hard Disk (or image) instead of floppy?
Go to osdev and there is tutorials on ata there but, if you want the specifacations then go to t13
Oh, and by the way look at the mkiso cmd it can be VERY useful for booting from a cd
Oh, and by the way look at the mkiso cmd it can be VERY useful for booting from a cd