libcdio-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libcdio-devel] CD_MSF_FORMAT vs LBA on NetBSD


From: Greg Troxel
Subject: [Libcdio-devel] CD_MSF_FORMAT vs LBA on NetBSD
Date: Fri, 12 Oct 2018 22:02:16 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix)

(I have newly joined the list; Rocky appeared on a NetBSD list and asked
about libcdio on NetBSD.  I'm been a NetBSD/pkgsrc developer for many
years.)

On a system running netbsd-7 amd64 (which is the old but supported
stable release), I built libcdio and libcdio-paranoia from their
respective git master branches, and installed to /usr/local.  (At first
I had release libcdio in /usr/pkg, but that shadowed the libcdio in
/usr/local, so I removed it to avoid test confusion.)

libcdio is in pkgsrc, but until this week was quite old.
libcdio-paranoia is not in pkgsrc.  Together this is a clue that there
are likely few NetBSD users.

Running "cd-paranoia -B" worked, with two apparently-harmless instances
of
  405: Option not supported by drive
in the log.
 
This was therefore using the CD_MSF_FORMAT setting in
lib/driver/netbsd.c.  I gather this file is used also on OpenBSD, due to
the usual commonality of ioctls that tends to exist among the BSDs.

If I followed summaries of earlier list traffic correctly, on OpenBSD
the CD_MSF_FORMAT does not work, but CD_LBA_FORMAT does, and there is a
not-yet-merged patch to change from MSF to LBA, on OpenBSD only.

I made the following change in libcdio:

  diff --git a/lib/driver/netbsd.c b/lib/driver/netbsd.c
  index b1fc6b6c..81a45604 100644
  --- a/lib/driver/netbsd.c
  +++ b/lib/driver/netbsd.c
  @@ -324,7 +324,7 @@ _cdio_read_toc(_img_private_t *_obj)
                   return false;
           }

  -        req.address_format = CD_MSF_FORMAT;
  +        req.address_format = CD_LBA_FORMAT;
           req.starting_track = FIRST_TRACK_NUM;
           req.data_len = (TOTAL_TRACKS + 1) /* leadout! */
                   * sizeof(struct cd_toc_entry);

and rebuilt, and cd-paranoia then reported:

  SCIOCCOMMAND cmd 0xbe sts 3
  009: CDROM reporting illegal table of contents

Looking at NetBSD kernel sources, it seems that LBA and MSF should both
be supported, but also that the MMC stuff is marked not 100% baked.

So it seems that moving NetBSD to CD_LBA_FORMAT at best needs more work,
and that the LBA change should be ifdef'd for OpenBSD for now.

(If lib/driver/netbsd.c is actually used on OpenBSD, it would be nice to
have a comment at the front of the file explaining this.)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]