Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Aug 1995 18:34:09 +0100 (BST)
From:      Karl Strickland <karl@bagpuss.demon.co.uk>
To:        "Eric L. Hernes" <erich@lodgenet.com>
Cc:        terry@cs.weber.edu, doc@freebsd.org
Subject:   Re: device driver writers guide
Message-ID:  <199508051734.SAA01503@bagpuss.demon.co.uk>
In-Reply-To: <199508031523.KAA10229@jake.lodgenet.com> from "Eric L. Hernes" at Aug 3, 95 10:23:38 am

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> 
> >
> > I would be *very* interested in one of these existing.
> > 
> > One of the issues in BSD is lack of documentation for internal
> > system interfaces.  VM would be a good place to start, as would
> > vn_ for kernel level file I/O and bXXX, the block I/O interface.
> > 
> 
> Yea, but lack of documentation is a problem for all unixes.
> Sco, even though you can pay for a device driver class, and
> they have man pages for kernel support routines, still
> is about 80% of what I would have liked.  (that is still
> much better than FreeBSD, though)
> 
> I'm much more familiar with the drivers and entry points, and
> that type of stuff.  The details VM has always been a big 
> mystery for me.

i think there's two issues here:

	1. strict device driver documentation (entry points etc) - this
	   is what Eric is proposing to document.

	2. documentation for other kernel subsystems - this is what Terry
	   would like to see documented (probably in addition to #1?!)

For most commercial UNIX's, #1 is fairly well documented and the information
is available.  Several device-driver books also exist (eg Pajari, Egan, Kettle
etc), although these do tend to be SVR3 oriented.  As has been mentioned in
this thread, Egan does discuss VAX BSD drivers too.

#2 is a different kettle of fish.  The only commercial UNIX I've seen documented
to this level (eg filesystem IO within the kernel etc) was AIX.  The AIX docs
seemed reasonable (and certainly more complete than anything else i've seen),
but there were still many details ('gotchas' :) not documented.

IMHO, either #1 or #2 would be a very valuable addition to the FreeBSD
documentation.  Currently, I think #1 can largely be pieced together by 
device driver writers, from looking at existing drivers and reading scanning
the VAX-oriented BSD driver docs available (ie daemon book & Egan).
For #2, its more difficult.  We *really* need some kernel man pages for the
subsystem interfaces. I guess the problem is that the only people who are able 
to write such documentation are far too busy working on fixing and improving
the system itself.  (John Dyson has hinted at a FreeBSD kernel manual once
or twice!)  The MACH man pages might be a reasonable starting point for the 
VM system (?).  

There is another (possibly important) issue - that is once an interface is
documented, it has to be largely frozen, or at least some level of backward
compatibility has to be provided.  This may be a problem for a rapidly
developing OS such as FreeBSD.

Of course, at least we're lucky enough to have the source :)

> My outline is as follows:
> 
>   I. Linking a driver into the kernel
> 
>      A. Standard Device Driver
>      B. Loadable Kernel Modules (LKM's) 
> 
>  II. FreeBSD Entry Points
> 
>      A. Required Data Structures
>         1. isa_device
>         2. isa_driver
>         3. ...
> 
>      B. Required Entry Points
>         1. XXprobe()
>         2. XXattach()
>         3. XXopen()
>         4. XXclose()
> 
>      C. Optional Entry Points
>  
>         1. Device Switch Entry Points
> 
>           a. XXread()
>           b. XXwrite()
>           c. XXioctl()
>           d. XXdevtotty()
>           e. XXstart()
>           f. XXstop()
>           g. XXreset()
>           h. XXstrategy()
> 
>      D. Interrupt type Entry Points
> 
>         a. XXintr()
>         b. XXpoll()
> 
> III. Kernel Support Routines
       ^^^^^^^^^^^^^^^^^^^^^^^^ seems to 'overlap' with #2 depending on
				how far you take it :)

Eric, the outline looks very useful, I'd be really interested to read
whatever you write for this..

Cheers,
Karl

-- 
------------------------------------------+-----------------------------------
Mailed using ELM on FreeBSD               |                    Karl Strickland
PGP 2.3a Public Key Available.            | Internet: karl@bagpuss.demon.co.uk
                                          |



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