OS Internals - CS 572/Winter 1996 Jim Binkley Syllabus -------- Class time: 6:00 - 8:30 pm, Wed. Classroom: OCATE TBD Office: PCAT 128D Email: jrb@cs.pdx.edu. Class-related email very welcome Phone: send email Office hours: tu/th 9-10: or by appointment. Feel free to make an appointment. home page: http://www.cs.pdx.edu/~jrb/ui.html mail list: cs572@cs.pdx.edu Text: The Design of the UNIX Operating System, by Maurice J. Bach Optional: Advanced Programming in the UNIX Environment, by W. Richard Stevens. Addison-Wesley. 1992. ISBN 0-201-56317-7. Excerpts from: a few papers (<=3) to be made available possibly through a copy center "nearby". Prerequisites ------------- Students must... - be familiar with the functions of a modern multiuser operating system (equivalent to what is learned in CS303), - be familiar with C. - have the ability to send Internet e-mail to the address above. Goals ----- To provide an overview of the data structures and algorithms used in the implementation of a particular operating system (UNIX) and of design decisions made by the operating system implementors. Information on overall kernel functionality, device drivers, file management, process management, virtual memory operation, and a brief networking overview will be provided. Calendar (will slip, if necessary) ----------------------------------- When What Assignments ---- ---- ----------- Jan. 10 (weds) Intro, Chapter 1 Chapter 2 Jan. 17 Chapter 10, sect 1-2 (drivers) Chapter 10, 3-4 A1 out Jan. 24 slippage Chapter 3 (buffer cache) Jan. 31 Chapter 4 (file system) Chapter 4 Feb. 7 Chapter 5 A1 in, A2 out Chapter 5, (+ BSD File system) Feb. 14 Chapter 6 (processes) mid-term Feb. 21 Chapter 6 Chapter 7 (processes) A2 in, A3 out Feb. 28 Chapter 7 Berkeley IPC (sockets) March 6 Berkeley IPC (networking), 11.2 Chapter 8 (sched/clock) March 13 Chapter 9 (v.m./paging) A3 in slippage March 20 final Assignments ----------- The programming assignments are an important part of the course. One goal is to make sure that you understand UNIX at the system call level, since that is the key architectural area and probably of the most practical use. We assume you know C. The programmers who program Unix kernel code and applications have a fair knowledge (understatement) of C. This is not the course to try and pick C up in. 4 assignments are offered and you are expected to do 3 of them. Two assignments focus on implementing a simple shell. One focuses on implementing a client/server prototype using the TCP protocol and Berkeley sockets. One *optional* assignment involves implementing a software-only BSD device-driver in the FREEBSD operating system. Again: you must do 3 out of the 4 assigments briefly discussed below. The first three can be done off-campus. The last one will require an account on a special PC/BSD unix box administered by me (in my office) and it will be shared amongst the students who wish to do that assignment. A1: implement a simple UNIX shell with a focus on file system primitives; i.e., several "intrinsic" commands including copy/move/remove will be implemented in the shell. A2: extend the UNIX shell in A1 by adding process management control including execution of processes, an arbitrary number of pipes, and a pwd command implemented from scratch. A3: implement a protocol TCP server and several clients where the clients send the server commands over TCP sockets, and the server carries them out. The server will be able to simultaneously accept connections and "i/o" requests somewhat like an X-11 server. A4: implement a "simple" logging driver under FREEBSD. You will have to obtain an account, copy a kernel, study how drivers are built, and then implement a "pseudo" driver that takes i/o requests written to the driver device, puts them in a circular queue, and allows another process to read the requests out. The programming assignments must be turned in *both* in class on paper and via email. This means source, not binary code. None of the assignments may be done in groups, but must be accomplished on your own. Source code for assignments must be shar'ed (program provided if needed) and e-mailed to me with a postmark no later than the due date. Each assignment turned in must include: - source code and Makefile - output of test runs captured with the BSD script(1) utility. - a test plan (except for the last assignment) The source code must be well commented. Each file should have a header comment that explains what the file is for and what functions reside in the file. It should also include the system and o.s. version that the assignment was programmed on. Each function should have a function header that explains briefly what the function does and discusses function inputs and outputs. Comments should be meaningful. Code must pass lint. C style should approximate the style given in Kernighan and Ritchie. The BSD indent utility may be used. The S5 cb utility may also be used, where indent is not available. There is definitely such a thing as a UNIX/C programming style. More in class when the first assignment is handed out. Readibility will be a significant factor in grading. Late assignments will be accepted up to the START of the next class period with one letter grade deducted. The first three assignments should be implementable on any UNIX system. The last assignment will require a UNIX system that has Berkeley sockets (It could be done on Windows NT using threads and winsock -- possible, but I haven't tried it). You can do your assignments either at PSU or on a home computer. As a courtesy to the instructor it would be good to get an account on a BSD machine, or Sun/Sequent at PSU to make sure your programs are portable. Points may be deducted for non-portability. Grading ------- Yes, there is some. Programming Assignment #1: 100 points Programming Assignment #2: 100 points Programming Assignment #3: 100 points Midterm: 100 points Final: 100 points Assignments will be weighted at 60 percent. The two tests will make up the other 40 percent of the grade. 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 ------------------- It is hard to say what "distance learning" means but we are attempting to do something like that since students in this course are from both industry and different schools in the Portland area. 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 http://www.cs.pdx.edu/~jrb/ui.html 2. subscribe to the class majordomo email mailing list. To subscribe send the following message via SMTP/Internet email: To: majordomo@cs.pdx.edu Subject: -------- subscribe cs572 You should get back a success message. After that you can send email to the list by just sending it To: cs572@cs.pdx.edu You can get a list of commands by sending email to majordomo and putting "help" in the box; e.g., To: majordomo@cs.pdx.edu Subject: -------- help If you drop out, please unsubscribe. Send email as above to majordomo and make the body "unsubscribe" (without quotes) 3. send email to the instructor and tell me what your background is, what you are hoping to learn. Please be sure and sign your letter with your full email address; e.g., Jim Binkley email: jrb@cs.pdx.edu