Subject: Disklabel oddity
To: None <tech-kern@NetBSD.ORG>
From: Ken Hornstein <kenh@cmf.nrl.navy.mil>
List: tech-kern
Date: 04/18/1996 15:00:09
So, I've been looking at adding multisession support to the SCSI cd
driver.  Doesn't look too hard - looks like the right thing to do is
read the TOC, generate a synthetic disklabel using the information from
the TOC, and then you can just access the the different sessions as different
partitions.

When looking at the disklabel-generation code, I've come across something
that seems rather odd.  From looking at the code in cd.c (and sd.c as well),
it seems that the partition size is stored in the disklabel as 512 byte
blocks, no matter what the actual number of bytes/sector is.  Also, it seems
that this is _not_ true for the partition offset - that seems to be stored
in blocks that are really the size of the media.

Is my understanding of this correct?  If so, does anyone know if this behavior
is historical, or is there some larger purpose I don't quite understand? :-)

Oh, while we're on the subject -- I'm wondering what to do about the case
of a CD-ROM that has more than 8 data tracks.  The Photo-CD I have happens
to have 12 :-)  I know that most of these are not valid ISO-9660 partitions,
but I'm not sure if it makes sense to try to detect an ISO-9660 filesystem
and try to only show those, or have some frobby utility to switch between
different groups of labels, or what.  And does anyone happen to know if there
is any way to differentiate between different data track types?  I've
figured out that I can look at the Q channel codes to determine if it's a
data track, but I don't see any way to differentiate between different
types of data tracks.

--Ken