![Page 1: Operating System Projectscsl.skku.edu/uploads/SWE2015-41/swe2015s16intro.pdf · 2016. 3. 2. · Operating System Projects 2016 Spring Joonwon Lee Bon Keun Seo, Sangwook Kim, Sunghun](https://reader035.vdocuments.us/reader035/viewer/2022081403/6093d2646b4368616b690c11/html5/thumbnails/1.jpg)
Operating System Projects
2016 Spring
Joonwon Lee
Bon Keun Seo, Sangwook Kim, Sunghun Kim
![Page 2: Operating System Projectscsl.skku.edu/uploads/SWE2015-41/swe2015s16intro.pdf · 2016. 3. 2. · Operating System Projects 2016 Spring Joonwon Lee Bon Keun Seo, Sangwook Kim, Sunghun](https://reader035.vdocuments.us/reader035/viewer/2022081403/6093d2646b4368616b690c11/html5/thumbnails/2.jpg)
Objective
• Understanding the architecture of practical OS
– Based on Linux kernel
– Process and thread
– System call and interrupt
– Memory management
– Storage management
– ...
![Page 3: Operating System Projectscsl.skku.edu/uploads/SWE2015-41/swe2015s16intro.pdf · 2016. 3. 2. · Operating System Projects 2016 Spring Joonwon Lee Bon Keun Seo, Sangwook Kim, Sunghun](https://reader035.vdocuments.us/reader035/viewer/2022081403/6093d2646b4368616b690c11/html5/thumbnails/3.jpg)
Material
• Linux kernel versions later than 3.0
– Recommends ubuntu 14.04 (linux-4.2)
• Books
– Robert Love, Linux Kernel Development, 3rd edition, Addision-Wesley.
– Wolfgang Mauerer, Professional Linux Kernel Architecture, Wrox.
– Daniel P. Bovet and Marco Cesati, Understanding the Linux Kernel, 3rd edition, O'reilly.
![Page 4: Operating System Projectscsl.skku.edu/uploads/SWE2015-41/swe2015s16intro.pdf · 2016. 3. 2. · Operating System Projects 2016 Spring Joonwon Lee Bon Keun Seo, Sangwook Kim, Sunghun](https://reader035.vdocuments.us/reader035/viewer/2022081403/6093d2646b4368616b690c11/html5/thumbnails/4.jpg)
Schedule
Week Title Projects (due)
1 Introduction to Linux kernel
2 Tasks, scheduler, system call and interrupt 0. Environment setup
3-7 Memory management and virtual memory 0.5. Start up (module)
8 (Mid-term exam) 1. Virtual memory
9-12 Block device and device mapper 2. Block device
13-15 Virtual file system and ext4fs
16 (Final exam) 3. File system
![Page 5: Operating System Projectscsl.skku.edu/uploads/SWE2015-41/swe2015s16intro.pdf · 2016. 3. 2. · Operating System Projects 2016 Spring Joonwon Lee Bon Keun Seo, Sangwook Kim, Sunghun](https://reader035.vdocuments.us/reader035/viewer/2022081403/6093d2646b4368616b690c11/html5/thumbnails/5.jpg)
Grading
• Assignment: 90%
– Project 0, 0.5: 20% (person)
– Project 1~3: 70% (team)
• Presentation: 10% (person)
– Progress reports
– Final presentation
• Bonus points
– Brilliant ideas in projects or presentations
![Page 6: Operating System Projectscsl.skku.edu/uploads/SWE2015-41/swe2015s16intro.pdf · 2016. 3. 2. · Operating System Projects 2016 Spring Joonwon Lee Bon Keun Seo, Sangwook Kim, Sunghun](https://reader035.vdocuments.us/reader035/viewer/2022081403/6093d2646b4368616b690c11/html5/thumbnails/6.jpg)
Introduction to Linux
![Page 7: Operating System Projectscsl.skku.edu/uploads/SWE2015-41/swe2015s16intro.pdf · 2016. 3. 2. · Operating System Projects 2016 Spring Joonwon Lee Bon Keun Seo, Sangwook Kim, Sunghun](https://reader035.vdocuments.us/reader035/viewer/2022081403/6093d2646b4368616b690c11/html5/thumbnails/7.jpg)
Operating system
• What is an “operating system”?
– A software that application software operates on
OS
![Page 8: Operating System Projectscsl.skku.edu/uploads/SWE2015-41/swe2015s16intro.pdf · 2016. 3. 2. · Operating System Projects 2016 Spring Joonwon Lee Bon Keun Seo, Sangwook Kim, Sunghun](https://reader035.vdocuments.us/reader035/viewer/2022081403/6093d2646b4368616b690c11/html5/thumbnails/8.jpg)
Linux operating system
• An UNIX-like operating system by Linus Torvalds
Linux distributions
![Page 9: Operating System Projectscsl.skku.edu/uploads/SWE2015-41/swe2015s16intro.pdf · 2016. 3. 2. · Operating System Projects 2016 Spring Joonwon Lee Bon Keun Seo, Sangwook Kim, Sunghun](https://reader035.vdocuments.us/reader035/viewer/2022081403/6093d2646b4368616b690c11/html5/thumbnails/9.jpg)
GNU/Linux
• Linux distribution =
– Applications
– GNU (standard C library + system utilities)
– Linux (kernel)
![Page 10: Operating System Projectscsl.skku.edu/uploads/SWE2015-41/swe2015s16intro.pdf · 2016. 3. 2. · Operating System Projects 2016 Spring Joonwon Lee Bon Keun Seo, Sangwook Kim, Sunghun](https://reader035.vdocuments.us/reader035/viewer/2022081403/6093d2646b4368616b690c11/html5/thumbnails/10.jpg)
Linux kernel
• A pre-emptive multi-process monolithic kernel
– Event driven architecture
– Supports multiple architectures
– Kernel modules to extend
System call
Kernel
Applications
Scheduler
Device driver
Interrupt
VM File system Network Frame buffer
![Page 11: Operating System Projectscsl.skku.edu/uploads/SWE2015-41/swe2015s16intro.pdf · 2016. 3. 2. · Operating System Projects 2016 Spring Joonwon Lee Bon Keun Seo, Sangwook Kim, Sunghun](https://reader035.vdocuments.us/reader035/viewer/2022081403/6093d2646b4368616b690c11/html5/thumbnails/11.jpg)
Kernel abstraction
• Process, thread
• Virtual memory
• Block device, file
• Frame buffer device
• Socket
Character device
![Page 12: Operating System Projectscsl.skku.edu/uploads/SWE2015-41/swe2015s16intro.pdf · 2016. 3. 2. · Operating System Projects 2016 Spring Joonwon Lee Bon Keun Seo, Sangwook Kim, Sunghun](https://reader035.vdocuments.us/reader035/viewer/2022081403/6093d2646b4368616b690c11/html5/thumbnails/12.jpg)
Kernel feature (1)
• Compatible to POSIX
• Multi-architecture
– x86, ARM, MIPS, …
– Multi-processor, NUMA, …
• Multi-process, multi-thread
– Fair, time sharing scheduler
• Synchronization primitives
– Semaphore, spinlock, RCU, futex, …
![Page 13: Operating System Projectscsl.skku.edu/uploads/SWE2015-41/swe2015s16intro.pdf · 2016. 3. 2. · Operating System Projects 2016 Spring Joonwon Lee Bon Keun Seo, Sangwook Kim, Sunghun](https://reader035.vdocuments.us/reader035/viewer/2022081403/6093d2646b4368616b690c11/html5/thumbnails/13.jpg)
Kernel feature (2)
• Device mapper
– LVM, software RAID, flash caching, …
• File system
– ext4, btrfs, f2fs, …
– FUSE
• OSS sound
• Kernel Virtual Machine
• Wide varieties of device drivers
– Block, network, graphics, sound, tty, …
![Page 14: Operating System Projectscsl.skku.edu/uploads/SWE2015-41/swe2015s16intro.pdf · 2016. 3. 2. · Operating System Projects 2016 Spring Joonwon Lee Bon Keun Seo, Sangwook Kim, Sunghun](https://reader035.vdocuments.us/reader035/viewer/2022081403/6093d2646b4368616b690c11/html5/thumbnails/14.jpg)
Kernel source tree
• Documentation
• arch : architecture dependent codes
– Boot, interrupt, system call and memory management
• kernel : scheduler and synchronization
• mm : memory allocation and page caching
• block : block device abstraction
• net : network stack
• fs : virtual file system and file systems
• drivers : device drivers (physical and virtual)
![Page 15: Operating System Projectscsl.skku.edu/uploads/SWE2015-41/swe2015s16intro.pdf · 2016. 3. 2. · Operating System Projects 2016 Spring Joonwon Lee Bon Keun Seo, Sangwook Kim, Sunghun](https://reader035.vdocuments.us/reader035/viewer/2022081403/6093d2646b4368616b690c11/html5/thumbnails/15.jpg)
Kernel development
• Coding style / indentation
– Refer to Documentation/CodingStyle
– Written in C, but with an object-oriented programming style
• The best documentation is the code itself
– Most of codes are not documented
– Or, the documents are stale
• Beware of race conditions and the interrupt context