Any El Torito walkthroughs or comprehensive docs?

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
abachler
Member
Member
Posts: 33
Joined: Thu Jan 15, 2009 2:21 pm

Any El Torito walkthroughs or comprehensive docs?

Post by abachler »

I've looked around at various ISO-9660 docs, but every one seems to be missing key details about the encodings. So I was wondering if there is a walkthrough for putting together an ISO-9660 bootable CD at the hex level, not one that uses other utilities. So far I've looked at these -

http://odin.himinbi.org/xp_cds/eltorito_extraction.html
http://en.wikipedia.org/wiki/ISO_9660#I ... ifications
http://alumnus.caltech.edu/~pje/iso9660.html
http://users.telenet.be/it3.consultants ... O9960.html
http://www.mscience.com/logical.html
http://www.ecma-international.org/publi ... ma-119.pdf

and while they give good info, and combined probably provide all the information I will need, I was looking for something more like a tutorial specifc to writing a bootable CD.
itisiuk
Member
Member
Posts: 98
Joined: Mon Mar 24, 2008 1:46 pm

Re: Any El Torito walkthroughs or comprehensive docs?

Post by itisiuk »

this works, and use the grub package at the bottom to get stage2_ElTorito
http://wiki.osdev.org/Bootable_El-Torit ... RUB_Legacy
User avatar
abachler
Member
Member
Posts: 33
Joined: Thu Jan 15, 2009 2:21 pm

Re: Any El Torito walkthroughs or comprehensive docs?

Post by abachler »

itisiuk wrote:this works, and use the grub package at the bottom to get stage2_ElTorito
http://wiki.osdev.org/Bootable_El-Torit ... RUB_Legacy
I appreciate the link, but I am specifically looking for documentation to create my own el torito boot disk, i.e. 'not one that uses other utilities', or one that is pre-rolled.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Any El Torito walkthroughs or comprehensive docs?

Post by Brendan »

Hi,

You should only really need the ISO9660 specification (which you've already listed) and the El Torito specification. Apart from that, it's a good idea to get a hexdump of an existing bootable CD (doesn't matter which one) because some of the fields aren't described well in either specification.

You could also use my code as an example; although I should mention I've only tested booting it in Bochs (to test if it'll boot), and mounting it as a loopback device (to test if the ISO9660 file-system is sane). Note: my code uses NASM to generate a bootable CD image, so i'ts not quite "hex level" and a utility is involved.... ;)


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.
User avatar
abachler
Member
Member
Posts: 33
Joined: Thu Jan 15, 2009 2:21 pm

Re: Any El Torito walkthroughs or comprehensive docs?

Post by abachler »

Yes I am also using nasm to assemble the iso image. The extra info in your code will come in handy im sure. Thanks.
User avatar
SpyderTL
Member
Member
Posts: 1074
Joined: Sun Sep 19, 2010 10:05 pm

Re: Any El Torito walkthroughs or comprehensive docs?

Post by SpyderTL »

The ISO 9660 wiki page on OSDev describes the descriptor tables pretty well (http://wiki.osdev.org/ISO_9660), but it only mentions the boot descriptor. (I'll update the wiki page when I get a second.) However, the boot descriptor just tells you what boot specification is used, and where the actual boot information is located.

Code: Select all

ISO 9660 Boot Record Descriptor
char[32] BootSystemID   // ASCII encoded.  For El Torito, it should be "EL TORITO SPECIFICATION" followed by nine zeros.
byte[32] Reserved
int32 BootCatalogBlock  // The physical block where the El Torito boot information is located.
byte[1973] Reserved
Using the BootCatalogBlock value to find the location of the El Torito boot information, you will find the following sequence of tables:

Code: Select all

El Torito Validation Entry
byte Header ID
byte Platform ID
byte[2] Reserved
char[24] ID   // ASCI Encoded
int16 Checksum
byte Key1
byte Key2

El Torito Default Entry
byte BootIndicator
byte BootMediaType
int16 LoadSegment
byte SystemType
byte Reserved
int16 SectorCount   // The number of 2048 byte blocks to load
int32 FirstBlock  // The starting block of the boot loader
byte[20] Reserved

El Torito Boot Section Header Entry (multiple)
byte HeaderIndicator  // Zero for terminating entry
byte PlatformID
int16 SectionCount  // The number of section entries following this header
char[30] SectionID  // ASCII encoded

El Torito Boot Section Entry
byte BootIndicator
byte BootMediaType  // Contains flag (bit 5) denoting that this entry is followed by one or more extension entries
int16 LoadSegment
byte SystemType
byte Reserved
int16 SectorCount
int32 FirstBlock
byte SectionCriteriaType
byte[5] Reserved

El Torito Boot Section Extension Entry
byte ExtensionIndicator
byte Flags  // Contains flag (bit 5) denoting that this entry is followed by another extension entry
byte[30] SelectionCriteria
This should give you enough information to get you started creating a bootable ISO image (or reading one). I will update the Wiki to include this information shortly.
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
Post Reply