Revisions to LDD3 Examples

The book Linux Device Drivers, 3rd Edition (LDD3), by Jonathan Corbet et al., contains a series of example kernel modules. Those examples have become obsolete, to the point of no longer even compiling, due to the many changes made to the Linux kernel since that book was written. Some of those changes are mentioned in Corbet's blog on API Changes in the 2.6 kernel, but the authors of the book have not updated the examples.

The last time this course was taught, I updated the examples from the LDD3 book to allow them to compile with Linux kernel 2.6.25. Those versions are posted here.

My intent this term is to further update the LDD3 examples, to kernel version 2.26.31. This Web page is intended to document my progress. Note: The file versions referred to here (e.g. as "compiles") have not yet been posted on the Web, as I am still working on them.

It is presented using the W3C "slidy" CSS style. Use the 'a' key to toggle between single page and slide modes. Use the right and left arrow keys to advance and back up.

Open Issues

Many of the examples will compile, but are no longer considered to be in good style. The following are some major changes that need to be made.

Changes

Directory "scull"

FileStatus
access.c compiles
Check use of TASK_INTERRUPTIBLE.
main.c compiles
pipe.c compiles
scull.h compiles

Directory "scullc"

FileStatus
main.c compiles
mmap.c compiles
scullc.h compiles

Directory "sculld"

FileStatus
main.c compiles
mmap.c Problem with nopage
sculld.h compiles

Directory "scullp"

FileStatus
main.c compiles
mmap.c Problem with nopage
scullp.h compiles

Directory "scullv"

FileStatus
main.c compiles
mmap.c Problem with nopage
scullv.h compiles

Directories "include" and "lddbus"

FileStatus
lddbus.h compiles
lddbus.c compiles

These need expansion to provide a true virtual bus, that can be used as the parent bus of the other pseudo-device modules, which then in turn need to be updated to use this bus.

Directory "misc-modules"

FileStatus
complete.c
faulty.c
hello.c
hellop.c
jit.c
jiq.c
kdataalign.c
kdatasize.c
seq.c
silly.c
sleepy.c

Directory "misc-progs"

FileStatus
asynctest.c
datasize.c
dataalign.c
inp.c
load50.c
mapcmp.c
mapper.c
netifdebug.c
nbtest.c
outp.c
polltest.c
setconsole.c
setlevel.c

Directory "pci"

FileStatus
pci_skel.c compiles

Directory "sbull"

FileStatus
sbull.h compiles
sbull.c struct request has changed
elv_next_request has gone away
bio_cur_sectors has gone away
end_request has gone away
blk_queue_hardsect_size has gone away

Directory "short"

FileStatus
short.c compiles

Directory "shortprint"

FileStatus
shortprint.c compiles
shortprint.h compiles

Directory "simple"

FileStatus
simple.c Problem with nopage

Directory "skull"

FileStatus
skull_clean.c
skull_init.c

Directory "snull"

FileStatus
snull.c Problem with changes to struct net_device
Missing declarations of netif_rx_complte and netif_rx_schedule
snull.h compiles

Directory "tty"

FileStatus
tiny_serial.c A huge number of complation errors. Needs careful analysis.
tiny_tty.c struct tty_driver has changed

Directory "usb"

FileStatus
usb-skeleton.c Missing function info, line 296