Hello,
I've been recently tinkering with the standard ISO 9660 filesystem for disk formatting (using a hex editor to create ISO images and then burning those images onto disks). The specification seemed relatively straightforward but Windows (the operating system I was using to test whether the disks were correctly formatted) was not registering the files that I had created on the disk. After changing things around and re-burning ISO images onto about ten disks, I decided to burn a disk using Windows' native disk burner application for comparison.
After doing some testing, I figured out that my problem was that the Logical Block Size I provided, 0x200 bytes (512 bytes, or 2^9, the minimum Logical Block Size as specified by the ISO 9660 Standard) differed from the Logical Block Size that Windows was using, 0x800 (2048 bytes, the typical Logical Sector Size). It seems that even though I provided a 512 Logical Block Size, Windows was still treating the Logical Block Numbers for the directory, path table and file extent base addresses as though my Logical Block Size was 2048 bytes and therefore my directories, path tables and files were not placed at the correct addresses on the disk. In other words, I believe that Windows was taking my Logical Block Numbers and multiplying them by 2048 to get the physical address of the data rather than multiplying the Logical Block Numbers by 512 as specified.
Is this a bug on Windows' part (doubt it because I couldn't get El Torito to work either using a Logical Block Size of 512 bytes) or am I misinterpreting the standard and the way that the Logical Block Size provided affects the usage of Logical Block Numbers?
Is a Logical Block always 2048 bytes regardless of what the Logical Block Size is in the primary volume descriptor? If so, then why does the ISO 9660 Standard make a distinction between Logical Sectors and Logical Blocks and what is the Logical Block Size used for?
The ISO 9660 Standard
Re: The ISO 9660 Standard
To the best of my knowledge from reading the spec and implementing it myself I've yet to see a cd with a logical block size not equal to 2048. If anyone sees a cd with different sector size, would love to know about it
Re: The ISO 9660 Standard
I'm not referring to the sector size of the cd but to the Logical Block Size of the cd. According to the ISO 9660 Standard, they are distinct. I understand that a Logical Block Size that is not equal to 2048 might be uncommon but that shouldn't mean that a cd with a Logical Block Size that is not 2048 (but is of course consistent with the specifications provided by the ISO 9660 Standard) should not function.brain wrote:To the best of my knowledge from reading the spec and implementing it myself I've yet to see a cd with a logical block size not equal to 2048. If anyone sees a cd with different sector size, would love to know about it
Re: The ISO 9660 Standard
According to a quick Google search:
Under ISO 9660 and High Sierra, the CD is also laid out in 2048-byte logical sectors. Both formats also have the concept of a logical block, which is the smallest chunk of file data. Alogical block can be 512, 1024, or 2048 bytes. In general, file access information is laid out in sector-sized units, while actual file data is laid out in block-sized units. On most CDs, the block size is the same as the sector size at 2048 bytes, so this distinction isn't important.
Re: The ISO 9660 Standard
Thanks, I'll assume (according to the information you have found) that the Logical Block Size specified in the volume descriptors is generally ignored and just assumed to be 2048 bytes (or at least for computing logical block addresses) by application programs. Strictly speaking however, this assumption is not consistent with the standard.brain wrote:According to a quick Google search: ...
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: The ISO 9660 Standard
Try any oldfashioned audio CD (and otherwise, playstation stuff works too)brain wrote:I've yet to see a cd with a logical block size not equal to 2048.
Re: The ISO 9660 Standard
Audio CDs don't have volume descriptors or logical block sizes. PlayStation CDs tend to have a logical block size of 2048 as far as I know, but many games do not locate their data using directory entries, instead using a table of absolute sector addresses.Try any oldfashioned audio CD (and otherwise, playstation stuff works too)
Re: The ISO 9660 Standard
The aspect that most concerns me about something like this is that I can follow official documentation 100% correctly and still fail to achieve the expected results from that documentation. I hope this isn't too common in other standards/specifications.
Re: The ISO 9660 Standard
It is possible that Windows, like the OSdev Wiki page on ISO 9660, is mistaking the standard's logical block number for a logical block address. A logical block address is synonymous for a logical sector number whereas a logical block number is what you have addressed here.janktrank wrote:Thanks, I'll assume (according to the information you have found) that the Logical Block Size specified in the volume descriptors is generally ignored and just assumed to be 2048 bytes (or at least for computing logical block addresses) by application programs. Strictly speaking however, this assumption is not consistent with the standard.