For both CS 35400-LE1 (CRN 27133) and CS 35400-OL1
3 credits, async-online
lectures are available as video recordings via asynchronous online access
email@example.com (HAAS 220, 765-494-7821)
office hours: M 1-2pm, W 9:15-10:15am
(office hours are online; for on-campus students physical meetings can be set up as needed)
(office hours are online)
firstname.lastname@example.org, M 3:30-4:30pm
email@example.com, F 1-2pm
firstname.lastname@example.org, W 3:30-4:30pm
email@example.com, M 2-3pm
firstname.lastname@example.org, F 2-3pm
HAAS 257 and online:
T 10:30-11:20am (Hill)
T 11:30-12:20pm (Hill)
T 1:30-2:20pm (Jahandideh)
T 4:30-5:20pm (Hart)
W 10:30-11:20am (Hart)
W 11:30-12:20pm (Hart)
W 1:30-2:20pm (Abubakar)
W 2:30-3:20pm (Abubakar)
R 10:30-11:20am (Abubakar)
R 11:30-12:20pm (Abubakar)
R 12:30-1:20pm (Jahandideh)
R 1:30-2:20pm (Jahandideh)
F 11:30-12:20pm (Jeong)
M 9:30-10:20am (Jeong)
M 10:30-11:20am (Jeong)
R 3:30-4:20pm (Hill)
Operating System Design – The Xinu Approach, Douglas Comer, 2nd edition (required)
- lab5 has been released. lab4 will be graded and scores available in 1 week.
- The third lab assignment has been graded. Please follow the same procedure as before to access your scores (lab3.rpt) and follow up.
- lab4 has been released. lab3 will be graded and scores available in 1 week.
The midterm exam has been graded. Please follow the same procedure as the lab
assignments to check your score (mid.rpt). Ignore any scores posted on Gradescope.
We are using Gradescope only to administer exams, not to manage scores. Exam
stats and course grade related information are available in mid-stats.txt in the
The exam questions and your answers should now be visible in Gradescope. The solution sheet, mid-354-21s-sol.pdf, containing a detailed breakdown of points is available in the course directory. The answers are on the long side to facilitate clarity. Your answers can be shorter and receive full credit.
If you have any questions, follow up with me, not the TAs, during my office hours. You have three weeks (until April 14) to do so. Make sure to study and compare the solution sheet with your answers before following up. In our Google Meet session, I will ask you to specify which part of which problem you are unsure of. If there was a mistake in grading where points were deducted, they will be returned. If there was a mistake in grading where points were not deducted, they will be deducted.
- The second lab assignment has been graded. Please follow the same procedure as before to access your scores (lab2.rpt) and follow up.
- lab3 has been released. lab2 will be graded and scores available in 1 week.
The midterm is scheduled on 03/15/2021. The exam will be open for
24 hours starting at 9am EDT. Exam length is 50 minutes, however, you
will be given 2 hours to complete. We will use Gradescope to
administer the exam.
The scope of
the exam is material covered in the lectures until (and inclusive)
03/12/2021. You may also be queried on the first two lab assignments including
code that you submitted.
The exam will be open note/book/on-line lectures. Your answers must be individual
effort. Collaboration of any form is not allowed.
A sample exam and solution (fall 2020) is available in the course directory: mid-354-20f.pdf and mid-354-20f-sol.pdf.
The best way to prepare for the exam is to review the material discussed in the lectures. There will be five questions each worth 20 points. The questions require you to explain your answers. Each question should take less than 10 minutes to complete. The additional 1 hour and 10 minutes is provided in consideration of the online format. We will use Gradescope, an online exam administration software provided through Purdue. You will receive notification from Gradescope with access information before the exam.
- The first lab assignment has been graded. Please follow the instructions in scores.txt in the course directory to access your scores. You have one week to follow up if you have questions.
- Due to Purdue canceling in-person classes on 02/16/2021, the scheduled PSOs will be held online only.
- The deadline of lab2 has been extended by a week to 03/03/2021. Next Wednesday (02/17/2021) is designated as Reading Day by the university. There will be no new lecture on that day. Office hours and PSOs will be held following regular schedule which you may utilize.
- For those interested, Fulbright scholarship information for STEM majors that Purdue has asked to share: pdf.
- lab2 has been released. lab1 will be graded and scores available in 1 week. Details will follow on how to access scores and follow up.
- The first lab assignment, lab1, has been released on 01/29/2021.
- PSOs and TA office hours will commence on Jan. 29, 2021. If you have any questions, please contact me (email@example.com). Although not required, it is strongly recommended that students utilize the PSOs where lab assignment assistance is provided.
- Video lectures are recorded using Kaltura and stored on Google Drive as mp4 files for streaming and downloading. They can be accessed via links in lec.txt in the course directory. Lectures will be released on a MWF schedule before noon. Check lec.txt which will contain a link and synopsis of the lecture.
- PSOs and office hours will be held at designated times using a combination of Piazza and Google Meet. Please follow the procedure specified here. Do not use Piazza and Google Meet outside the times specified on the course web page.
- Lab assignments will be submitted using turnin. Details will follow when the first assignment, lab1, is released including the procedure for accessing scores.
- Midterm and final exams will be administered using Gradescope or Brightspace.
- Lab assignment 5
- Lab assignment 4
- Lab assignment 3
- Lab assignment 2
- Lab assignment 1
- XINU setup
- TA notes
- Reference material
Please follow instructions in the overview lecture (first lecture) for accessing lecture slides (pdf) in the course directory. The topics listed below include material not covered in the pdf lecture slides. They should be referenced from the online lectures and additional pdf slides.
- What is CS 354 about? (pdf)
- Overview of operating system concepts.
- Von Neumann architecture, CPU instruction set, registers, main memory, programs, compilers, assembly and machine code, static and dynamic linker, loader. [Additional background for reference (pdf) which is optional.]
- Memory layout produced by C compilers, run-time stack and CDECL caller/callee convention. (pdf)
- Steps of XINU boot loading and initialization on galileo backends.
- Isolation/protection: motivation, hardware and software support.
- Organization of kernel into upper and lower halves, two pathways for switching from user mode to kernel mode.
- XINU's run-time environment, sharing, and absence of isolation/protection.
- x86-specific features: privilege levels and user/kernel mode, GDT and CS/DS/SS registers, software disabling of memory segment bound checking, GDT setup in Linux and Windows versus difference in XINU.
- Role of IDT in managing interrupt handling by operating system lower half.
- Synchronous vs. asynchronous interrupts, IF bit of EFLAGS register and interrupt disabling.
- IDT configuration and interrupt handling in XINU.
- Process models, role of null/idle process.
- Position of scheduler within kernel upper/lower halves, top-down and bottom-up pathways for scheduler invocation.
- Management of time slice by clock interrupt handler in lower half.
- Mechanics of context-switching: process to be context-switched in has a past (i.e., ran before and was context-switched out).
- Corner case where process to be context-switched in does not have a past (i.e., newly created process that runs for the first time): manipulate run-time stack during process creation to achieve seemless context-switching.
- Scheduling overhead: dequeue vs. enqueue of ready processes, constant vs. linear overhead of XINU's readylist.
- Scheduling objectives and algorithms in operating systems: equal share fairness, round-robin scheduling, CPU- vs. I/O-bound processes.
- Qualitative assignment of priority and time slice to CPU- vs. I/O-bound processes.
- Quantitative example: Solaris UNIX dispatch table.
- Constant overhead scheduling using array of FIFO queues indexed by priority.
- Fair scheduling and Linux CFS: real-world workload issues, logarithmic overhead.
- Synchronous blocking/nonblocking IPC and tasks of kernel upper half.
- Asynchronous IPC with callback function: applications, design and implementation to preserve isolation/protection.
- Concurrent access, racing condition, and process synchronization.
- Application to mutual exclusion and producer/consumer queue.
- Voluntary vs. mandatory primitives, prologue/epilogue code to guard critical section.
- Hardware support: interrupt disabling, test-and-set, their trade-offs.
- Software support: counting semaphore, blocking/unblocking and semaphore queue.
- XINU wait() and signal() implementation, dependence on hardware support.
- Producer/consumer synchronization using two counting semaphores and advantage over using mutual exclusion.
- Deadlock detection, its overhead, and prevention.
- Rationale for dealing with deadlocks by operating systems based on isolation/protection.
- Basic memory management: dynamic memory allocation/deallocation in XINU.
- External and internal fragmentation, indirection to handle external fragmentation.
- Virtualization of memory using per-process address translation table.
- Benefits of virtual memory using hardware support and its overhead.
- Paging: page number, offset, address translation, 32-bit architecture with 4 KB page size example.
- Per-process page table, PTBR, context-switching.
- Memory hierarchy, locality of reference and performance benefits.
- Boundary of virtual vs. physical addresses in memory hierarchy.
- Fast address translation using TLB hardware support.
- Demand paging and page fault handling.
- Context-switch overhead stemming from cache flushing in memory hierarchy.
- Technology influence of virtual memory management.
- Page replacement policy: relationship between LRU and optimal, role of locality of reference.
- Global clock page replacement.
- Pageout daemon: implementing kernel functionality as a kernel process.
- Memory thrashing and its symptoms.
- Memory footprint of real-world processes (elephants | mice).
- Real-world memory workload facilitates page table compression.
- Multi-level page tables: 2-level page table example for x86-32.
- Organization of interrupt processing.
CS 250, 251, 252. Ability to understand and write complex programs in C. Familiarity with system development tools.
The grade will be determined by a midterm, final, and lab assignments. Their relative weights are:
Lab assignments will have opportunities to earn bonus points. These points serve to more easily reach the maximum achievable points in the lab assignment component. The points do not carry over and are capped at 50%. The course grade is not curved. Approximately, a total weighted score in the 90s maps to an A-range grade (includes +/- grades), mid-70s to 80s for B-range, mid-60s to low-70s C and C+. Below that C-, D, and F.
Labs and Policies
We will use the XINU operating system for the lab assignments. The XINU lab is located in the HAAS Building, room 257. The lab is comprised of frontend machines xinu01.cs.purdue.edu, xinu02.cs.purdue.edu, ..., xinu21.cs.purdue.edu which are Linux PCs. You will use the frontend machines for operating system code development (coding and compiling/linking) and to access one of the backend machines galileo101.cs.purdue.edu, galileo102.cs.purdue.edu, ..., galileo196.cs.purdue.edu.
The frontend machines can be remotely accessed via TLS/SSL applications such as ssh on Linux/MacOS and PuTTY (or OpenSSH) on Windows. They can be used by multiple users concurrently to develop and test code. The backend machines are x86 Intel Galileo boards equipped with Quark X1000 processors that are dedicated to running your implementation of XINU. Thus you are loading/running your own OS binary developed on the frontends on dedicated backend hardware. The specifics of developing and testing code in the XINU Lab will be covered in lab1.
Getting Your CS Account
Students registered in the course should have an account automatically set up. Please check by going to HAAS 257 or remote accessing one of the frontend lab machines. If you have registered but don't have an account, please contact ScienceHelp@purdue.edu.
To help manage unexpected scheduling demands, you are given a budget of 4 late days in total that may be used for late submissions of lab assignments. For example, you may submit 1 day late on four lab assignments, or 4 days late on one lab assignment. Any combination is valid as long as the total days delayed does not exceed 4. There will be a total of 5 lab assignments. Late days not utilized at the end of the semester will be converted to 15 bonus point each (maximum of 60). Outside of the 4 late days, all deadlines are hard and no partial credit will be given.Due to the low-level systems nature of the lab assignments, coding and evaluating parts of an operating system running on hardware is time intensive. To encourage proactive tackling of assignments, all submissions turned in 2 days prior to its deadline will be given a 5% bonus credit (as a fraction of the points received).
We aim to foster an open and collegial class environment. At the same time, we are vigorously opposed to academic dishonesty because it seriously detracts from the education of honest students. Because of this, we have the following standard policy on academic integrity, consistent with Purdue University's official policy.
All CS354 assignments are individual efforts and collaboration of any form is not allowed. This includes discussing solution ideas and sharing of code. Utilizing others' code found on the Internet is not allowed. If you have a question or are unsure, please contact me.
Students who share their work with others are as responsible for academic dishonesty as the student benefiting from the material. Students are not to show work to other students, and are responsible for the security of their work. File/directory permissions must be set to be unreadable to others (e.g. use "chmod -R 700 *" from your home directory). The same goes if you utilize depositories such as GitHub. If you need assistance protecting your work, please contact the TAs or the instructor.
Students who encourage others to cheat or plagiarize, or students who are aware of plagiarism or cheating and do not report it are also participating in academically dishonest behavior.
We will use a software tool, MOSS, to check for copying among submitted assignments. Additionally, we will inspect all submitted material to detect academic integrity violation.
If you have any assignment related questions, please utilize the PSOs and office hours which are scheduled Monday-Friday. The main difference between getting help on coding related questions from the instructor/TAs versus a fellow student is that the instructor/TAs will provide assistance that help you tackle a problem on your own without revealing the solution.
Any case of academic dishonesty will be dealt with by a severe grade penalty in the overall class grade and referral to the office of the Dean of Students.
COVID-19 and Emergencies
In the event of an emergency, course requirements, deadlines, and grading percentages are subject to changes that may be necessitated by a revised semester calendar. If such unusual circumstances arise, students may determine any such changes by contacting their instructors via email or phone, and checking the course web page for updates.
Campus emergencies and closings will be announced on local media and on the main Purdue University WWW site http://www.purdue.edu. Please consult the Purdue emergency preparedness resources web site for detailed information and relevant resources. Consult the Protect Purdue Plan for COVID-19 specific information.
In the event of health issues, including COVID-19, please contact the Protect Purdue Health Center (PPHC) to receive support and medical attention. Reach out to your Academic Case Manager firstname.lastname@example.org to receive additional assistance. Then contact me so that remedial actions can be undertaken such as deadline extensions and make-up exams. The same goes if you must quarantine or isolate during the semester due to COVID-19.
Purdue University is committed to advancing the mental health and well-being of its students. If you or someone you know is feeling overwhelmed, depressed, and/or in need of mental health support, services are available. For help, contact Counseling and Psychological Services (CAPS) at 765-494-6995 during and after hours, on weekends and holidays, or by going to the CAPS office on the second floor of the Purdue University Student Health Center (PUSH) during business hours.
Purdue University is committed to maintaining a community which recognizes and values the inherent worth and dignity of every person; fosters tolerance, sensitivity, understanding, and mutual respect among its members; and encourages each individual to strive to reach his or her potential. In pursuit of its goal of academic excellence, the University seeks to develop and nurture diversity. The University believes that diversity among its many members strengthens the institution, stimulates creativity, promotes the exchange of ideas, and enriches campus life. A hyperlink to Purdue's full Nondiscrimination Policy Statement is included in Brightspace under University Policies.
This is an undergraduate introductory course to operating systems that investigates how modern operating systems are architected and implemented. Extensive implementation experience is gained by coding, testing, and benchmarking key components of the XINU operating system on dedicated backend hardware. Our main implementation platform will be x86 backend machines and Intel x86 frontend PCs where code is developed. Most coding is done in C, with some hardware dependent components utilizing assembly language.
The topics covered in the course include: evolution of computing systems and their operating systems, process management, inter-process communication, memory management, virtual memory, I/O subsystems and device management, file systems, virtualization and security, and mobile operating systems. In addition to implementing key OS features in XINU, we will examine case studies in Linux, UNIX (Solaris and BSD), and Windows that differ from XINU and each other in significant ways. One important example is how I/O subsystems are architected to handle a range of heterogenous devices and their interrupts, including high-speed USB and wired/wireless network interfaces, that characterize many of today's computing systems. Kernel dependence on changing hardware features and support is an important theme throughout the course that will help familiarize with recent developments such as non-traditional file systems for flash memory prevalent in mobile systems. We will touch upon mobile OS (e.g., iOS, Android) with emphasis on differences with desktop/server operating systems.
Upon successful completion of the course, you will understand how modern operating systems are designed and implemented. You will understand how operating systems interface with hardware. You will have gained the technical skills to program operating systems and evaluate their performance.