How BIOS treat floppy and CD boot sector differently?

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
User avatar
smwikipedia
Member
Member
Posts: 49
Joined: Tue Apr 20, 2010 1:11 am

How BIOS treat floppy and CD boot sector differently?

Post by smwikipedia »

I am not quite sure how BIOS treat the floppy boot sector and CD boot sector differently. It seems the CD boot sector is much bigger than floppy boot sector. Is that all?

Could anyone elabrate the details about it or point me to some links?

Thanks.

PS: I mentioned this question in the following link, too. Sorry if duplicated.

http://forum.osdev.org/viewtopic.php?f=1&t=20561
User avatar
smwikipedia
Member
Member
Posts: 49
Joined: Tue Apr 20, 2010 1:11 am

Re: How BIOS treat floppy and CD boot sector differently?

Post by smwikipedia »

According to here: http://en.wikipedia.org/wiki/Boot_sector

"CD-ROMs usually have their own structure of boot sectors, for IBM PC compatible systems this is subject to El Torito specifications. http://en.wikipedia.org/wiki/El_Torito_ ... _standard)"

The literal meaning of "EI Torito": Spanish for "the little bull". (http://en.wikipedia.org/wiki/El_Torito)

Also, the The "El Torito" Bootable CD-ROM Format Specification, Version 1.0 is here: http://download.intel.com/support/mothe ... scdrom.pdf

EL Torito Specification Supplement: http://littlesvr.ca/isomaster/eltoritosuppl.php

I concentrate the related references here, hope it help me through.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: How BIOS treat floppy and CD boot sector differently?

Post by Brendan »

Hi,
smwikipedia wrote:I am not quite sure how BIOS treat the floppy boot sector and CD boot sector differently. It seems the CD boot sector is much bigger than floppy boot sector. Is that all?
CD-ROM doesn't have a boot sector. Instead it has a list of (none or more) "boot records" which point to files. Each boot record has a few fields, which include what type of system the boot file is for and what type of file it is. This means you could have one CD with several different boot records and several different boot files (maybe one for "PC BIOS 80x86", one for EFI, and one for PowerPC); and the firmware will (hopefully) find and use the right boot record for the system you're booting. This also means you can have a generic "OS installer" CD that works on completely different computers.

For some systems the fields in the boot record also determine what the corresponding boot file contains. For example, for 80x86 PC BIOS, the boot file may be either a floppy disk image, a hard disk image, or a boot loader.

If it's a floppy disk image or hard disk image, then the BIOS uses the disk image to emulate a floppy or hard disk (and assigns the disk image a device number - 0x00 for emulated floppy or 0x80 for emulated hard disk), and loads the first (512-byte) sector from the image at 0x00007C00 and jumps to it; just like it would for a real floppy or hard disk. In my opinion, this is mostly for legacy OSs like DOS that weren't designed to boot from CD.

If the boot file contains a boot loader, then the BIOS loads the entire file into memory at the address specified in the boot record (not necessarily at 0x00007C00) and then jumps to it. This means the file could be 480 KiB and loaded at 0x00001000 if you want. In this case you can use BIOS disk services to read (2048-byte) sectors from the CD; and often the boot loader will have support for the ISO9660 file system and load other files directly from the CD.

For EFI, the boot record always points to an image of an "EFI system partition" (which is mostly just the FAT file system). EFI will mount the image and try to load (and execute) a file from the partition that corresponds to the system type. For example "efi/boot/bootia32.efi" for 32-bit 80x86, "efi/boot/bootia64.efi" for 64-bit 80x86 and other names for other systems.

I'm not too sure how El Torito handles other system types - you'd have to do some research if you're interested in PowerPC or SPARC or whatever.


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