About ISO 9660 volume descriptors, path tables etc sizes
Posted: Thu Dec 29, 2011 6:52 am
Hi everyone o/
I'm trying to boot my OS from CD created by misofs, using el-torito with no-emulation. In order to learn ISO 9660, I was programming in C a simple program that parses an ISO image and shows the contents. The program shows correctly primary volumes descriptors, but it doesn't get even closer to show path tables and/or directories and files.
For instance, program shows that LBA of path table is in sector 0x15, but using hexdump it shows that it appears to be in sector 0x18. So my first question is: are LBA and sector numbers equivalents? E.g LBA 0 is sector 0, LBA 1 is sector 1 and so on. If there's no equivalency, how can I convert from sectors to LBA and from LBA to sectors? I've searched about CHS, but I could not found how many heads and cylinders a CD has, only the sector's size, that was 2048 bytes (which is also the size reported by the primary volume descriptor)
My other question is: is it possible to a path table, a directory or file to not start in the beginning of a sector?
Some other info:
- using x86, so I am reading the LSB fields
- to generate the iso, i used: mkisofs -R -b boot.img -no-emul-boot -boot-load-size 4 -o cd.iso DIR/
The output of the above command was:
I: -input-charset not specified, using utf-8 (detected in locale settings)
Size of boot image is 4 sectors -> No emulation
Total translation table size: 2048
Total rockridge attributes bytes: 414
Total directory bytes: 616
Path table size(bytes): 10
Max brk space used 0
898 extents written (1 MB)
And here is the output of hexdumpc: http://pastebin.com/18cJxYJ0
I'm trying to boot my OS from CD created by misofs, using el-torito with no-emulation. In order to learn ISO 9660, I was programming in C a simple program that parses an ISO image and shows the contents. The program shows correctly primary volumes descriptors, but it doesn't get even closer to show path tables and/or directories and files.
For instance, program shows that LBA of path table is in sector 0x15, but using hexdump it shows that it appears to be in sector 0x18. So my first question is: are LBA and sector numbers equivalents? E.g LBA 0 is sector 0, LBA 1 is sector 1 and so on. If there's no equivalency, how can I convert from sectors to LBA and from LBA to sectors? I've searched about CHS, but I could not found how many heads and cylinders a CD has, only the sector's size, that was 2048 bytes (which is also the size reported by the primary volume descriptor)
My other question is: is it possible to a path table, a directory or file to not start in the beginning of a sector?
Some other info:
- using x86, so I am reading the LSB fields
- to generate the iso, i used: mkisofs -R -b boot.img -no-emul-boot -boot-load-size 4 -o cd.iso DIR/
The output of the above command was:
I: -input-charset not specified, using utf-8 (detected in locale settings)
Size of boot image is 4 sectors -> No emulation
Total translation table size: 2048
Total rockridge attributes bytes: 414
Total directory bytes: 616
Path table size(bytes): 10
Max brk space used 0
898 extents written (1 MB)
And here is the output of hexdumpc: http://pastebin.com/18cJxYJ0