![]() |
|
Spring 2000, TuTh 1:35-2:25
Chemical Engineering (Bunger-Henry
Building) 360
Instructor
Phillip W. Hutto pwh@cc.gatech.edu
119 College of Computing Building (I'm never there...)
(home) 404.892.7444 (emory) 404.727.0520
Office Hours: Tu, Th 2:30-3:30 pm and by appointment (in the
College Commons)
Teaching Assistant
Jason Lunz j@cc.gatech.edu
Office Hours: MW 1-2 pm Th 11-12 am and by appointment (in the College
Commons)
Web: http://www.cc.gatech.edu/classes/AY2000/cs3210_spring
News: news://news.cc.gatech.edu/git.cc.class.cs3210
Course Objectives
This is a second course in operating systems with a focus on the design and construction of a modern OS kernel. We will review in depth, fundamental operating system concepts such as booting, system calls, process and thread abstractions, scheduling, synchronization, interprocess communication, memory management (allocation, paging, mapping), file systems, device drivers, and network management. Our aim is to move beyond a simple conceptual familiarity with OS components to a deeper understanding of how such components are realized in a production-quality operating system.
This will be a project-oriented course. We will use the Linux kernel as our classroom. Students will work in teams. Each team will be issued an experimental single-board computer (Skiff boards) developed at the Compaq Research Laboratory (CRL) in Cambridge, Massachusetts as part of the Compaq Personal Server project.
Students should leave the course with:
Prerequisites
CS 2200 or CS 3341 (quarter system) are prerequisites to this class. Students are assumed to have a basic understanding and familiarity with fundamental OS concepts such as processes, synchronization, threads, scheduling, memory management, file systems, etc. If you do not have this background you shouldn't be in this class!
Texts
There are two required texts for the course. We will read these texts closely.
Linux Kernel Internals 2e
Beck, Bohme, Dziadzka, Kunitz, Magnus, Verworner
Addison-Wesley 1998 480 pages
ISBN 0-201-33143-8 ($41.95 at Amazon)
Linux Device Drivers
Rubini
O'Reilly 1998 421 pages
ISBN 1-56592-292-1 ($23.96 at Amazon)
If these are not available at local bookstores you should make an effort to order them through Amazon.com or Fatbrain.com as soon as possible.
FLASH! I spoke to customer service at www.fatbrain.com today (Wednesday 12 January) and they say they have 32 copies of the Beck book on hand. You can get these at a special 10% discount and get free expedited shipping by entering the special discount code gatechdisc899. Be sure to specify expedited shipping in the order form!
I've listed the following text as recommended. This is the latest version of the standard Silberschatz and Galvin OS textbook used in 2200 and 3341. The new version has a third author, is printed by a different publisher and contains examples in Java. Otherwise it is very similar to Silberschatz/Galvin 5e. You may wish to periodically consult this text to review fundamental concepts if you find yourself lost in details in the Linux kernel.
Applied Operating System Concepts 1e
Silberschatz, Galvin, Gagne
Wiley 2000 840 pages
ISBN 0-471-36508-4 ($80.95 at Amazon)
A very good annotated Linux kernel commentary has recently been published. It is very good but selective in its coverage. You might find this text useful.
Linux Core Kernel Commentary
Maxwell
Coriolis Press 1999 575 pages
ISBN 1-57610-469-9 ($31.99 at Amazon)
- Here is a large text file (~1.2 meg) containing the numbered source listing referred to in the Maxwell text.
- Check out Scott Maxwell's Linux Core Kernel Commentary webpage.
- Errata
- Sample chapter (online) Chapter 5: System Calls
Grading
Exams will be worth 15% each for a total of 30% of your final course grade. There will be no homeworks. 70% of your course grade will be based on programs and projects. Students will form teams of three and remain in the same team for the entire semester. Teams will be given group grades but the staff reserves the right to adjust individual grades in special cases. There will be six programming assignments. In addition, each team will be assigned a major topic and produce a descriptive topic web and give a short presentation. These topic webs will be collected to form the Georgia Tech Linux Kernel Guide.
Exams
There will be two exams: a midterm and a final. Exams will test your ability to articulate your understanding. Exams will emphasize higher level concepts and principles and will serve to balance the detail-oriented project work. The format of the exam and review materials will be announced at a later date.
midterm: Thursday 24 February 1:35-2:25 pm Chem Eng 360
final: Tuesday 2 May 8-10:50 am location TBA
Mug shots of the course staff and students. Need someone's email address? Check out the public class roll that I've prepared by removing all the sensitive information.
Syllabus
| # | mon | day | date | topic | readings | notes | out | in |
| 1 | JAN | Tu | 11 | Beck chs 1-2 | ||||
| 2 | Th | 13 | Skiff development process; kernel overview/architecture | Rubini chs 1 Maxwell chs 1, 3 |
Lecture1 | Maxwell chs 2, 4 | ||
| 3 | Tu | 18 | printk.c P1 overview |
Maxwell ch 2 |
Lecture2 | P1 Skiff boards |
Team signups | |
| 4 | Th | 20 | Booting, kernel init | Maxwell ch 4 Beck 3.2.3, App D Rubini ch 16 |
Lecture3 | Maxwell ch 5 | ||
| 5 | Tu | 25 | System calls | Maxwell ch 5 Beck ch 3.3 Beck App A (scan) |
P1 | |||
| 6 | Th | 27 | System calls | |||||
| 7 | FEB | Tu | 1 | Signal Handling | Maxwell ch 6 | P2 | ||
| 8 | Th | 3 | Interrupts | Maxwell ch 6 | ||||
| 9 | Tu | 8 | Char Drivers | Rubini chs 2,3,5 Beck ch 7 |
P3 | P2 | ||
| 10 | Th | 10 | Char Drivers | WROX ch 21 Cox Porting |
Maxwell ch 7 | |||
| 11 | Tu | 15 | Processes, Threads, Scheduling | Maxwell ch 7 Beck ch 3.1, 3.2 |
Lecture10 | |||
| 12 | Th | 17 | Processes, Threads, Scheduling | |||||
| 13 | Tu | 22 | GUEST: Jamey Hicks | P3 | ||||
| 14 | Th | 24 | MIDTERM | |||||
| 15 | Tu | 29 | Modules, Debugging | Beck ch 9 Rubini ch 2, 4, 11 kmod.txt |
||||
| 16 | MAR | Th | 2 | Bech ch 9 Rubini ch 2, 4, 11 kmod.txt |
Maxwell ch 8 | |||
| Tu | 7 | SPRING BREAK | ||||||
| Th | 9 | SPRING BREAK | ||||||
| 17 | Tu | 14 | no class | |||||
| 18 | Th | 16 | Memory | Maxwell ch 8 Beck ch 4 |
LKG ch 3 | |||
| 19 | Tu | 21 | Memory | Maxwell ch 8 Beck ch 4 |
P4 Maxwell ch 9 |
|||
| 20 | Th | 23 | IPC | Maxwell ch 9 Beck ch 5 |
||||
| 21 | Tu | 28 | Maxwell ch 9 Beck ch 5 |
Topic Web: Booting |
||||
| 22 | Th | 30 | Block Drivers | Rubini chs 12, 14 | P4 Topic Web: System Calls |
|||
| 23 | APR | Tu | 4 | Rubini chs 12, 14 | Topic Web: Signals |
|||
| 24 | Th | 6 | GUEST: Jason Lunz Files |
Beck ch 6 LKG ch 9 |
Topic Web: Char Drivers |
|||
| 25 | Tu | 11 | Beck ch 6 | Topic Web: Processes |
||||
| 26 | Th | 13 | Networking | Beck ch 8 LKG ch 10 |
Topic Web: Modules |
|||
| 27 | Tu | 18 | Beck ch 8 | Maxwell ch 10 | Topic Web: Memory |
|||
| 28 | Th | 20 | SMP | Maxwell ch 10 Beck ch 10 |
Topic Web: IPC |
|||
| 29 | Tu | 25 | Maxwell ch 10 Beck ch 10 |
P5 | Topic Web: File Systems |
|||
| 30 | Th | 27 | GUEST Lecture by Tux | Topic Web: Networking | ||||
| MAY | Tu | 2 | Final Exam 8-10:50 am Topic Web Final Submission |
|||||
| Wed | 3 | P5 DUE: noon |
Students will work on all programming assignments and on the topic web project in teams of three. You must identify your teammates by class on Tuesday 18 January or you will be randomly assigned to a team. You are encouraged to come up with an interesting team name and develop a sense of group responsibility. The whole point of working together in groups is to help each other learn! If some team member is not keeping up, assistance and cajoling are in order! If some team member is not playing fair, let Phil or Jason know and we will have a "motivational" discussion with that individual :-)
You are encouraged to schedule weekly team meetings. Jason and Phil will be sitting in on a few of these team meetings throughout the semester to help out and to evaluate group dynamics.
Skiff Boards
Each team will be assigned a Skiff board in class on Tuesday 18 January for the duration of the semester. Team members will need to sign a statement of responsibility. Students will be liable for damage to the boards which are worth about $500 each. We have a few extra boards so auditing students may form a team and sign-out a board as well.
So what's a Skiff?
skiff \'skif\ n [MF or OIt; MF esquif, fr. OIt schifo, of Gmc origin; akin
to OE Xscip ship 1: a small light sailing ship 2: a light rowboat 3: a boat with centerboard and spritsail light enough to be rowed 4: a small fast powerboatJamey Hicks at CRL says:
"Skiff was named by Frank Bomba, who is head of the advanced development
group. Frank has named a whole line of projects after kinds of boats. This one is a small boat. He came up with a pseudo-acronym: simple configurable internet facility.-Jamey
Skiff Linux Source Code
We will be using a modified version of the Debian kernel source targeted for the Intel StrongARM SA-110 processor in our Skiff boards. As of now the official kernel version to be used by everyone in the class is 2.2.12-rmk1-crl3. We may update this from time to time as we receive new versions from our friends at Compaq's Cambridge Research Lab. (Curious about all those dashes and numbers in the kernel version? The latest stable Linux kernel release is 2.2. Odd-numbered kernels are unstable "development" kernels. Linus has announced a "feature freeze" and version 2.4 should be coming out in the next couple of months. We are working with minor release .12. The very latest version is reported at www.kernel.org and is currently .14. The "rmk1" part of the release are the initials of Russell M. King, the primary coordinator of the ARM Linux Project. "crl3" tracks Skiff-specific patches applied by the Cambridge Research Lab.)
The entire source tree is available through the link below as a compressed "tarball" of about 13 meg.
Compressed tarballs usually have the file extension .tgz. Such files are first created by "archiving" the entire directory hierarchy into a single file using tar (tape archive). Then the resulting file is compressed using the GNU zip compression tool (gzip). To get a listing or a "manifest" of the files in a tarball (say foo.tgz) on most systems you can type:
tar ztf foo.tgz
To extract the files, type:
tar zxf foo.tgz
Most tarballs are created with relative pathnames so you can extract them into any location and reconstitute the original source tree rooted at the current directory. It's a good idea to always check and make sure a tarball doesn't include absolute pathnames or you may overwrite important existing files.
I've created a rudimentary browsable manifest of the entire kernel source tree. You might enjoy poking around. (Note that directories are dead links in the current version but all actual file links are valid.)
Here is a fancy hyperlinked version of the standard 2.2.12 kernel generated using a tool called the Linux Source Driver.
Here is yet another hyperlinked 2.2.12 kernel using a tool called lxr from the Linux Cross-Reference Project.
Cross Compiler
You will need to use a cross-compiler to compile the Linux kernel and any application programs you might be interested in running on your Skiff board. A cross-compiler is simply a compiler that generates machine code for some architecture other than the architecture it is running on. We will use a special version of the GNU c compiler (gcc) that runs under Linux on Intel Pentium architecture but generates executable code for the StrongARM processor on the Skiff boards. Building a GNU cross-compiler is a complicated task (See the FAQ for details.) Fortunately, our friends at Compaq have built one for us and we have a large tarball that installs all the necessary files and binary executables required to run the cross-compiler on Intel-based Linux.
The tarball is large (~27meg) and unpacks to around 100meg. To install, download the following tarball:
and move it into the root directory (/) on your Linux system. Issue the following command as root:
tar zxvf arm-linux-cross-compiler.tgz
This will create a directory /usr/local/arm-unknown-linux containing about 100 meg of files and it will place some executables in /usr/local/bin as well. (Make sure you have enough space! I filled up my root partition the first time I tried this.) That's it. You should now have a functioning cross-compiler that should work properly for compiling the kernel.
The cross compiler is available on all the Linux machines in the Intel lab as:
/usr/local/bin/arm-unknown-linuxelf-gcc
Skiff Lab
We have reserved a table (hereafter "the Skiff Lab") in the very back corner of the Intel lab where you can download and test your kernels (though we strongly encourage you to consider setting up a development environment on your personal Linux machines). The Skiff Lab includes a 10 port Ethernet hub on an isolated Skiff development subnet used by Professor Ramachandran and his students. Each board will be given a static ip address and you must plug your board into the corresponding hub port. A power strip is provided to power your boards. Serial cables are connected to the COM1 port on 6 designated machines. You must run a terminal emulation program (minicom) on these machines to serve as the "console" for your Skiff board. It is also possible to interact with your Skiff board using Hyperterminal running under Windows NT. Through the console you can interact with the bootloader and login to your Linux system if it installs and comes up properly. We will provide additional details on this process in coming days. CS 3210 students will have "priority" on the designated machines and you may politely ask anyone using your machine to move to another available machine.
Bootloader
We have installed a current version of the bootloader (built on 7 January 2000) on all the Skiff boards that will be handed out to the class. You shouldn't need to do this but it is possible to install a new bootloader on any Skiff board with a functioning bootloader. (If you damage the bootloader, the boards must be sent back to Cambridge to have a bootloader reinstalled using a low-level hardware-based mechanism called the JTAG interface.) The bootloader includes an implementation of the XMODEM serial transfer protocol and you can easily download a new bootloader using the Send File capability in Hyperterminal. (Unfortunately, the bootloader does not properly understand the XMODEM protocol implemented in minicom so you can only do this on a Windows machine at present.)
To download a bootloader, copy the following binary file (49152 bytes) to a Windows machine:
Connect a serial cable to your Skiff board, reboot and press the SPACE BAR to interrupt the boot process and bring up the bootloader prompt. You should see something like this:
>> Compaq Personal Server BootLoader, Rev 2.00(a.out)
>> (Edwin Foo,Jamey Hicks,Dave Panariti,Mike Schexnaydre,Chris Joerg), 00-01-07_15:36
>> SA110 Rev=4401A104
>> (c) 1999 Compaq Cambridge Research Laboratory
Press Return to start the OS now, any other key for monitor menu
eval param blk
+ set dram_size 00000000
setting param=dram_size to value=00000000
+ set system_rev 00000002
setting param=system_rev to value=00000002
Cannot change the system_rev!
+ set hostname skiff18
setting param=hostname to value=skiff18
+ set ipaddr 192.168.0.3
setting param=ipaddr to value=192.168.0.3
+ set gateway 192.168.0.1
setting param=gateway to value=192.168.0.1
+ set netmask 255.255.255.0
setting param=netmask to value=255.255.255.0
+ set nfs_server_address 192.168.0.2
setting param=nfs_server_address to value=192.168.0.2
type "?" or "help" for help.
boot>
At the boot prompt, simply type:
load bootldr
and then quickly select Transfer >Send File from the Hyperterminal menu. Select the XMODEM protocol and enter the file name and begin the transfer. When the transfer completes, reboot the Skiff board and you should be running with the new bootloader.
Good (Recovery) Kernel!
We will maintain a working kernel image in the following file:
You can always reload this good kernel if you damage the kernel in your Skiff board and are unable to compile a new working kernel.
For the topic web project, each team will compose a substantial web of tutorial material describing one of the major topics we have studied this semester. Your web should include but is not limited to a detail outline of the material presented in class. Your audience is next semester's 3210 students! Please try to convey to them everything that they need to know about each topic. You may draw on the many resources that are available to you including textbooks, handouts, magazine articles, man pages, guides, HOWTOs, etc. Your web should do more than just outline the material we have covered. In addition, you should select one or two concepts and elaborate on these beyond what was covered in class or in the reading. For example, you might look at the 2.4 development kernel and discuss some of the new additions. Or you might include a description of some ARM or SKIFF specific modifications. Example programs, code and diagrams are all valuable. The Linux Kernel Guide is a pretty good starting point. I will put all the topic webs that are submitted together to form the Georgia Tech Linux Kernel Guide. Students in subsequent semesters will be given your web pages as a starting point and they will be asked to refine and update them. So try hard to get things off to a good start!
Online Linux Resources
Odds and Ends