OS Internals - CS 572/Winter 2007 Jim Binkley/Karen Karavanic THIS IS ONLY A ROUGH DRAFT. Syllabus -------- Class time: M/W, 2-3:20 Classroom: SB2 104 Office(jrb): FAB 120-14, Karen is next door Email: Jim Binkley: jrb@cs.pdx.edu Karen Karavanic: karavan@cs.pdx.edu Office hours: Jim Binkley, Tu/Th 1-2 or by appointment. Feel free to make an appointment via email. Karen: announced later class home page: http://www.cs.pdx.edu/~jrb/ui.html mail list: mailman list - join via the following web page please: https://mailhost.cecs.pdx.edu/mailman/listinfo/osinternals Text/s: required: Linux Device Drivers. Corbet, Rubini, Kroah-Hartman. 3rd Edition. ISBN 0-596-00590-3. Feb. 2004. See http://www.oreilly.com for more information. Note: you must have the 3rd edition. Prerequisites ------------- Students must... - be familiar with the functions of a modern multiuser operating system (equivalent to what is learned in CS333 or CS 533), serious UNIX knowledge is a must too. - be GOOD if not excellent with C. - have the ability to send Internet e-mail to the address above. Class Overview -------------- The class this quarter intends to perform a pedagogical experiment. View this as a trip into the jungle with Jim Binkley (first half of class) and Karen Karavanic (second half) as your safari leaders. We are going to learn about linux device drivers courtesy of the ORA Linux kernel book. Our lectures will for the most part be based on the book and the code examples presented in the book. Jim will lead the class during the 1st half of the quarter (up to the midterm). Karen will take over after the midterm. As time permits, class material will include: intro to UNIX operating systems, kernel layout, an intro to device drivers, linux modules, various kinds of device drivers including character and network, tasking, time, and synchronization in an SMP environment, Linux kernel memory and hardware management, interrupts, and buses. We also hope that a couple of local Linux kernel gurus will be nice enough to come and give us a talk about topics related to the linux kernel during class. There will be at least two programming assignments done in small teams, both aimed at loadable module projects. Students will be expected to use the 2.6 kernel. There will be a few more details on the assignments below. IMPORTANT: please bring your book to class every session. We will often refer to it in class and look at various code examples and pictures. Calendar (will slip, if necessary) ----------------------------------- This is a very rough calendar and it may be wrong in terms of lecture material. The rough idea is that we will go through the book in order, barring 2 changes: 1. moving network drivers up just after character devices. 2. going over the kernel layout early in the class When What Assignments ---- ---- ----------- classes begin week of jan 8 Jan 8/10 intro/modules A1 out 2nd session Jan 17 char devices, network devices 15th is Martin Luther King day - university closed Jan 22/24 debugging Jan 29/31 catchup Feb 5/7 more char device, time Feb 12/14 midterm on the 12 A1 in at midterm, A2 out on the 14th Feb 19/21 memory and hw management Feb 26/28 interrupt handling Mar 5/7 block device drivers Mar 12/14 buses and catchup A2 in on Mar 14 Mar 19-24 final exam week final wed march 21, 12:30-14:20 Calendar: January February March Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 1 2 3 1 2 3 7 8 9 10 11 12 13 4 5 6 7 8 9 10 4 5 6 7 8 9 10 14 15 16 17 18 19 20 11 12 13 14 15 16 17 11 12 13 14 15 16 17 21 22 23 24 25 26 27 18 19 20 21 22 23 24 18 19 20 21 22 23 24 28 29 30 31 25 26 27 28 25 26 27 28 29 30 31 Programming Assignment ---------------------- Students will be divided up into teams of 2-3 people and assigned a Linux box at PSU to work on (in the netlab but some may at home for that matter if you have linux on your desktop or laptop). The two assignments will be to develop loadable kernel modules. 1. a1, write a character device driver that writes a structure into the kernel and then reads it out. statistics should be available for i/o for this device from a /proc device structure. 2. a2, TBD if Karen has a better idea. In the meantime assume: Intel CPU timing mechanisms exist which are called cycle counting registers. See: http://web.cecs.pdx.edu/~jrb/ui/linux/msr.c for an application-side example. The instructors would be interested in developing a measurement project that measures how efficient the "packet socket" queue is in the Linux kernel. We would like to see how much time it takes for a packet to move from the kernel NIC driver into application memory. Typically the packet socket is used with applications like tcpdump which actually uses the libpcap library available at www.tcpdump.org to do the read. We know that the linux mechanism is much less efficient than the FreeBSD mechanism in this regard. It would be good to see if we could figure out exactly why it is less efficient. It is possible that you may negotiate some other project with the instructors especially for a2 or for a1 for that matter. Good ideas will be entertained. Grading ------- Midterm 100 Final 100 In class contributions 50 Programming Assignment/s 100 Regarding "In class contributions": The class will be considered a seminar. Students are expected to not be passive, to ask questions, and to help the instructor get things straight as we go along. Yes, the instructor will lead us on our pilgrimage into the wonders of the Linux kernel. Still, students will be expected to contribute. Showing up late, not at all, not bringing the text/s, never asking a single question, will not be regarded favorably. Your final grade for the course is determined by determining the weighted percentage of the points you earn with respect to the total possible. Each letter grade occupies roughly a 10 point spread (A: 90%-100%, B: 80%-89%, etc). Initial Assignment ------------------- 1. Use the World Wide Web and take a look at the instructor's home page and the home page (under construction) for the class; i.e., http://www.cs.pdx.edu/~jrb/ui.html 2. subscribe to the class email mailing list. We will have details about that at the first class. If you drop out, please unsubscribe.