From marquard@zilker.net  Sun May 10 10:14:30 1998
Received: from localhost.zilker.net (jump-k56flex-0016.jumpnet.com [207.8.6.16])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA11270
          for <FreeBSD-gnats-submit@freebsd.org>; Sun, 10 May 1998 10:14:26 -0700 (PDT)
          (envelope-from marquard@zilker.net)
Received: (from marquard@localhost) by localhost.zilker.net (8.8.8/8.8.3) id MAA01779; Sun, 10 May 1998 12:14:19 -0500 (CDT)
Message-Id: <199805101714.MAA01779@localhost.zilker.net>
Date: Sun, 10 May 1998 12:14:19 -0500 (CDT)
From: marquard@zilker.net
Reply-To: marquard@zilker.net
To: FreeBSD-gnats-submit@freebsd.org
Subject: 2.2.6 boot floppy can't mount install CD on matcd0
X-Send-Pr-Version: 3.2

>Number:         6576
>Category:       conf
>Synopsis:       2.2.6 boot floppy can't mount install CD on matcd0
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 10 10:20:01 PDT 1998
>Closed-Date:    Sun May 10 17:49:39 PDT 1998
>Last-Modified:  Sun May 10 17:51:49 PDT 1998
>Originator:     Dave Marquardt
>Release:        FreeBSD 2.2.6-RELEASE i386
>Organization:
None
>Environment:

	Packard Bell Force 446CDT, 75MHz Pentium.  Here's dmesg from
after I installed 2.2.6 by installing 2.2.1 and upgrading from source:

Copyright (c) 1992-1998 FreeBSD Inc.
Copyright (c) 1982, 1986, 1989, 1991, 1993
	The Regents of the University of California.  All rights reserved.

FreeBSD 2.2.6-RELEASE #2: Fri May  8 16:44:46 CDT 1998
    marquard@localhost.zilker.net:/usr/src/sys/compile/LEFSE
CPU: Pentium (75.17-MHz 586-class CPU)
  Origin = "GenuineIntel"  Id = 0x524  Stepping=4
  Features=0x1bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8>
real memory  = 33554432 (32768K bytes)
avail memory = 31014912 (30288K bytes)
Probing for devices on PCI bus 0:
chip0 <Intel 82434NX (Neptune) PCI cache memory controller> rev 17 on pci0:0:0
chip1 <Intel 82378ZB PCI-ISA bridge> rev 3 on pci0:2:0
vga0 <VGA-compatible display device> rev 216 on pci0:3:0
ahc0 <Adaptec 2940A Ultra SCSI host adapter> rev 1 int a irq 11 on pci0:6:0
ahc0: aic7860 Single Channel, SCSI Id=7, 3 SCBs
ahc0:A:4: refuses synchronous negotiation. Using asynchronous transfers
(ahc0:4:0): "UMAX Astra 610S V1.3" type 6 fixed SCSI 2
uk0(ahc0:4:0): Unknown 
(ahc0:4:1): "UMAX Astra 610S V1.3" type 6 fixed SCSI 2
uk1(ahc0:4:1): Unknown 
(ahc0:4:2): "UMAX Astra 610S V1.3" type 6 fixed SCSI 2
uk2(ahc0:4:2): Unknown 
(ahc0:4:3): "UMAX Astra 610S V1.3" type 6 fixed SCSI 2
uk3(ahc0:4:3): Unknown 
(ahc0:4:4): "UMAX Astra 610S V1.3" type 6 fixed SCSI 2
uk4(ahc0:4:4): Unknown 
(ahc0:4:5): "UMAX Astra 610S V1.3" type 6 fixed SCSI 2
uk5(ahc0:4:5): Unknown 
(ahc0:4:6): "UMAX Astra 610S V1.3" type 6 fixed SCSI 2
uk6(ahc0:4:6): Unknown 
(ahc0:4:7): "UMAX Astra 610S V1.3" type 6 fixed SCSI 2
uk7(ahc0:4:7): Unknown 
ahc0:A:5: refuses synchronous negotiation. Using asynchronous transfers
(ahc0:5:0): "IOMEGA ZIP 100 E.08" type 0 removable SCSI 2
sd0(ahc0:5:0): Direct-Access 
sd0(ahc0:5:0): ILLEGAL REQUEST asc:24,0 Invalid field in CDB
sd0 could not mode sense (4). Using ficticious geometry
96MB (196608 512 byte sectors)
Probing for PnP devices:
CSN 1 Vendor ID: MOT1550 [0x5015f435] Serial 0x055f9d96
PnP: override config for CSN 1 LDN 0 vend_id 0x5015f435
sio1: type 16550A
sio1 (siopnp <MOT1550> sn 0x055f9d96) at 0x2e8 irq 5 drq -1 flags 0x0 id 10
Probing for devices on the ISA bus:
sc0 at 0x60-0x6f irq 1 on motherboard
sc0: VGA color <16 virtual consoles, flags=0x0>
sio0 at 0x3f8-0x3ff irq 4 on isa
sio0: type 16550A
lpt0 at 0x378-0x37f irq 7 on isa
lpt0: Interrupt-driven port
lp0: TCP/IP capable interface
psm0 at 0x60-0x64 irq 12 on motherboard
psm0: model Generic PS/2 mouse, device ID 0
fdc0 at 0x3f0-0x3f7 irq 6 drq 2 on isa
fdc0: FIFO enabled, 8 bytes threshold
fd0: 1.44MB 3.5in
wdc0 at 0x1f0-0x1f7 irq 14 flags 0x80048004 on isa
wdc0: unit 0 (wd0): <ST5850A>, 32-bit, multi-block-4
wd0: 815MB (1669248 sectors), 1656 cyls, 16 heads, 63 S/T, 512 B/S
wdc0: unit 1 (wd1): <WDC AC31600H>, 32-bit, multi-block-4
wd1: 1549MB (3173184 sectors), 3148 cyls, 16 heads, 63 S/T, 512 B/S
matcd - Matsushita (Panasonic) CD-ROM Driver by FDIV, Version  1(26) 18-Oct-95
matcdc0 at 0x340-0x343 on isa
matcdc0 Host interface type 1
matcd0: [CR-5631.02]  
npx0 on motherboard
npx0: INT 16 interface
sb0 at 0x220 irq 10 drq 1 on isa
sb0: <SoundBlaster Pro 3.1>
changing root device to wd1s1a
Intel Pentium F00F detected, installing workaround

>Description:

	I created a 2.2.6 boot floppy from the 2.2.6 install CD.  It
booted successfully and I adjusted matcd0 to be found at port 0x340 in
user config, finished booting, and matcd0 was found.  I set the media
type to CD-ROM, selected the Novice install, dedicated all of wd1
except a boot manager area to FreeBSD, partitioned wd1s1, and started
the install.  The install procedure created filesystems and copied
/stand from the boot floppy to the new root partition.  When
sysinstall tried to mount the CD-ROM, it appeared to try to mount
/dev/matcd0c on /dist.  I got an error box saying:

	Error mounting /dev/matcd0c on /dist:  Input/output error (5)

I switched to the debug screen using ALT-F2 and found this message 7
times over:

	matcd0: Illegal data mode for this track while reading block 64

After bringing 2.2.1 up with a 2.2.1 boot floppy that found matcd0 (!)
I mounted the CVS repository disk and took a look at what might have
changed between 2.2.1 and 2.2.6 w.r.t. sysinstall.  Well, in 2.2.1
sysinstall's devices.c had an array device_names[], which I excerpt
here:

static struct {
    DeviceType type;
    char *name;
    char *description;
} device_names[] = {
    { DEVICE_TYPE_CDROM,	"cd0a",		"SCSI CDROM drive"					},
    { DEVICE_TYPE_CDROM,	"mcd0a",	"Mitsumi (old model) CDROM drive"			},
    { DEVICE_TYPE_CDROM,	"scd0a",	"Sony CDROM drive - CDU31/33A type",			},
    { DEVICE_TYPE_CDROM,	"matcd0a",	"Matsushita CDROM ('sound blaster' type)"		},
	.
	.
	.
    { NULL },
};

So in 2.2.1 we were mounting /dev/matcd0a.  In 2.2.6, devices.c has
the same array, but it's changed quite a bit.  Here's the appropriate
excerpt again:

static struct _devname {
    DeviceType type;
    char *name;
    char *description;
    int major, minor, delta, max;
    char dev_type;
} device_names[] = {
    { DEVICE_TYPE_CDROM,	"cd%dc",	"SCSI CDROM drive",	6, 2, 8, 4, 'b'				},
    { DEVICE_TYPE_CDROM,	"mcd%dc",	"Mitsumi (old model) CDROM drive",	7, 2, 8, 4, 'b'		},
    { DEVICE_TYPE_CDROM,	"scd%dc",	"Sony CDROM drive - CDU31/33A type",	16, 2, 8, 4, 'b'	},
    { DEVICE_TYPE_CDROM,	"matcd%dc",	"Matsushita CDROM ('sound blaster' type)", 17, 2, 8, 4, 'b'	},
	.
	.
	.
    { 0 },
};

So in 2.2.6 we're trying to mount /dev/matcd0c and it fails.

I note from the 2.2.6 matcd(4) man page the following:

SUPPORTED OPERATIONS
     The matcd driver supports block and character access.  Partition "a" re-
     turns 2048-byte User Data blocks from data CDs.  Partition "c" returns
     the full 2352-byte Frames from any type of CD, including audio CDs.
     (Partition "c" cannot be "mounted" with cd9660 or other filesystem emula-
     tors.)  No other partitions are supported.

So we should really be mounting /dev/matcd0a, not /dev/matcd0c!

>How-To-Repeat:

	Try to use the 2.2.6 boot floppy to mount from CD-ROM on
matcd0.

>Fix:
	
	I suggest changing this line

    { DEVICE_TYPE_CDROM,	"matcd%dc",	"Matsushita CDROM ('sound blaster' type)", 17, 2, 8, 4, 'b'	},

to

    { DEVICE_TYPE_CDROM,	"matcd%da",	"Matsushita CDROM ('sound blaster' type)", 17, 0, 8, 4, 'b'	},

I built a new boot floppy using this and it worked!

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: jkh 
State-Changed-When: Sun May 10 17:49:39 PDT 1998 
State-Changed-Why:  
Supplied fix applied, thanks!  I wish everyone took as much time and 
trouble with their PRs as this one since it not only gave me the fix 
to this problem (I was unaware that certain CDROM drivers special-cased 
the `c' device this way since IDE and SCSI CDROMs do not) but also to 
the reported scd and mcd driver problems.  Much appreciated. 
>Unformatted:
