Device driver help

George Robbins grr at cbmvax.commodore.com
Wed Jun 12 09:20:10 AEST 1991


In article <haines.676665330 at valkyrie> haines at valkyrie.ecn.uoknor.edu (Mark Haines) writes:
> The long, boring story:
> 
>    I recently took a job with the O.U. physics department. We have a DEC
> MicroVAX II. When I got here it was running under Ultrix v1.2 and we had
> v2.3 with manuals and media. Also hanging around is some code for a device
> driver. The driver code is for a DRV11-WA, a DMA card.  When I first started
> I had no idea what I was doing. But as time progressed, I learned more and
> more about what's going on.

>    However, I am now at an impass. There are questions I can't seem to find
> answers to. I seem to be able to compile the code into the kernel, but when
> I try and open the device through a node, it comes back with "No such device
> or address". This is the same error I get when I make a node with an
> arbitrary number. I've listed my device driver in the devices file, so
> why doesn't it find it? Is there something else I'm missing?

If the device is in the cdevsw table and your major node matches, then the
open should be getting to your driver, where kernel printf or other debugging
techniques can be used.  There might be some requirement that the probe
routine return something to admit that the device is present.

>    It might be good if someone out there could suggest a book or paper on
> writing a device driver. I've looked through a couple of Unix books and
> understand the basic principles, but not the specifics.

There are several sources: The Unix Device Driver Book, which is mostly
oriented towards AT&T unix, some documents in the Sun manual set which
are partly sun specific, but at least talk in BSD terms and there is a
new document in the Ultrix 4.2 manual set which describes writing turbo-
channel drivers, which is probably the only Ultrix specific thing you'll
find.  There were rumors of some other Ultrix driver manual or paper,
but it wasn't general distribution or may have only been available to
source licencees, perhaps one of the DEC people could comment.  Finally,
the 4.3BSD Unix Operating System book by Leffler et. all. has a good
overview of the I/O system and driver requirements.

>                                                          I would also like
> to know if there are any differences as far device drivers are concerned
> between v1.2 and v2.3 of Ultrix. I would much rather be running v2.3 (actually
> I would much rather be running v4.2, but I can't seem to talk then prof into
> shelling out the $$).

Yes, there are differences.  Ultrix 1.0 was essentially BSD 4.2 and things
evolved from there.  BSD 4.2 drivers had some magic returns where putting
things in certain register variable would communicate them back to the
kernel.  Ultrix changed these to  globals by 2.X.  The interface to the kernel
memory allocator changed around 3.x.  Ultrix 4.X adds confusion to support
SMP, though this can apparently be avoided.

These things have never been cumulatively documented (perhaps in the new
turbo-driver manual?), sometimes they showed up in the release notes for
a particular release.

-- 
George Robbins - now working for,     uucp:   {uunet|pyramid|rutgers}!cbmvax!grr
but no way officially representing:   domain: grr at cbmvax.commodore.com
Commodore, Engineering Department     phone:  215-431-9349 (only by moonlite)



More information about the Comp.unix.ultrix mailing list