On Friday 28 December 2001 21:38, Andreas Mohr wrote:
On Fri, Dec 28, 2001 at 09:24:14PM +1000, Chris Green wrote:
On Friday 28 December 2001 20:24, Andreas Mohr wrote:
I think what should be done is to find out which mixed-mode CDs exactly are "special" and which ones aren't.
I guess it might be music CDs with builtin biography data/programs often that are problematic.
If you get hold of such CDs, then you need to experiment with CDROMREADMODE2, CDROMREADMODE1 and/or CDROMREADRAW ioctl()s (in /usr/include/linux/cdrom.h) to get back sector data. I already verified once that you can get the CD label of "problematic" mixed-mode CDs this way. I couldn't figure out the mechanism that e.g. Windows uses to calculate the serial number of these CDs, though.
You might probably want to figure out a way to have misc/cdrom.c also support label and serial reading of problematic mixed-mode CDs, in a modular way (i.e. one that doesn't look too awful code-wise ;)
Ok - I've been doing some serious experimenting here, including reading the iso 9660 spec :)
I've found some interesting things too.
First, it seems that some CD's don't just store the 'best' data in higher-numbered volume descriptors. Some seem to store 'everything' in the type 1 (primary) descriptor, and only store the modified info in the type 2 (secondary) descriptor. So the routine CDROM_Data_FindBestVoldesc (it returns the highest-numbered descriptor) might need some rethinking...
Secondly, I found a real curiosity in one particular CD: Microsoft's Multimedia Beethoven (about 1992) isn't ISO9660 at all. It's a mixed mode CD, and is readable in Windows, as well as Wine, but the label is screwy (Windows XP gets it wrong too). Instead of using the specification identifier 'CD001' (ISO9660) it uses 'CDROM' and has two dwords stored at the start of the volume descriptor, as well as having a few other discrepancies. I have no conclusive proof as to what specification it's written, but I'm guessing its possibly the original High Sierra format, or perhaps an even earlier, semi-proprietary, spec. Either way, it makes me wonder whether some of the 'strange' mixed-mode CDs are of a similar nature.
Anyway, what I'm thinking is to rewrite the code that deals with CD labels to take into account what I've found so far - I'll also include support to get the label from the 'CDROM' type I've found, so we'll have the right label for that CD too. Quite possibly, that'll fix the 'strange' mixed mode CD's too.
If anyone has an odd CD lying around, they can email me the first 65536 bytes of the CD (hopefully no vendor will care about copyright on their volume descriptors!) so I can compare the structure of the volume descriptors - I've got about 8 of them so far, just use 'dd if=/dev/scd0 of=cd.dmp bs=65536 count=1' and compress the result before emailing it to me :)
regards Chris Green