NetBSD Problem Report #26138

Received: (qmail 8575 invoked by uid 605); 2 Jul 2004 01:42:23 -0000
Message-Id: <>
Date: Fri,  2 Jul 2004 01:42:16 +0000 (UTC)
Subject: kernel panics on microvax when you use RX50 floppy drive
X-Send-Pr-Version: www-1.0

>Number:         26138
>Category:       port-vax
>Synopsis:       kernel panics on microvax when you use RX50 floppy drive
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-vax-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jul 02 01:43:00 +0000 2004
>Closed-Date:    Thu Mar 29 15:49:40 +0000 2018
>Last-Modified:  Thu Mar 29 15:50:00 +0000 2018
>Originator:     Kirk Russell
>Release:        1.6.1, 1.6.2 and 2.0_BETA 200406230000
Bridlewood Software Testers Guild
NetBSD simhvax 1.6.1 NetBSD 1.6.1 (GENERIC) #0: Wed Apr  9 05:42:03 UTC 2003 vax
The 1.6.1, 1.6.2 and 2.0_BETA 200406230000 netbsd kernel crashes when you use
the RX50 floppy drive.  This used to work with 1.6, so I assume this is a

I used ( to:
- format a 5.25" DS/DD floppy -- same floppies I used on an apple2
    format b: /foreign /rx50
- copy the NetBSD 1.3.2 RX50 boot image to the floppy disk
    $ cksum rx50-bootdisk-132
    2534065445 262144 rx50-bootdisk-132
- take an image of the entire floppy
    $ cksum vaxboot.bin
    74898937 409600 vaxboot.bin

I booted this floppy on a microVAX -- KA640-A with a RQDX1.  And on the simh
V3.2-0 VAX emulator.  In both cases, I got the ":" prompt, ran "copy" and
got the "read from?" prompt.  For more info, about the use of this floppy,
see  And when I booted the NetBSD 1.6
GENERIC kernel, on the simh/VAX emulator and the microVAX, I am able to use
the RX50 floppy okay:
    simhvax# uname -a
    NetBSD simhvax 1.6 NetBSD 1.6 (GENERIC) #0: Wed Sep 11 10:14:37 UTC 2002 vax
    simhvax# cksum /dev/rx0a
    74898937 409600 /dev/rx0a
So, I assume that:
- the floppy disk is okay
- the simh/VAX configuration is okay
- the microVAX hardware configuration is okay
- the RQDX1 appears to be supported with NetBSD 1.6

When I boot the NetBSD 1.6.2 or 1.6.1 GENERIC kernel on the simh/VAX emulator,
the kernel crashes when I try to use the RX50 floppy image.  On the microVAX,
I get returned to the console >>> prompt during the cksum command.
    simhvax# uname -a
    NetBSD simhvax 1.6.1 NetBSD 1.6.1 (GENERIC) #0: Wed Apr  9 05:42:03 UTC 2003 vax
    simhvax# cksum /dev/rx0a
    ra0: dk_busy < 0
    panic: disk_unbusy
    Stopped at      disk_unbusy+0x37:       mfpr    $18, r2
    db> trace
    panic: disk_unbusy
    Stack traceback :
    0x80353ab8: disk_unbusy+0x37(0x885e1c2c,0x800)
    0x80353b14: rriodone+0x44(0x885e1900,0x89a124c8)
    0x80353b34: mscp_dorsp+0x32b(0x885dfc00)
    0x80353b6c: mscp_intr+0x23(0x885dfc00)
    0x80353ba0: udaintr+0x24(0x885d4d00)
    0x80353bc4: eidsptch+0x17(0x8061ea80)
    0x8a9b6cf8: bpendtsleep+0x0(0x89a124c8,0x11,0x8015a46f,0,0)
    0x8a9b6d24: biowait+0x28(0x89a124c8)
    0x8a9b6d68: bread+0x6a(0x816dbd78,0,0x800,0xffffffff,0x8a9b6dcc)
    0x8a9b6d8c: spec_read+0x16c(0x8a9b6e28)
    0x8a9b6dd8: ufsspec_read+0x33(0x8a9b6e28)
    0x8a9b6e0c: VOP_READ+0x3f(0x816dbd78,0x8a9b6eb8,0,0x88634200)
    0x8a9b6e3c: vn_read+0x78(0x80683340,0x80683368,0x8a9b6eb8,0x88634200,0x1)
    0x8a9b6e64: dofileread+0x79(0x8061ea80,0x3,0x80683340,0x7fffbbac,0x4000,0x80683368,0x1,0x8a9b6f58)
    0x8a9b6ed8: sys_read+0x43(0x8061ea80,0x8a9b6f60,0x8a9b6f58)
    0x8a9b6f20: syscall+0x103(0x8a9b6fb4)

Here is the 2.0_BETA GENERIC 200406230000 kernel on the simh/VAX emulator
and the microVAX.  The kernel crashes when I try to use the RX50 floppy
    # uname -a
    NetBSD  2.0_BETA NetBSD 2.0_BETA (GENERIC) #0: Mon Jun 28 07:27:40 UTC 2004 vax
    # cksum /dev/rx0a
    panic: Segv in kernel mode: pc 8013f38b addr a8
    Stopped in pid 13.1 (cksum) at  netbsd:trap+0x297:      movl    $2, -72(fp)
    db> trace
    panic: Segv in kernel mode: pc %x addr %x
    Stack traceback :
    0x849eeb5c: trap+0x297(0x849eec30)
    0x849eec30: trap type=0x4c code=0xa8 pc=0x8013f38b psl=0xd70004
    0x849eebfc: rrfillin+0x8f(0x806c370c,0x803d5948)
    0x849eec7c: mscp_kickaway+0xc1(0x82835c00)
    0x849eecb0: mscp_strategy+0x23(0x806c370c,0x82835c00)
    0x849eecdc: rxstrategy+0xca(0x806c370c)
    0x849eed04: spec_strategy+0xee(0x849eed54)
    0x849eed2c: VOP_STRATEGY+0x2f(0x806bd714,0x806c370c)
    0x849eed60: bread+0x64(0x806bd714,0,0,0x800,0xffffffff,0x849eedcc)
    0x849eed80: spec_read+0x16e(0x849eee28)
    0x849eedd8: ufsspec_read+0x33(0x849eee28)
    0x849eee0c: VOP_READ+0x3f(0x806bd714,0x849eeeb8,0,0x82808e80)
    0x849eee3c: vn_read+0x78(0x80472070,0x80472098,0x849eeeb8,0x82808e80,0x1)
    0x849eee64: dofileread+0x7f(0x80424960,0x3,0x80472070,0x7fffbbd0,0x4000,0x80472098,0x1,0x849eef58)
    0x849eeed8: sys_read+0x47(0x8042b2e8,0x849eef60,0x849eef58)
    0x849eef20: syscall+0xdc(0x849eefb4)

Put RX50 floppy in drive.
Boot 1.6.1 or newer kernel on microvax
run "cksum /dev/rx0a"

From: Kirk Russell <>
To:, <>
Cc:, <>
Subject: Re: port-vax/26138: kernel crashes on microvax when you use RX50
 floppy drive
Date: Sat, 8 Jan 2005 21:19:25 -0500 (EST)


 I incrementally backed out of 1.6.1 changes until the kernel stopped crashing.
 The whole sys/arch/vax tree made no difference.  But vs 1.30 of
 src/sys/dev/mscp/mscp_disk.c did make a difference -- with 1.6.X, the kernel
 will crash with version, but appears to work okay with version 1.30.

 Here are the diffs that added the bug into the 1.6.X tree:

 It appears that rriodone() is shared by the ra and rx devices.  But
 rriodone() only calls disk_unbusy() with the ra context but never the rx
 context -- that cannot be a good thing.  But looking at the rrfillin()
 routine -- it has code to distinguish between the ra and rx devices.  I
 cut and pasted this code, from rrfillin(), into rriodone().  This added code
 appears to stop the kernel from crashing.

 Here are the diffs to mscp_disk.c verision, that I tried:

 *** 856,862 ****
         /* We assume that this is a reasonable drive. ra_strategy should
            already have verified it. Thus, no checks here... /bqt */
         unit = DISKUNIT(bp->b_dev);
 !       ra = ra_cd.cd_devs[unit];
         disk_unbusy(&ra->ra_disk, bp->b_bcount);

 --- 856,869 ----
         /* We assume that this is a reasonable drive. ra_strategy should
            already have verified it. Thus, no checks here... /bqt */
         unit = DISKUNIT(bp->b_dev);
 ! #if NRA
 !       if (major(bp->b_dev) == RAMAJOR)
 !               ra = ra_cd.cd_devs[unit];
 ! #endif
 ! #if NRX
 !       if (major(bp->b_dev) != RAMAJOR)
 !               ra = rx_cd.cd_devs[unit];
 ! #endif
         disk_unbusy(&ra->ra_disk, bp->b_bcount);


 Kirk Russell            <>  
 Bridlewood Software Testers Guild                  Ottawa Ontario Canada

From: Sergey Svishchev <>
Subject: Re: port-vax/26138
Date: Sun, 1 Oct 2006 13:16:53 +0400

 Rev 1.45. of mscp_disk.c should fix this:

 date: 2005/01/04 19:36:48;  author: matt;  state: Exp;  lines: +14 -3
 branches:  1.45.2;  1.45.4;
 Make sure to get the right softc in rriodone.

 Sergey Svishchev

From: Kirk Russell <>
Cc:, <>
Subject: Re: port-vax/26138
Date: Sun, 1 Oct 2006 11:12:45 -0400 (EDT)

 I think the fix to mscp_disk.c is part of the solution -- because this
 fix appear to work okay with NetBSD 1.6.X.  But it doesn't appear
 to be enough because I can still get most/all future releases of
 the kernel to panic/crash when using an MSCP floppy diskette.
 In other words, there are still more MSCP floppy driver regressions
 somewhere in mscp_disk.c and this issue is not resolved yet.

 Here is a panic using simh and NetBSD 4.0_BETA.

 VAX simulator V3.6-0

 KA655-B V5.3, VMB 2.7
 Performing normal system tests.
 Tests completed.
 >>>boot dua2
 MCopyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
     The NetBSD Foundation, Inc.  All rights reserved.
 Copyright (c) 1982, 1986, 1989, 1991, 1993
     The Regents of the University of California.  All rights reserved.

 NetBSD 4.0_BETA (INSTALL) #0: Tue Sep  5 01:20:29 EDT 2006
 MicroVAX 3800/3900
 cpu: KA655, CVAX microcode rev 6 Firmware rev 83
 total memory = 32708 KB
 avail memory = 28872 KB
 mainbus0 (root)
 ibus0 at mainbus0
 uba0 at ibus0: Q22
 dz1 at uba0 csr 160100 vec 304 ipl 15
 uda0 at uba0 csr 172150 vec 774 ipl 15
 mscpbus0 at uda0: version 3 model 3
 mscpbus0: DMA burst size set to 4
 ra0 at mscpbus0 drive 0: RA92
 ra1 at mscpbus0 drive 1: RA92
 ra2 at mscpbus0 drive 2: RRD40
 rx0 at mscpbus0 drive 3: RX50
 md0: internal 1536 KB image area
 boot device: ra2
 root on md0a dumps on md0b
 root file system type: ffs
 Clock has gained 25 days - CHECK AND RESET THE DATE.
 # dd if=/dev/rx0a of=/dev/null
 panic: Segv in kernel mode: pc 800a8432 addr d8

State-Changed-From-To: open->closed
State-Changed-When: Thu, 29 Mar 2018 15:49:40 +0000
Solved now (after 14 years!).  Thanks for the bug report :-)

From: "Anders Magnusson" <>
Subject: PR/26138 CVS commit: src/sys/arch/vax/conf
Date: Thu, 29 Mar 2018 15:45:15 +0000

 Module Name:	src
 Committed By:	ragge
 Date:		Thu Mar 29 15:45:15 UTC 2018

 Modified Files:
 	src/sys/arch/vax/conf: majors.vax

 Log Message:
 Use same major for rx floppies for both b and c devices.
 Works around a bug in the mscp disk driver, and solves PR port-vax/26138.

 To generate a diff of this commit:
 cvs rdiff -u -r1.27 -r1.28 src/sys/arch/vax/conf/majors.vax

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.


NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD:,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.