Page 1 of 1
OEM Parameter Block for CD?
Posted: Mon Aug 20, 2012 9:25 pm
by CProgrammer3088
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
Please help.
Re: OEM Parameter Block for CD?
Posted: Tue Aug 21, 2012 7:38 am
by egos
Use floppy emulation mode (see El Torito Spec.) or read about CDFS (ISO9660, etc.) and how can write stage 1 for "No emulation" mode.
Re: OEM Parameter Block for CD?
Posted: Tue Aug 21, 2012 8:17 am
by Combuster
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).
Re: OEM Parameter Block for CD?
Posted: Tue Aug 21, 2012 9:07 am
by CProgrammer3088
How Would I go about creating a dedicated bootloader for CD ?
It sound like the best way to me
Sorry if I am troubling you guys.
Thanks for the reply!
Re: OEM Parameter Block for CD?
Posted: Tue Aug 21, 2012 9:46 am
by Brendan
Hi,
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
Re: OEM Parameter Block for CD?
Posted: Tue Aug 21, 2012 10:44 am
by CProgrammer3088
So I dont even need a OEM Parameter Block??
and I have read the grub stuff but it is kinda confusing.
Does anyone have an example?
Thanks for the replys
Re: OEM Parameter Block for CD?
Posted: Wed Aug 22, 2012 2:14 am
by AJ
Hi,
Our very own wiki has an
El-Torito page.
Cheers,
Adam
Re: OEM Parameter Block for CD?
Posted: Wed Aug 22, 2012 12:06 pm
by CProgrammer3088
YES! I made it work!
Thank you all for your help!
Now to figure how to load a 2nd stage boot loader....