Hi,
The (Legacy) BIOS will usually load a single sector. That doesn't mean that a sector is only 512 bytes. A sector is a sector. If that sector happens to be on a media device that has 2048-byte sectors, then it will load 2048 bytes. Same for 4096-byte sectors.
However, and this is a big however. It also depends on what the BIOS is doing. If the BIOS sees a Bootable CDROM and is in emulation mode, the emulation mode will determine if it has 512 bytes or 2048 bytes. For example, if the emulation is a 1.44Meg floppy, the BIOS might load 2048 bytes, but you can only assume that the first 512 are valid. You must treat the media device as a 1.44meg floppy and read any remaining 512-byte sectors that your boot code might need.
For example, if your boot code needs four (4) 512-byte sectors and you just booted from a CDROM that is using 1.44meg floppy emulation, even though the BIOS might have already loaded the 2048 bytes your code requires, you must call the BIOS to load three (3) more 512-byte sectors from the media, the second, third, and fourth (emulated) sectors. It is up to the BIOS whether it thinks it needs to read from the physical device or know that it has the 2048 bytes in memory and just reads from there. Your code must not assume so.
If the BIOS is in Hard Drive emulation (when booting from a CDROM), it might load a few more than one (512-byte) sector. The El Torito Specification states that the BIOS should read up to 256 sectors, depending on the value found in the boot catalog. (256 is from memory, i.e.: a single byte used for the count).
This same specification (go look it up) also allows you to specify which emulation you are using, the endian-ness of the information, etc.
Therefore, depending on whether your boot code is specific for the CDROM, and if so, what filesystem (ISO9660 or UDF), or if your code is generic and can easily be emulated as a hard drive image, will determine how many bytes are loaded for the first sector.
Ben
-
http://www.fysnet.net/osdesign_book_series.htm