LE1 (CRN 13241)
Smith Hall 108
office hours: M 3:15-4:15pm, W 2:15-3:15pm (HAAS 220)
M 2:15-3:15pm (HAAS G072)
M 1:15-2:15pm (HAAS G072)
T 3:30-4:30pm (HAAS 143), R 2-3pm (HAAS 143)
M 3:15-4:15pm (HAAS G072)
F 1:15-2:15pm (HAAS G072)
M 1:15-2:15pm (HAAS G072)
M 3:15-4:15pm (HAAS G072)
M 2:15-3:15pm (HAAS G072), R 2-3pm (HAAS 143), F 1:15-2:15pm (HAAS G072)
T 1:30-2:20pm; Jeong, Chustak
T 2:30-3:20pm; Kalluri, Kunaparaju
W 10:30-11:20am; Das, Chustak
W 1:30-2:20pm; He, Kunaparaju
W 5:30-6:20pm; Jayatilaka
W 6:30-7:20pm; Kalluri, Kaur
R 9:30-10:20am; Guduru, Kaur
R 10:30-11:20am; Jeong, Chustak
F 9:30-10:20am; Guduru, Kaur
F 10:30-11:20am; Das, Kaur
Operating System Design – The Xinu Approach, Douglas Comer, 2nd edition (required)
- The final exam is scheduled on 12/12/2023; 3:30-4:45pm, STEW 130, closed note/book. Scope is comprehensive but focus will be on material covered after the midterm. Please make sure to bring your Purdue ID. Sample exam and solution: spring 23 (solution) | spring 22 (solution).
- During Quiet Period before finals week office hours and PSOs will follow regular schedule. There is no class on Dec. 4. On Dec. 6 and 8 classes will be Q&A based review sessions. There is no need to attend if you do not have questions.
- The fifth lab assignment has been graded. To check your score (lab5.rpt), please follow the same procedure as before.
- The fourth lab assignment has been graded. To check your score (lab4.rpt), please follow the same procedure as before. The scores were released on Nov. 8 following regular schedule but I forgot to post an announcement. If you intended to follow up but haven't, you have until Nov. 29 to do so.
- Due to Thanksgiving break, lab5 scores will be returned on Nov. 29.
- The fifth lab assignment, lab5, has been released.
- The third lab assignment has been graded. To check your score (lab3.rpt), please follow the same procedure as before.
- The fourth lab assignment, lab4, has been released.
- The midterm has been graded. Please follow the same procedure as the lab assignments to check your score (mid.rpt). The text file, mid-stats.txt, in the course directory contains relevant stats. You may pick up your exam during my office hours. Compare your answers against the solution key. If you have any questions, please come to my office hours. You have two weeks to follow up. Copy of midterm and solution: exam | solution.
- The second lab assignment has been graded. To check your score (lab2.rpt), please follow the same procedure as before.
- The third lab assignment, lab3, has been released.
- The midterm is scheduled on Oct. 11, 2023, in-class; closed note/book. Exam duration is 45 minutes; scope is material covered in class and labs assignments until 10/6/2023. Please bring your Purdue ID which will be checked. Sample exam and solution: spring 23 (solution) | spring 22 (solution).
- The first lab assignment has been graded. To check your score, please follow the instructions in scores.txt in the course directory. It will also contain instructions on how to follow up if you have questions.
- The second lab assignment, lab2, has been released.
- Undergraduate Student Board announcement: international student career panel.
- The first lab assignment, lab1, has been released.
- PSOs and TA office hours will commence on Aug. 30, 2023. If you have any questions, please come to my office hours or email me. Although not required, it is strongly recommended that students utilize the PSOs where lab assignment assistance is provided.
Please follow instructions in the overview lecture (first lecture) for accessing lecture slides (pdf) in the course directory and Brightspace. The topics listed below include material not covered in the pdf lecture slides. They should be referenced from 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.
- Organization of kernels into upper and lower halves, their roles.
- Isolation/protection: motivation, hardware, and software support.
- x86-specific hardware support: rings, privilege levels, user mode/kernel mode; configuration of GDT in x86 Linux/Windows; role of CS, DS, SS registers.
- x86 synchronous and external interrupts, configuration of IDT, IF bit in EFLAGS, cli/sti instructions.
- System call implementation: three software layers - system call wrappers, system call dispatcher, upper half kernel functions.
- x86 trap via INT instruction, untrap via IRET, hardware support for stack switch.
- Structure of XINU system calls.
- Location of scheduler within kernel, pathways for its invocation.
- Four issues associated with context-switching: saving/restoring hardware and software state, switching process stacks, seemless resumption of execution of checkpointed process, process that executed before vs. newly created process.
- Technique used to context-switch in a newly created process, role of create() and resultant behavior of ctxsw() kernel function.
- Dynamic priority scheduling: CPU- vs. I/O-bound processes, goal of improving upon round-robin scheduling by reducing response time of I/O-bound processes.
- Rationale underlying heuristic adjustment of priority and time slice based on process behavior.
- Scheduling framework based on multilevel feedback queue, constant overhead.
- Example: Solaris UNIX dispatch table.
- Fair scheduling and Linux CFS: logarithmic overhead, real-world workload issues.
- Overhead of message passing vs. shared memory IPC.
- Synchronous vs. asynchronous IPC, conceptual structure of asynchronous IPC with callback function and its applications.
- Blocking vs. non-blocking IPC.
- Example: Design considerations when implementing a blocking version of send() in XINU.
- Mutual exclusion using interrupt disabling, test-and-set, counting semaphores; their pros/cons.
- Orderly access to producer/consumer buffer using two counting semaphores, advantage over mutual exclusion to guard buffer.
- Deadlock detection: cycle detection in resource graph, overhead, rationale behind not treating as essential kernel service; simple method for deadlock prevention.
- External and internal fragmentation.
- Benefits of indirection and virtualization of memory, per-process virtual to physical address translation.
- Locality of reference, caching, memory hierarchy.
- Boundary between software and hardware responsibility for cache misses.
- Pages, frames, page table look-up to translate page number to frame number.
- Multi-level page tables: 2-level page table in x86-32, 4-level page table in x86-64.
- Memory footprint of real-world processes: elephants | mice.
- Demand paging, page replacement, relationship between optimal, LRU, global clock.
- Memory thrashing: cause, symptoms and performance impact.
- Example: thrashing in Linux. (pdf)
- Major vs. minor page faults, causes, and solutions.
- Lower half interrupt disabling, context-borrowing, non-blocking lower half implementation.
- Shared kernel buffer between lower and upper halves, reuse of counting semaphores for orderly access of producer/consumer buffer.
- Lower half architecture: top half and bottom half division, bottom half implementation via context-borrowing vs. kernel processes, their pros/cons.
- Necessity and role of DMA support.
- Example: webcam video streaming in Linux/Windows. (pdf)
- Example: Windows streaming using KS proxy. (pdf)
- Types of clocks, their features, use in kernels.
- Tick value and timer accuracy.
- Tickful vs. tickless kernels, pros/cons.
- File system design: real-world workload properties and performance issues.
- Similarities and differences between XINU FS and FAT, relevance of FAT file systems in specific application domains, its limitation as a general-purpose file system.
- Design of indexing structure of traditional (i.e., UNIX) file systems to accommodate properties of real-world file sizes and performance benefits.
- Software techniques to improve file system performance.
- Journaling, reliability, efficient file system check.
- Page cache: file caching in main memory to improve performance, implementation considerations.
- Networked file systems, consistency, timestamps associated with files, clock synchronization.
- Hard disk performance, motivation of log-structured file system, implementation issues.
- Features of SSDs, wear leveling, relation to log-structured FS.
- Implementation of wear leveling and garbage collection by FTL in traditional file systems.
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 45%. The same goes for the midterm and final exams which are capped at 25% and 30%, respectively. 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+, etc.
Lab Assignment 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 on Windows. Please note that CS has recently moved to two-factor authentication when using ssh. The frontend machines 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 points 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. Utilizing code generated by AI tools such as ChatGPT 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.
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. In the event of a family emergency, please contact the instructor to set accommodations following university rules.
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 PUSH for COVID-19 related information.
In the event of health issues, please contact the Protect Purdue Health Center (PPHC) or your health care provider to receive support and medical attention. Reach out to your Academic Case Manager firstname.lastname@example.org to receive additional assistance. In case of hospitalization and other urgency care, please contact the Office of the Dean of Students (ODOS) who will document and notify the instructor. Please check the Excused Absence Policies site for additional details.
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.
Purdue University is committed to making learning experiences accessible. If you anticipate or experience physical or academic barriers based on disability, you are welcome to let me know so that we can discuss options. You are also encouraged to contact the Disability Resource Center at: email@example.com or by phone: 765-494-1247.
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.