E 81 CSE 422 S Operating Systems Organization














- Slides: 14
E 81 CSE 422 S Operating Systems Organization Fall 2018 Course Introduction Department of Computer Science and Engineering Washington University, St. Louis MO Brian Kocoloski brian. kocoloski@cse. wustl. edu Thanks to Chris Gill and David Ferry who developed much of this material in previous iterations of the course 1
What is an operating system (OS)? • First and foremost, it is a program, not completely unlike programs you’ve written before • The primary difference between the OS and other programs is the OS runs with high enough privilege to directly access hardware resources – CPU processors – Memory – I/O devices (keyboard/mouse/network card/etc. ) • An operating system is a program that 1. Provides abstractions to make applications more portable across different types of hardware 2. Provides interfaces with which applications can safely access hardware 3. Implements policies that efficiently utilize hardware resources E 81 CSE 422 S - Operating Systems Organization 2
User applications Operating System Peripheral Devices (keyboard, Wi. Fi, etc. ) E 81 CSE 422 S - Operating Systems Organization CPU Cores Main memory (RAM) Secondary memory (hard drives) 3
Three Goals of this Course The goals of this course are for students to develop: 1. Good intuition about OS operation and design principles – OS mechanisms: syscalls, interrupts, threads, processes, scheduling, synchronization 2. Skills for monitoring the runtime operation of an OS – – – Tracers: ftrace (trace-cmd and kernelshark), strace User space benchmarking using timers, etc. The scientific method (hypothesis, prediction, experiment, analysis, repeat) 3. Hands-on experience modifying and evaluating an OS – – – Source-code intensive course based on Linux You’ll be asked to modify, build, and evaluate the OS kernel in different ways Studios will help you gain experience and expertise to use in the lab assignments E 81 CSE 422 S - Operating Systems Organization 4
The Linux kernel • Most widely deployed open-source project in the world • Powers smartphones (and even smaller devices) as well as the world’s largest supercomputers • Supports hundreds of different computer architectures • Written in a combination of C and architecture-specific assembly language E 81 CSE 422 S - Operating Systems Organization 5
Course Environment • Our OS of choice is the Linux kernel • This course is designed around the Raspberry Pi 3 – Avoids modifying the kernel on machines others may need to use • • – Reasonably fast, provides interesting multi-core behavior, affordable • – • Can quickly re-deploy a new version of the kernel if the one running locks up “Personal computing” at its best Each Raspberry Pi 3 has 1. 2 GHz 64 -bit quad-core ARMv 8 for < $100 (Cana. Kit) Useful, and used elsewhere in WUSTL CSE research and education The Raspberry Pi family is based on the ARM processor architecture – – The OS has lots of processor-dependent code (in separate directories) Will occasionally mention x 86 differences, where relevant E 81 CSE 422 S - Operating Systems Organization 6
Class Readings Course textbook (lots of good advice to help you succeed): Linux Kernel Development, 3 rd Ed. , by Robert Love, 2010. – A great starting resource for kernel hackers – Other class readings are relatively current documents about the Linux kernel – Plan to look at a lot of source code in your “spare” time – Course website provides a number of free/online references Google is your friend – Linux is widely documented (but documentation often is not current) – Lots of resources exist for individual directories, files, and even functions – We will provide links to some of those resources on the course web site E 81 CSE 422 S - Operating Systems Organization 7
Class Readings E 81 CSE 422 S - Operating Systems Organization 8
Communication • All announcements will be posted on Piazza – – • Post all course-related questions to Piazza – – • You should have received a link Let me know if you have not You will benefit when others ask questions, and others will benefit when you ask questions I will give better and more helpful replies because I will have more time The course schedule is posted online – Any significant changes to the schedule will be posted online, and an announcement will be made on Piazza E 81 CSE 422 S - Operating Systems Organization 9
Words of Advice (from me) • Kernel hacking requires a lot of patience (and thought) – – • Work efficiently but persistently – – • Your systems will crash Don’t underestimate the power of using pencil and paper before you start typing Our goal is for the time spent “hands-on” to be similar to our intro courses Start early, fail (or succeed) quickly, iterate rapidly, progress steadily over time A few tips for this course (to avoid problems we’ve seen already) – – Brush up on your C Brush up on shell scripting E 81 CSE 422 S - Operating Systems Organization 10
Comments from Previous Students • “You program in C to reconfigure a Linux Kernel on a Raspberry Pi. Prepare to optimize your workflow for testing, and brush up on C – you'll be using it a lot. ” • “I had trouble doing studios because I never made it to class. So I was always playing catch–up and stressed out by the studios. ” E 81 CSE 422 S - Operating Systems Organization 11
Comments from Previous Students • “It made me more interested in the low–level and hardware aspects of a computer! It also made the "operating system" a less scary and complex topic. ” • “[You] learn how the operating system interfaces with the hardware to allow users do everything from issue commands to compiling programs. ” • “ … it felt like we were doing things that could actually be accomplished in the real world. ” E 81 CSE 422 S - Operating Systems Organization 12
A Typical Class • About 30 minutes of lecture discussing that day’s readings and course topic • About 50 minutes of studio time • Studios – Offer direct experience working with (and within) the kernel – Familiarize students with key tools and techniques for using, profiling, analyzing, and extending kernel features. – Work in groups of up to 4 students E 81 CSE 422 S - Operating Systems Organization 13
Today’s Studio • Downloading and Compiling the Linux kernel – You don’t need your Raspberry Pi until Wednesday • We are using a technique called cross-compiling – You are compiling the kernel on different machine from where we will ultimately run the kernel (your Raspberry Pi) Compile the kernel here Install the kernel here linuxlab cluster E 81 CSE 422 S - Operating Systems Organization 14














