Subject: Re: Custom device driver
To: Jonathan Stone <jonathan@DSG.Stanford.EDU>
From: Mary Rivett <mrivett@flick.lerc.nasa.gov>
List: port-i386
Date: 07/30/1997 16:49:05
> >from (1.1)
> >   # SAMS-II triaxial acceleration sensor head
> >   device  tsh at isa: isadma 
> >   file    dev/isa/tsh.c                  tsh-needs-flag
> >   # SAMS-II analog i/o board (RTD-DM5416)
> >   device  dm at isa
> >   file    dev/isa/dm.c                  dm-needs-flag
> >
> >to (1.2.1)
> >   # SAMS-II triaxial acceleration sensor head
> >   device  tsh: isadma
> >   attach  tsh at isa
> >   file    dev/isa/tsh.c                 tsh-needs-flag
> >   # SAMS-II analog i/o board (RTD-DM5416)
> >   device  dm
> >   attach  dm at isa
> >   file    dev/isa/dm.c                  dm-needs-flag


> those should be
>		"dm needs-flag"
> and
>		"tsh needs-flag"
>
> respectively. I guess that's a typo, since config should complain if
> it sees unknown attributes.

You're right - it was a typo.

> The ENOENT return sounds as if you've misplaced configuring the cdevsw
 >entries for  your custom driver.  
>
> The mapping from char (or block) special-device to a device-driver is
> determined by the cdevsw[] array; cdevsw[i] has the entrypoints for
> the driver for char devices with major number 'i'.  
>
> Are you *sure* the cdevsw entries for 1.2.1 are not just carried
> acrorss into cdevsw[] but in the right position for the major
> device number you're using?

As far as I can tell they are in the right position, which happens to be
the same position they were in for 1.1. The entries are:

    cdev_tsh_init(NTSH,tsh),          /* 44: SAMS-II tsh */
    cdev_dm_init(NDM, dm),            /* 45: SAMS-II i/o card */

The really strange thing is that the one with major number 45 works
but the one before it in the array does not.