El-Torito: Difference between revisions

Jump to navigation Jump to search
1,353 bytes added ,  14 years ago
The boot information table is optional (thanks, Brendan).
[unchecked revision][unchecked revision]
(Fleshed out the initial basics for the El-Torito page.)
(The boot information table is optional (thanks, Brendan).)
Line 11:
As mentioned above, it is possible to take your existing floppy or hard drive boot sectors and use emulation to boot from a CD. This part of the document focusses on no-emulation mode, where your boot sector is specifically designed to run from a CD.
 
=== AWriting BareBonesan El-Torito Boot Sector ===
At the start of your El-Torito boot sector, you simply need to set segment registers to known values (as usual) and use the BIOS to load files from the CD as per [[ISO 9660]]. As with a normal floppy or hard disk, DL contains the BIOS drive number.
When creating the boot sector, you need to leave space for the Boot Information Table. This will be created by mkisofs when your boot code is written to the iso image. The Boot Information Table starts at offset 8 and is 56 bytes long. If you are familiar with Bios Parameter Blocks, you can think of the Boot Information Table as doing a similar job.
 
Using [[Mkisofs]], you can write your boot sector to a CD image (.iso) as follows:
 
<Source lang=bash>
mkisofs -R -b path/to/loader.sys -no-emul-boot -boot-load-size 4 -o [IsoFile.iso] [IsoDirectory]
</Source>
 
The path to the loader.sys file (or whatever your stage 1 loader is called) should be the path where the loader will reside on your CD. The [IsoFile.iso] parameter contains the output file and the [IsoDirectory] parameter contains the directory structure to appear on your CD.
 
=== A BareBones Boot Sector with Optional Boot Information Table ===
When creatingwriting the boot sectorCD, youit needis possible to leaveadd spacea forboot theinformation Boottable Informationto provide some information to your boot Tableloader. This willcan be created by mkisofs when your boot code is written to the iso image. The Boot Information Table starts at offset 8 and is 56 bytes long. If you are familiar with Bios Parameter Blocks, you can think of the Boot Information Table as doing a similar job.
 
<Source lang=asm>
Line 40 ⟶ 51:
 
'''bi_Checksum''' is a 32 bit checksum of all the 32-bit values in the boot file, starting at offset 64 (just after the boot information table).
 
To write the boot information table to your ISO image, use the following command:
 
<Source lang=bash>
mkisofs -R -b path/to/loader.sys -no-emul-boot -boot-load-size 4 \
-boot-info-table-o [IsoFile.iso] [IsoDirectory]
</Source>
 
The path to the loader.sys file (or whatever your stage 1 loader is called) should be the path where the loader will reside on your CD. The [IsoFile.iso] parameter contains the output file and the [IsoDirectory] parameter contains the directory structure to appear on your CD.
 
=== What Next? ===
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu