Subject: CD9660 read panics
To: None <port-sparc@NetBSD.ORG>
From: None <r.evans@ic.ac.uk>
List: port-sparc
Date: 11/30/1995 22:54:48
Okay, I think I know the cause of the panics that Greywolf and myself
reported earlier with reading CD9660 format disks on Suns.
To decide whether or not to do clustered i/o, the cd9660_vnops.c file
has a preprocessor directive to check if ISO_DEFAULT_BLOCK_SIZE (2048)
is greater than NBPG. If you _only_ have "SUN4" pr "SUN4C" defined in
your kernel config you're okay because there's a straight define of
NBPG to 8192 or 4096. However, GENERIC has the following line:
options "SUN4", "SUN4C"
What happens in this case (in sys/arch/sparc/include/param.h) is that
NBPG is defined as "extern int nbpg" which is set in locore.s. This is
fine for the routines interpreting it at runtime, but poor old cpp
doesn't get a look in and ends up checking if "2048 >= nbpg", which
evaluates to true in this context.
Not all ports have an "nbpg" variable by the look of things, but is
there some variable which contains the pagesize? If so, perhaps the
test could be made dynamically in cd9660_open()?
(Let me know if this is embarrasingly far off the mark, or if I should
submit it as a pr.)
Cheers,
Rob