├── README.md └── slides ├── 00-introduction.pdf ├── 01-system_calls.pdf ├── 02-files.pdf ├── 02-fuse.pdf ├── 03-processes.pdf ├── 04-concurrency.pdf ├── 05-memory_management.pdf ├── 06-network_programming.pdf ├── 07-performance.pdf ├── 08-container.pdf ├── 09-llvm.pdf └── preliminary_meeting.pdf /README.md: -------------------------------------------------------------------------------- 1 | # Practical course: Advanced Systems Programming in C/Rust -- SoSe 2023 2 | 3 | ## Chair website 4 | 5 | - The practical course is organized by the [Chair of Distributed Systems & Operating Systems](https://dse.in.tum.de/) at TU Munich. 6 | 7 | ## Course Information 8 | - Language: English 9 | - Type: Practical training 10 | - Module: IN0012, IN2106, IN2128 11 | - (_*This course is not offered to IN2397*_) 12 | - SWS: 6 13 | - ECTS Credits: 10 14 | - Prerequisites: 15 | - We don't have any compulsory prerequisites, but we prefer students to be proficient in the basic concepts of operating systems and systems programming (C/C++/Rust). 16 | - Preferred knowledge or equivalent to the lectures: 17 | - Fundamentals of Programming (IN0002) 18 | - Introduction to Computer Architecture (IN0004) 19 | - Basic Principles: Operating Systems and System Software (IN0009) 20 | - Course Material: 21 | - The Linux Programming Interface – Michael Kerrisk 22 | - Linux System Programming – Robert Love 23 | - TUM Online: You must register for this course in TUM Online before the course starts 24 | - Student note: Compulsory enrollment after two weeks of the matching outcome; students who fail to de-register in this period will be registered for the exam 25 | 26 | ## Course Details 27 | This course covers some of the most important aspects of systems programming. 28 | More specifically, we will cover the following topics through a set of programming assignments over the semester: 29 | 30 | - Kernel and system calls: How programs interact with the operating system, how to implement some system calls yourself in assembly 31 | - File I/O: Learn about file descriptors, direct i/o, memory mapped i/o, page cache etc. 32 | - Concurrency and synchronization: Learn about different threading primitives, i.e., mutexes, concurrent data structure design, and how they are implemented 33 | - Processes: Different system calls related to process handling like fork(), execve(), wait() 34 | - Memory management: How virtual memory, heap, stack, and how malloc() works 35 | - Networking: How to handle network protocols, efficient ways to implement servers 36 | - Performance: How to bring out the performance of the hardware 37 | - Virtualization: Hypervisors, containers, cgroups 38 | - Compilers: How to convert high-level languages into binary code and how to manipulate them 39 | 40 | This course consists of a set of modules related to different aspects of systems programming. 41 | For each of these modules, there is a dedicated assignment that will help students dig deeper into the concepts and get familiar with them with actual, useful, hands-on tasks. 42 | There is also a weekly Q&A meeting where we answer students' questions and discuss the specific goal of each assignment. 43 | The students will be required to perform tasks within a time frame (around 2-3 weeks depending on the task) and submit their work in the online evaluation system. 44 | The submitted workpieces will then be evaluated, and based on that, a grade will be calculated for each assignment. 45 | 46 | ## Objectives 47 | - Introduction to a variety of operating system concepts 48 | - Techniques for debugging and optimization of low-level code 49 | - Good understanding of memory- and resource management 50 | 51 | ## Meeting place 52 | 53 | - Preliminary meeting: February 6th (Mon), 2023 11:00 AM CET online (zoom) 54 | - [Slide](./slides/preliminary_meeting.pdf) 55 | - [Zoom link](https://tum-conf.zoom.us/j/63716968522?pwd=RXBrMTdCRnZGMkI1MDVKVEFWODh0UT09) 56 | - Meeting ID: 637 1696 8522 57 | - Passcode: 086604 58 | 59 | ## Tasks 60 | 61 | Please refer to the respective task repositories (that are released on the published date) for detail. 62 | The schedule may change. **All deadlines are at 16:00 (CEST).** 63 | 64 | | Task | Organizer | Published on | Deadline | Points | Slide | Video | 65 | |--------------------------------------------------------------------------|---------------------------------------------------|--------------|----------|--------|---------------------------------------------|-------------------------------------------------------------------------------| 66 | | [Introduction](https://github.com/ls1-sys-prog-course/task0-sort) | [Masanori](https://github.com/mmisono) | 17.04.23 | 01.05.23 | 0 | [link](./slides/00-introduction.pdf) | [Lecture]( https://youtu.be/Kv8OgLs1crI) | 67 | | [System Calls](https://github.com/ls1-sys-prog-course/task1-syscalls) | [Sebastian](https://github.com/Sebastian-Reimers) | 24.04.23 | 08.05.23 | 30 | [link](./slides/01-system_calls.pdf) | [Lecture](https://youtu.be/qO33G1od3Xo) | 68 | | [File I/O](https://github.com/ls1-sys-prog-course/task2-fileio) | [Babis](https://github.com/cmainas) | 08.05.23 | 22.05.23 | 30 | [link](./slides/02-files.pdf), [FUSE](./slides/02-fuse.pdf) | [Lecture](https://youtu.be/wDPH8DYZwCg), [FUSE](https://www.youtube.com/watch?v=i3YJK3es-iQ) | 69 | | [Processes](https://github.com/ls1-sys-prog-course/task3-processes) | [Jiyang](https://github.com/jedichen121) | 15.05.23 | 29.05.23 | 30 | [link](./slides/03-processes.pdf) | [Lecture](https://youtu.be/qNzgterdPng) | 70 | | [Concurrency](https://github.com/ls1-sys-prog-course/task4-concurrency) | [Francisco](https://github.com/FranciscoRomao) | 22.05.23 | 05.06.23 | 30 | [link](./slides/04-concurrency.pdf) | [Lecture](https://youtu.be/Bj-1pFh8Bck) | 71 | | [Memory Management](https://github.com/ls1-sys-prog-course/task5-memory) | [Sebastian](https://github.com/Sebastian-Reimers) | 05.06.23 | 19.06.23 | 30 | [link](./slides/05-memory_management.pdf) | [Lecture](https://youtu.be/1LxVzohqRx0) | 72 | | [Networking](https://github.com/ls1-sys-prog-course/task6-sockets) | [Jiyang](https://github.com/jedichen121) | 12.06.23 | 26.06.23 | 30 | [link](./slides/06-network_programming.pdf) | [Lecture](https://youtu.be/fDRaXnhjoDE) | 73 | | [Performance](https://github.com/ls1-sys-prog-course/task7-performance) | [Tianchi](https://github.com/lialittis) | 19.06.23 | 03.07.23 | 40 | [link](./slides/07-performance.pdf) | [Lecture](https://youtu.be/o1SkOoCyHDI) | 74 | | [Virtualization](https://github.com/ls1-sys-prog-course/task8-container) | [Babis](https://github.com/cmainas) | 26.06.23 | 10.07.23 | 40 | [link](./slides/08-container.pdf) | [Lecture](https://youtu.be/GMs3kLteZvk), [Task](https://youtu.be/INyb4Rj073U) | 75 | | [Compilers](https://github.com/ls1-sys-prog-course/task9-llvm) | [Martin](https://github.com/martin-fink) | 03.07.23 | 17.07.23 | 40 | [link](./slides/09-llvm.pdf) | [Lecture](https://youtu.be/7SSkksFEKfk) | 76 | 77 | Note that 78 | - 100% points lost if private tests detect cheating or we find a solution tries to game the system (modifying test scripts, etc.) 79 | - 50% points lost if normal private tests fail 80 | 81 | 82 | ## Allowed Libraries 83 | 84 | In general, only standard libraries can be used. In addition to this, the following libraries are available for use. 85 | 86 | - Rust: [libc](https://crates.io/crates/libc), [nix](https://crates.io/crates/nix) 87 | - C++: [{fmt}](https://fmt.dev/latest/index.html), [range-v3](https://github.com/ericniebler/range-v3) 88 | - General argument parsing libraries, such as [clap](https://crates.io/crates/clap) 89 | - General error handling libraries, such as [anyhow](https://docs.rs/anyhow/latest/anyhow/) 90 | 91 | Depending on the task, the use of additional libraries may be allowed or the use of libraries (including standard libraries) may be restricted. Please refer to the task description for details. 92 | 93 | 94 | For a reference of the standard library, check out: 95 | - [cppreference](https://en.cppreference.com/w/) for C/C++ 96 | - [std](https://doc.rust-lang.org/std/) for rust 97 | 98 | ## Environment 99 | 100 | All executables must run on Linux, x86_64. Therefore, we strongly recommend having a local Linux x86_64 environment for development. 101 | Note that some tasks involve loading kernel modules and configuring kernel parameters, including cgroups, and some operations are not allowed in some container (docker) environments. 102 | While we only guarantee the execution of tasks in a local Linux 86_64 environment, if you are using different OSes, you can try to use a virtual machine. More specifically, 103 | 104 | - Windows: WSL2 would work. Also, Hyper-V, VirtualBox, and VMware are available. 105 | - Mac: If you use Intel Mac, Docker for Mac would work. If you use Arm mac (M1/M2), then you can try to use [utm](https://mac.getutm.app/) to emulate the entire x86_64 environment, though the overhead of full system emulation is huge, and some tests may not pass. So we recommend preparing other environments. 106 | 107 | Some tasks are doable in [Github Codespaces](https://github.com/features/codespaces), which are free for students. 108 | However, some tasks are not doable as they require the kernel's permission. 109 | 110 | Each task gives more details information on runnable environments. 111 | Note that only the test results on CI count toward grading. 112 | 113 | ## Grades 114 | 115 | Grades are computed as follows: 116 | 117 | |From| To|Grade| 118 | |----|---|-----| 119 | |0 |120| 5.0 | 120 | |121 |135| 4.7 | 121 | |136 |150| 4.3 | 122 | |151 |165| 4.0 | 123 | |166 |180| 3.7 | 124 | |181 |195| 3.3 | 125 | |196 |210| 3.0 | 126 | |211 |225| 2.7 | 127 | |226 |240| 2.3 | 128 | |241 |255| 2.0 | 129 | |256 |270| 1.7 | 130 | |271 |285| 1.3 | 131 | |286 |300| 1.0 | 132 | 133 | ## Slack workspace 134 | 135 | We will use Slack for all communication. Please enroll in our Slack workspace using your official TUM email address. 136 | 137 | - **Slack workspace:** https://ls1-courses-tum.slack.com 138 | - **Slack channel:** #ss-23-sys-prog 139 | 140 | ## Other resources 141 | 142 | - [Youtube playlist](https://www.youtube.com/playlist?list=PLfKm1-FQibbB3U8jBJ5-mF3jmH0aCiQ7V) 143 | - [Bugtracker](https://github.com/ls1-sys-prog-course/docs/issues) 144 | - [Docker image](https://github.com/orgs/ls1-courses/packages/container/package/ls1-runner) 145 | - [The previous semester (SoSe22)](https://github.com/ls1-sys-prog-course-archive-SoSe22/docs) 146 | - NOTE: The course material is being kept updated; therefore, the old version has differences. 147 | 148 | ## Contact 149 | 150 | We *strongly* prefer Slack for all communications. For any further questions/comments, please contact the course organizer(s): 151 | 152 | - [Dr. Masanori Misono](https://mmisono.github.io/) 153 | - [Prof. Bhatotia](https://dse.in.tum.de/bhatotia/) 154 | 155 | -------------------------------------------------------------------------------- /slides/00-introduction.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ls1-sys-prog-course-archive-SoSe23/docs/a02becb86946752fc34f8f5e2c1cbe4d8a275eaa/slides/00-introduction.pdf -------------------------------------------------------------------------------- /slides/01-system_calls.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ls1-sys-prog-course-archive-SoSe23/docs/a02becb86946752fc34f8f5e2c1cbe4d8a275eaa/slides/01-system_calls.pdf -------------------------------------------------------------------------------- /slides/02-files.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ls1-sys-prog-course-archive-SoSe23/docs/a02becb86946752fc34f8f5e2c1cbe4d8a275eaa/slides/02-files.pdf -------------------------------------------------------------------------------- /slides/02-fuse.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ls1-sys-prog-course-archive-SoSe23/docs/a02becb86946752fc34f8f5e2c1cbe4d8a275eaa/slides/02-fuse.pdf -------------------------------------------------------------------------------- /slides/03-processes.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ls1-sys-prog-course-archive-SoSe23/docs/a02becb86946752fc34f8f5e2c1cbe4d8a275eaa/slides/03-processes.pdf -------------------------------------------------------------------------------- /slides/04-concurrency.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ls1-sys-prog-course-archive-SoSe23/docs/a02becb86946752fc34f8f5e2c1cbe4d8a275eaa/slides/04-concurrency.pdf -------------------------------------------------------------------------------- /slides/05-memory_management.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ls1-sys-prog-course-archive-SoSe23/docs/a02becb86946752fc34f8f5e2c1cbe4d8a275eaa/slides/05-memory_management.pdf -------------------------------------------------------------------------------- /slides/06-network_programming.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ls1-sys-prog-course-archive-SoSe23/docs/a02becb86946752fc34f8f5e2c1cbe4d8a275eaa/slides/06-network_programming.pdf -------------------------------------------------------------------------------- /slides/07-performance.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ls1-sys-prog-course-archive-SoSe23/docs/a02becb86946752fc34f8f5e2c1cbe4d8a275eaa/slides/07-performance.pdf -------------------------------------------------------------------------------- /slides/08-container.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ls1-sys-prog-course-archive-SoSe23/docs/a02becb86946752fc34f8f5e2c1cbe4d8a275eaa/slides/08-container.pdf -------------------------------------------------------------------------------- /slides/09-llvm.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ls1-sys-prog-course-archive-SoSe23/docs/a02becb86946752fc34f8f5e2c1cbe4d8a275eaa/slides/09-llvm.pdf -------------------------------------------------------------------------------- /slides/preliminary_meeting.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ls1-sys-prog-course-archive-SoSe23/docs/a02becb86946752fc34f8f5e2c1cbe4d8a275eaa/slides/preliminary_meeting.pdf --------------------------------------------------------------------------------