OEM Parameter Block for CD?

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.
Post Reply
CProgrammer3088
Posts: 5
Joined: Mon Apr 25, 2011 9:15 pm

OEM Parameter Block for CD?

Post 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

Code: Select all

bpbTotalSectors: 	    DW 2880
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.
Thanks,
CProgrammer3088
GOD Bless!!!
egos
Member
Member
Posts: 612
Joined: Fri Nov 16, 2007 1:59 pm

Re: OEM Parameter Block for CD?

Post 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.
If you have seen bad English in my words, tell me what's wrong, please.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: OEM Parameter Block for CD?

Post 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).
"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
Posts: 5
Joined: Mon Apr 25, 2011 9:15 pm

Re: OEM Parameter Block for CD?

Post 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!
Thanks,
CProgrammer3088
GOD Bless!!!
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: OEM Parameter Block for CD?

Post 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
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.
CProgrammer3088
Posts: 5
Joined: Mon Apr 25, 2011 9:15 pm

Re: OEM Parameter Block for CD?

Post 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 :)
Thanks,
CProgrammer3088
GOD Bless!!!
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: OEM Parameter Block for CD?

Post by AJ »

Hi,

Our very own wiki has an El-Torito page.

Cheers,
Adam
CProgrammer3088
Posts: 5
Joined: Mon Apr 25, 2011 9:15 pm

Re: OEM Parameter Block for CD?

Post by CProgrammer3088 »

YES! I made it work!
Thank you all for your help!

Now to figure how to load a 2nd stage boot loader.... :)
Thanks,
CProgrammer3088
GOD Bless!!!
Post Reply