Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Aug 1996 10:32:04 -0700
From:      Arve Ronning <arver@sn.no>
To:        freebsd-hackers@freebsd.org
Cc:        arver@sn.no, Arve.Ronning@alcatel.no
Subject:   2.1.5R & ATAPI CDROM Problems
Message-ID:  <3218A514.1228@sn.no>

next in thread | raw e-mail | index | archive | help
---------------------------------------------
<POSTMASTER@CompuServe.COM> responded
> Mailbox 103350.3250 is currently full.
> Please resend your message at a later time.to my original message. Hence the resend !
---------------------------------------------

Hello FreeBSD world !

After installing a Hitachi CDR-7730 ATAPI CDROM drive on my FreeBSD
2.1.5R box (and verifying that it works under DOS) I discovered a 
problem with mounting it :

# mount_cd9660 /dev/wcd0c /mnt
mount_cd9660: /dev/wcd0c: Device not configured

Judging from comp.unix.bsd.freebsd.misc and the various FreeBSD mailing
lists, *some* ATAPI CDROM drives have had this problem with FreeBSD for
the past year or so. To my knowledge, there is not much work being
done on the ATAPI driver at the moment (please correct me if I am 
wrong:).

So, I boldly plunged into the source and modified the /kernel in an
attempt to find out what causes the 'Device not configured' response.
But be warned all you gurus; I am a UN*X pre-novice and a C amateur,
so please don't judge me too harshly:).

First, some info on my FreeBSD box:

FreeBSD 2.1.5-RELEASE #4: Sat Aug 17 22:05:32 MET DST 1996
    root@ARon.home.no:/usr/src/sys/compile/GENERIC
CPU: 100-MHz Pentium 815\\100 (Pentium-class CPU)
  Origin = "GenuineIntel"  Id = 0x525  Stepping=5
  Features=0x1bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8>
real memory  = 41943040 (40960K bytes)
avail memory = 38535168 (37632K bytes)
Probing for devices on PCI bus 0:
chip0 <Intel 82437 PCI cache memory controller> rev 2 on pci0:0
chip1 <Intel 82371 PCI-ISA bridge> rev 2 on pci0:7:0
chip2 <Intel 82371 Bus-master IDE controller> rev 2 on pci0:7:1
Probing for devices on the ISA bus:
sc0 at 0x60-0x6f irq 1 on motherboard
sc0: MDA/hercules <16 virtual consoles, flags=0x0>
ed0 not found at 0x280
ed1 not found at 0x300
sio0 at 0x3f8-0x3ff irq 4 on isa
sio0: type 16550A
sio1 at 0x2f8-0x2ff irq 3 on isa
sio1: type 16550A
sio2: disabled, not probed.
sio3: disabled, not probed.
lpt0 at 0x378-0x37f irq 7 on isa
lpt0: Interrupt-driven port
lp0: TCP/IP capable interface
lpt1 not found at 0xffffffff
mse0 not found at 0x23c
psm0: disabled, not probed.
fdc0 at 0x3f0-0x3f7 irq 6 drq 2 on isa
fdc0: NEC 72065B
fd0: 1.44MB 3.5in
wdc0 at 0x1f0-0x1f7 irq 14 on isa
wdc0: unit 0 (wd0): <QUANTUM FIREBALL1080A>
wd0: 1039MB (2128896 sectors), 2112 cyls, 16 heads, 63 S/T, 512 B/S
wdc1 at 0x170-0x177 irq 15 on isa
wdc1: unit 0 (wd2): <ST3250A-XR>
wd2: 204MB (417792 sectors), 1024 cyls, 12 heads, 34 S/T, 512 B/S
wdc1: unit 1 (atapi): <HITACHI CDR-7730/0008a>, removable, iordy
wcd0: 689Kb/sec, 128Kb cache, audio play, 128 volume levels, ejectable 
tray
wcd0: medium type unknown, unlocked
bt0 not found at 0x330
uha0 not found at 0x330
aha0 not found at 0x330
aic0 not found at 0x340
nca0 not found at 0x1f88
nca1 not found at 0x350
sea0 not found
wt0 not found at 0x300
mcd0: timeout getting status
mcd0 not found at 0x300
matcdc0 not found at 0x230
scd0 not found at 0x230
ie0 not found at 0x360
ep0 not found at 0x300
ix0 not found at 0x300
le0 not found at 0x300
lnc0 not found at 0x280
ze0 not found at 0x300
zp0 not found at 0x300
npx0 on motherboard
npx0: INT 16 interface
1.code=1, .status=81, .error=84
2.code=1, .status=81, .error=84


The two last lines are written by my /kernel modifications
when I do the 'mount_cd9660 /dev/wcd0c /mnt'. Note that the
numbers are DECIMAL.

Kernel modifications :


*** wcd.c.ori   Mon Oct 23 00:14:34 1995
--- wcd.c       Sat Aug 17 22:05:06 1996
***************
*** 390,395 ****
--- 390,398 ----
        result = atapi_request_wait (t->ata, t->unit, 
ATAPI_TEST_UNIT_READY,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);

+       printf("1.code=%d, .status=%d, .error=%d\n", result.code,
+               result.status, result.error);
+
        if (result.code == RES_ERR &&
            (result.error & AER_SKEY) == AER_SK_UNIT_ATTENTION) {
                t->flags |= F_MEDIA_CHANGED;
***************
*** 398,403 ****
--- 401,408 ----
                        0, 0, 0, 0, 0, 0, 0, 0, 0);
        }
        if (result.code) {
+               printf("2.code=%d, .status=%d, .error=%d\n", result.code,
+                       result.status, result.error);
                wcd_error (t, result);
                return (ENXIO);
        }


So, what is happening ?

With my limited knowledge, I interpret the result structure returned 
by the atapi_request_wait() call to mean :
result.code == 0x01 == RES_ERR == i/o finished with error
result.status == 0x51 == ARS_DRDY | ARS_DSC | ARS_CHECK == 
					error, see sense code
result.error == 0x54 == AER_SK_ILLEGAL_REQUEST | AER_ILI == 
					invalid command parameters 
					and/or length

Which means that the Hitachi CDR-7730 rejects the ATAPI_TEST_UNIT_READY
command because of illegal command parameters.

Also, why the 'wcd0: medium type unknown, ...' during probing ? Is this
significant ? (The disc *is* readable from DOS and it *is* in the drive
during the FreeBSD boot:).

So, what should I do ?

- Scrap the thing and buy another CDROM drive that is known to
  work with FreeBSD ? (Not a good idea, I don't like giving up:).

- Did I forget or misunderstand something ? (Like LKM cd9660_mod ?).

- Try to convince some of you people that this is worth investing
  some time and cooperative effort ? (I could at least test any new
  ATAPI CDROM drivers for the 2.1.5R /kernel).

So, what say ye ?

Any suggestions/advice/guidance/help/assistance/cooperation would
be greately & gratefully accepted.

AND, two major points :

- I do not subscribe to hackers@freebsd.org, so please Cc: arver@sn.no

- I have been following this UN*X thread from 386BSD through NetBSD to
  FreeBSD and I am impressed by the work done by all involved. Not that
  I am able to judge the quality of the source code or anything like 
that.
  What impresses me most is the way you organize and get things done out
  there on the NET. Keep up the good work !

Arve




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3218A514.1228>