Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Hey I have been programming for a long time.
I am new to OSdev though... I had been folowing a tutorial but the guy uses a floppy
So I used his OEM Parameter Block and it works. But is there one for a CD Disk?
Maybe this is a dumb qeustion but I have looked everywhere.
For instance
EDIT: I tried to use a 2 stage boot loader and my stage 1 cannot find it.
I followed the instructor fully! So I know that it must be that im using a CD
No, a CD does not typically contain a BPB on it's physical medium. Since a CD is not read-write in the typical sense, and its sector size is over 2500 bytes, there's no sane point in pretending it's anywhere close to a hard or floppy disk.
Instead, you can put a floppy or harddisk image on the CD, and if you configure it to do El-Torito emulation, the bios will pretend there's an actual extra floppy or harddisk installed in the system. If you quickly want to cross over your own bootloader onto a CD, this is pretty much the fastest way, but thanks to a number of broken bioses it's better to write a dedicated bootloader for CD (or use the appropriate GRUB image).
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
CProgrammer3088 wrote:How Would I go about creating a dedicated bootloader for CD ?
It's similar to creating a boot loader for floppy; except:
The firmware is meant to load your entire boot loader, and not just the first 512 bytes of it. This means your boot loader can be 500 KiB if you want and the firmware should load all of it.
You'd use "int 0x13, ah = 0x42" to read sectors (instead of the much older "int 0x13, ah=0x02" function you'd use for floppies); and the sectors are going to be 2048 bytes and not 512 bytes.
You'd want to support a file system that is appropriate for CD (e.g. ISO9660) to find files. This is likely to be a lot easier than something like FAT16 because there's no fragmentation and no "file/cluster allocation table" to worry about; but a bit harder than "raw floppy with no file system".
You'd need to write or find some sort of utility to create the CD image, including the special "El Torito" entries. This is similar to using some sort of utility (mtools?) to create a floppy image, but different.
That's about it.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.