A NetBSD kernel documentation overview
This is work in progress and should change whenever the NetBSD kernel changes
significantly.
Input is welcome to
anders@dinsen.net!
Update 2002-10-28: I don't have the time, nor the inclination to maintain
this page actively any more. So if you think you can give this page a better
home, please let me know.
Although the kernel is treated as a monolithic component in NetBSD,
it is not the result of a single software design project. Its origins date
back to the earliest versions of UNIX that eventually was completely
rewritten into the 4.4BSD-Lite operating system released by the CSRG at UCB
in 1994. See also
The
story of NetBSD in Federico Lupi's guide to NetBSD.
The design of 4.4BSD is well documented in The
Design and Implementation of the 4.4 BSD Operating System.
That's probably the best place to start if you want to obtain an
understanding of the structure and design of the NetBSD kernel (and the
kernels of the other BSD's).
That said, NetBSD has evolved a lot since 4.4BSD was released. I would
estimate that at least one third of the book does not apply to NetBSD (1.5).
There is no single book that documents these changes, but many of them are well described in various papers and documents. This page is a collection of this documentation with notes on the relevance of each document to NetBSD.
- Portable device driver framework
-
NetBSD has a framework for writing portable device drivers.
See bus_space(9) and bus_dma(9).
- Auto configuration framework
-
There are important changes in the autoconfiguration framework (it started
out as "the new way" described in the book, but then diverted). I.E.:
interrupts are not allowed while probing and attaching devices (while the book
says drivers will generate an interrupt and see at what vector it comes in).
- UVM - the new virtual memory handler
-
UVM has replaced the old BSD/Mach VM. UVM is very well documented in
Chuck Cranors dissertation and USENIX 99 paper. There is also very fine
reference documents in the uvm(9) man page.
- IPv6 and IPsec: KAME
-
The IPv6 implementation from the
KAME project has been integrated
since 1.5.
The amount of design documentation is close to nothing, unfortunately.
- PPP implementation
-
Paul Mackerras' PPP implementation was integrated in NetBSD 1.2.
There does'nt seem to be much documentation available for it. The
README from
the distribution site
contains some information on the basic structure.
- IP filter - the IP firewall package
-
Darren Reeds IP
Filter was integrated in 1.2 too. There is a great deal of user documentation
(configuration and programmers interfaces) in the man pages (start with
ipf(8)),
but there is no documentation on the internals of the package.
- RAIDframe - software RAID support (level 0-5+)
-
RAIDframe from CMU was integrated in 1.4 by Greg Oster ( oster@cs.usask.ca).
CMU has lots of papers on RAID technology and some on RAIDframe too.
Greg Oster maintains a NetBSD and RAIDframe with notes on the implementation,
FAQ, a list of recent changes. He has a page with the history of his
porting project there too.
- Soft-updates - a technique for faster, safer FFS (BSD filesystem)
-
Mc. Kusicks soft-updates has been added to
FFS.
He presented it in a paper on USENIX99:
Soft Updates: A Technique for Eliminating Most Synchronous Writes in the Fast Filesystem (the paper is
available on that page in PDF as well as PostScript).
Margo Seltzer et al presented another paper on USENIX2000: Journaling Versus Soft Updates: Asynchronous Meta-data Protection in File
Systems (requires USENIX membership to access the actual paper). This is a comparison of soft updates versus logging.
A comparison of softdep vs. non-softdep directory operations is described
in this
message on the tech-kern mailing list.
The benchmark itself is in this
message.
- Compatibility modes
-
Compatibility modes (e.g. Linux).
- UBC - the Unified Buffer Cache
-
The unified buffer cache was integrated in NetBSD-current in November 2000.
Chuck Silvers presented this paper at USENIX 2000.
There's a NetBSD kernel FAQ entry on UBC.
- Kernel threads
-
There are kernel threads (simple form: linux emulation clone() call, advanced
form: the APM, NFS and USB kernel threads).
A future release of NetBSD will feature an advanced two level thread implementation. The design of
this is described in a paper by
Nathan J. Williams
for presentation at USENIX 2002:
An Implementation of Scheduler Activations on the NetBSD Operating System.
It is available in the nathanw_sa branch.
- Platform support
-
NetBSD has been ported to many architectures that 4.4BSD wasn't.
Other resources
NetBSD official kernel documentation overview (including FAQ).
Credits
The following people have pointed out features of the NetBSD kernel and
resources describing them: