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.
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.
| File | Status |
|---|---|
| access.c |
compiles Check use of TASK_INTERRUPTIBLE. |
| main.c | compiles |
| pipe.c | compiles |
| scull.h | compiles |
| File | Status |
|---|---|
| main.c | compiles |
| mmap.c | compiles |
| scullc.h | compiles |
| File | Status |
|---|---|
| main.c | compiles |
| mmap.c | Problem with nopage |
| sculld.h | compiles |
| File | Status |
|---|---|
| main.c | compiles |
| mmap.c | Problem with nopage |
| scullp.h | compiles |
| File | Status |
|---|---|
| main.c | compiles |
| mmap.c | Problem with nopage |
| scullv.h | compiles |
| File | Status |
|---|---|
| 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.
| File | Status |
|---|---|
| complete.c | |
| faulty.c | |
| hello.c | |
| hellop.c | |
| jit.c | |
| jiq.c | |
| kdataalign.c | |
| kdatasize.c | |
| seq.c | |
| silly.c | |
| sleepy.c |
| File | Status |
|---|---|
| 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 |
| File | Status |
|---|---|
| pci_skel.c | compiles |
| File | Status |
|---|---|
| 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 |
| File | Status |
|---|---|
| short.c | compiles |
| File | Status |
|---|---|
| shortprint.c | compiles |
| shortprint.h | compiles |
| File | Status |
|---|---|
| simple.c | Problem with nopage |
| File | Status |
|---|---|
| skull_clean.c | |
| skull_init.c |
| File | Status |
|---|---|
| snull.c |
Problem with changes to struct net_device Missing declarations of netif_rx_complte and netif_rx_schedule |
| snull.h | compiles |
| File | Status |
|---|---|
| tiny_serial.c | A huge number of complation errors. Needs careful analysis. |
| tiny_tty.c | struct tty_driver has changed |
| File | Status |
|---|---|
| usb-skeleton.c | Missing function info, line 296 |