[comp.unix.wizards] man section for kernel functions?

mangler@cit-vax.Caltech.Edu (Don Speck) (01/15/88)

There are manual page sections for almost everything... why are
there none for kernel functions such as sleep, wakeup, physio,
splx, ubasetup, getblk, getc, timeout and all the others that
are called from drivers?  It would make it a lot easier to
write drivers...

Don Speck   speck@vlsi.caltech.edu  {amdahl,ames!elroy}!cit-vax!speck

cabo@tub.UUCP (Carsten Bormann) (01/19/88)

In article <5174@cit-vax.Caltech.Edu> mangler@cit-vax.Caltech.Edu (Don Speck) writes:
() There are manual page sections for almost everything... why are
() there none for kernel functions such as sleep, wakeup, physio,
() splx, ubasetup, getblk, getc, timeout and all the others that
() are called from drivers?  It would make it a lot easier to
() write drivers...

Because people who still need a manual entry for sleep() and wakeup()
are not supposed to muck around with the kernel     :-)

Seriously, I think that it's about time to make the interface from a
driver to the kernel a first-class citizen among the other documented
interfaces (system-call interface, command interface, file formats, etc.).

I think nobody has done it yet because:

1) In the early times you had the kernel sources (and there was the Lions
   commentary in a box on the wall behind glass with a hammer beside it).
2) Then we had the times when everybody was paranoid not to leak out
   details of the UNIX system to the general public (ranging from
   Whitesmiths putfmt() replacement for printf() to avoid infringing
   copyrights to the sorry state of the internals documentation you at
   least get at all with systems like Xenix).
3) Now we are in the ``post-Bach era'', i.e. a good high-level description
   of the kernel workings is readily available (for System V derivatives
   at least).  While Bach published this book with permission from AT&T,
   other authors still are in a too intimidated state to write similar
   lower-level books about driver hacking.

As BSD has always been the leading* UNIX variant available to the
masses, maybe someone should write a new manual section about kernel
functions in 4.4BSD?  Then I might have a chance to finally understand
ubarelse() and interface driver hacking.  And some day, System V
release 47.11 will pick up the idea.
_____
* from a research point of view, of course.
-- 
Carsten Bormann, <cabo@tub.UUCP> <cabo@db0tui6.BITNET> <cabo@tub.BITNET>
Communications and Operating Systems Research Group
Technical University of Berlin (West, of course...)
Path: ...!pyramid!tub!cabo from the world, ...!unido!tub!cabo from Europe only.

alex@umbc3.UMD.EDU (Alex S. Crain) (01/23/88)

In article <335@tub.UUCP> cabo@tub.UUCP (Carsten Bormann) writes:
>In article <5174@cit-vax.Caltech.Edu> mangler@cit-vax.Caltech.Edu (Don Speck) writes:
>() There are manual page sections for almost everything... why are
>() there none for kernel functions such as sleep, wakeup, physio,
>() splx, ubasetup, getblk, getc, timeout and all the others that
>() are called from drivers?  It would make it a lot easier to
>() write drivers...
>
>Because people who still need a manual entry for sleep() and wakeup()
>are not supposed to muck around with the kernel     :-)
>
	Actually, I think that there is a bit more truth to this than 
originally intended. There was (of course) no kernal docs included with
my machine (AT&T 3b1), but all I had to do was call AT&T and they sent me
a very nice ~50 page document on writing device drivers and all that nifty
kernal stuff. The fact that I recieved photostat copies and not a printed
document suggests that they don't get much call for it, and I sure wouldn't
want my support team explaining to someone why his machine is crashing after
he started mucking about with the kernal.

	And the Post-Bach era really is here, The other day I saw a unix book
that discussed device driver writing and low-level kernal guts. Unfortunately
I can't recall the name or author, only that it exists.

-- 
					:alex.

alex@umbc3.umd.edu

glenn@otto.COM (Glenn Scott) (01/27/88)

  Several years ago (many years ago ?), right after being unleashed on a
V6 PDP11, I wrote my own documentation for the Version 6 kernel.  I wrote
manual pages for nearly every function in the kernel in order to learn fast.
I say nearly because I got a copy of the Lions book which helped me enough
to remove the motivation for finishing.

  Later, I did write a complete set of manual pages for 4.1bsd.  I probably
still have them on one of the tapes somewhere under my bed.  Given suitable
encouragement I could probably find them.

  Although I understand the attraction for being able to hop around in the
kernel with a manual in your hands, I really recommend writing your own
manual pages, or documentation (I'm sure some will disagree with me).
It's a good way to systematically study the kernel very hard.  Something you
must do to be able to make intelligent assessments, additions and changes.

Glenn
----
Glenn Scott  Las Vegas Sun  Las Vegas, Nevada (702) 435-4651
{hoptoad,utah-gr,mirror,ihnp4}!otto!glenn

lm@arizona.edu (Larry McVoy) (01/30/88)

To those who want this sort of info I'd suggest the following:

The Unix I/O subsystem by DMR (standard doc)
AT&T Unix driver design guide for the 3b5 and 3b20 (or any variation thereof)
Unix driver source code

-- 
Larry McVoy	lm@arizona.edu or ...!{uwvax,sun}!arizona.edu!lm
		Use the force - read the source.