Description of Course Goals and Curriculum
Overall goal: Learn basic concepts of operating system design and implementation. By the end of the course, you will have built your own small operating system and understand (at a high level) what's happening behind-the-scenes on your computer.
Topics:
- General design principles
- Abstraction
- Virtualization
- Indirection
- Caching
- Operating system structure
- User vs. kernel space
- Exception handling
- Process and thread management
- Scheduling & scheduling algorithms
- Synchronization/concurrent programming
- Synchronization primitives
- Deadlock
- Interprocess communication
- Virtual memory/memory management
- Address translation
- Paging & page replacement algorithms
- I/O devices and management
- DMA (direct memory access)
- Storage devices
- Magnetic disks
- Flash
- File systems
- File layout
- Transactions
<
- Virtual machines
Assumed background knowledge:
- From COS 217 (hard prerequisite for the course): C programming, assembly programming, function call stack, using gdb
- Note: COS 318 uses IA32 assembly; recent terms of COS 217 teach another flavor of assembly, but all concepts are transferrable
Challenges:
- Large volume of content makes it tough to retain things learned earlier in the course and understand how everything fits together
- Not as much support (ex. lab TA hours) as other COS classes, so you need to learn to figure things out on your own
- Time-consuming/difficult-to-debug programming assignments
Key strategy for success: be proactive about your learning -- start early and seek help independently.
Learning From Classroom Instruction
Powerpoint lectures introduce you to the main concepts of operating system design that you will use in your assignments and be tested on during the exam. Assigned textbook reading covers the same material as the lecture, but lectures often provide more context and detail, walk through examples, and give you an opportunity to get additional questions answered.
Lectures seem to come in topical modules: that is, groups of 2-3 lectures that build off each other, focused on the same concept. For instance, COS 318 does not have weekly precepts to review concepts (so you're on your own here!). Instead, precepts are roughly biweekly and cover programming assignment specifications. While programming assignments are heavily based in lecture concepts, you can't count on the assignments alone to help you understand everything in the course.
Strategies
- Go to lecture!
- Review slides before and after lecture: it's easy to lose focus during an 80 minute class
- Lectures may be diagram/example/walkthrough-heavy (especially around synchronization): work through these processes later on your own to make sure you understand what's going on without JP's narration
- Lecture slides often pose questions without providing the answers: as you review, make sure you can answer these questions (use your lecture notes/textbook/Piazza/classmates to fill in gaps)
- Ask questions in lectures (JP is nice, but will also call you out if you don't talk)
Learning For and From Assignments
Assignments
Programming assignments gradually build a small kernel, from the bootloader (code the load in the operating system) up to a file system. Each assignment gives you hands-on experience with implementing a major concept discussed in lecture (ex. scheduling, virtual memory).
Assignments are partnered. You have roughly two weeks for each assignment. At the beginning of the first week, there is a precept that covers the project goals and specifications. At the end of the first week, there is a 10-minute design review where you answer a some high-level questions about your solution to the project.
Strategies
- Start early! Assignments will be difficult and time consuming (10-20 hrs per week)
- Pick a partner with compatible coding skill, schedule, and personality
- Search the Intel manual and given code for assignments: get used to being independent
- Before beginning to code...
- Read and understand the specifications: knowing exactly what you need to do leads to better designed code (easier to write and debug)
- Read and understand the given code: often useful examples, helper functions, and explanatory comments are provided for you
- Search the code (using grep or ctrl+F or equivalent) for relevant variables, constants, functions
- Trace the control flow: when does each function get called? who calls each function?
- If you're unsure of something, check the project specs, Intel manual, and search the given code first: the answer may well be there already
- Before the design review, diagram (like literally draw things with arrows) the workflow/call graphs involved
- While coding, be careful about the Little Things (what's a pointer and what's not? variable scope? when do you initialize things?)
- Use office hours effectively: do work beforehand so you can come in with specific questions (ex. 'Is it correct that every process has its own page directory?' vs. 'How does page mapping work'? 'I'm having trouble saving user context in X function' vs. 'Help my code isn't working!?')
Resources
- TA hours: preceptors and undergrad lab TAs hold office hours (about 2 hours per preceptor per week)
- Fishbowl: if all the students work there, you can help each other out with ad hoc questions
- Intel manual
- Old COS 217 lecture slides and precept handouts (especially for C/assembly language/function call stacks/gdb)
- Piazza
- Some of your classmates are excellent programmers and can be really helpful resources
- Trying to answer Piazza questions is a fantastic way to solidify and enrich your understanding of what's going on (and help out your classmates, since this course is somewhat low-support)
Final Project You implement a file system, due on Dean's Date (in lieu of a final exam). Unlike previous assignments, you must work on your own! Think of it as a really large programming assignment, so the same strategies apply doubly: start early and have a good conceptual grasp before beginning to code.
Exam
There is only one exam, which falls in the later half of the term (around the first week of December). It is effectively a final, but may not cover material in the last couple lectures of the course.
Strategies
- Focus on reviewing lecture slides and go to textbook for further clarification
- Review old practice exams!
- Understand pros and cons of algorithms and design choices: literally sit down and list these out
- Be prepared to write code, especially related to synchronization
- Be prepared to do calculations (popular topics: virtual memory addressing, disk access, average turnaround time in scheduling)
- These questions are a curveball if you aren't expecting them, since the rest of the class is either conceptual or coding
- Look for similar questions in practice exams or lecture slides
External Resources
- Intel developer manual
- Old COS 217 lecture slides and precept handouts (especially for C/assembly language/function call stacks/gdb commands)
- Past OS students
What Students Should Know About This Course For Purposes Of Course Selection
Very time consuming, but incredibly rewarding. Going through the assignments makes you a better programmer and gives you a better sense of how your computer works under the hood (even more than COS 217).
COS 318 fulfills a COS systems requirement, though it is not a mandatory course in the department (...this student thinks it should be). Due to the time intensive assignments, take this with a lighter course load.
OS has a reputation of being a difficult course, but you shouldn't be intimidated. Instead, be prepared to push your boundaries and become a more independent learner and programmer.
For scheduling purposes, note that precepts are not actually weekly and you have an additional 10-minute design review for each project.
Note: If you take this course before senior fall, job interviewers will likely ask you OS-related questions and/or to write multi-threaded programs.
