PSU CS 572

PSU CS 572: UNIX Internals and Device Drivers

Administrative Stuff

Please see the syllabus.

Greg Kroah-Hartman gave a guest lecture to our class on Nov 12 Thursday.

See the lddsrc wiki for further information, including a git repo for the FSU source code and an email list.

Homework 1 was assigned and was due "the day of the mid term" (Nov 3).

Homework 2 (the final project) is due Friday of Finals Week (11 December) at 11:55 PM PDT.


  • Linux Kernel source cross reference

  • Linux Kernel & Device Driver Programming - A Florida State University course that looks to be of interest. Also note that the kernel used at Florida State was

  • Compiling the linux kernel on Ubuntu distro.

  • Compiling the linux kernel on Fedora distro.

  • How to use cscope on the Linux Kernel. (cscope -R ... is the easy way)

  • Changes in 2.6 Kernel API

  • "Introduction to Linux" by Machtelt Garrels (html,pdf) - A good book for newbs.

  • "Introduction to GCC" by Brian Gough, Other cool on-line books

  • New Kernel Hacking HOWTO - Some additional information on how to start hacking the kernel.

  • "Understanding the Linux Kernel" - If you want to understand how the Linux kernel works, you might consider purchasing this book and it can give you an overview on how the Linux kernel behaves. It is at the PSU bookstore as well, but don't spend the extra money. You might try Powell's Technical Books also.

  • Git tutorial - Since GIT is primarily what we're going to be using to send patches on Bart's project, you probably might be interested in a good GIT tutorial. GIT is a non-centralized revision control system as opposed to a central one like Subversion and CVS. What this means is that creating branches are cheap and frequently happen so that you can create many branches and then merge those branches later so you and someone else could be working on different branches and then merge each other's work to another branch to to each other. There is a video of Linus Torvalds doing a git tutorial which will be put up as soon as it becomes available.

  • Safari Books Online. The PSU library has a Safari Books Online subscription. To access, go to library, click on "Electronic Journals", click on "Safari Books Online", then login at the prompt and enjoy.

  • Teensy USB Device Notes and Resources (Homework 2).

Linux Device Driver 3rd Ed. Source Code

Thanks to Bart for putting those tarballs up.

Very Brief Git Tutorial

  1. Install git:

$ sudo apt-get install git-core

  1. Go to (or create) a directory you want to place your copy of the repository (in this case, a directory named 'ldd-examples' will be created there)

  2. Get a copy ("clone") of the repository:

$ git clone git://

  1. Enter the directory where the repo is (the one just created by git clone):

$ cd ldd-examples

  1. Go to misc-modules directory and edit hello.c in your favorite text editor. Take out the unnecessary #include or whatever you want to do with it, and save it. Now on the command line if you type:

$ git status

you will see that git recognizes that hello.c has been modified ('git status' is not required, but is helpful--I use it all the time), but that does not mean that it is ready to be committed. Above where is says 'modified: hello.c' it says 'Changed but not updated'.

  1. Add hello.c to the list of files to be committed:

$ git add hello.c

Now if you run git status again it still says 'modified: hello.c', but above it now says 'Changes to be committed'.

  1. Commit the change:

$ git commit -m 'commit message'

The -m allows you to attach a message to the commit which you provide in the quotes (I believe you can also use double-quotes). ALWAYS COMMIT WITH A MESSAGE. And not a lame one like 'fixed bug' or 'changed main.c'. Be specific.

  1. Create a patch to submit:

$ git format-patch -s HEAD^

The -s adds a sign-off message indicating to everyone who made the commit. Now there is a file in the directory you're in called something like '0001-comit-message.patch'.

  1. E-mail this file to