operating system projects - androbenchcsl.skku.edu/uploads/swe3030f17-41/swe3030f17_intro.pdf ·...

18
Operating System Projects 2017 Fall Joonwon Lee

Upload: others

Post on 07-Jan-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Operating System Projects - AndroBenchcsl.skku.edu/uploads/SWE3030F17-41/swe3030f17_intro.pdf · 2017-09-01 · Schedule Week Title Projects 1 Introduction to Linux kernel 0. Environment

Operating System Projects

2017 FallJoonwon Lee

Page 2: Operating System Projects - AndroBenchcsl.skku.edu/uploads/SWE3030F17-41/swe3030f17_intro.pdf · 2017-09-01 · Schedule Week Title Projects 1 Introduction to Linux kernel 0. Environment

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 Projects - AndroBenchcsl.skku.edu/uploads/SWE3030F17-41/swe3030f17_intro.pdf · 2017-09-01 · Schedule Week Title Projects 1 Introduction to Linux kernel 0. Environment

Material

• Linux kernel versions later than 3.0– Recommends ubuntu 16.04 (linux-4.12)

• 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 Projects - AndroBenchcsl.skku.edu/uploads/SWE3030F17-41/swe3030f17_intro.pdf · 2017-09-01 · Schedule Week Title Projects 1 Introduction to Linux kernel 0. Environment

Schedule

Week Title Projects

1 Introduction to Linux kernel 0. Environment setup

2-4 Tasks, scheduler, system call and interrupt 1-1. Module1-2. Synchronization1-3. System calls

5-10 Memory management and virtual memory 2. Virtual memory

8 (Mid-term exam)

11-13 Storage system: File systems 3. File system

13-15 Storage system: Block layer

16 (Final exam)

Page 5: Operating System Projects - AndroBenchcsl.skku.edu/uploads/SWE3030F17-41/swe3030f17_intro.pdf · 2017-09-01 · Schedule Week Title Projects 1 Introduction to Linux kernel 0. Environment

Grading

• Assignment: 100%– Project 0, 1 (person): 30%– Project 2, 3 (team): 70%

• Team – 1~3 members– No additional score to one-man team

• Bonus points– Brilliant presentations

Page 6: Operating System Projects - AndroBenchcsl.skku.edu/uploads/SWE3030F17-41/swe3030f17_intro.pdf · 2017-09-01 · Schedule Week Title Projects 1 Introduction to Linux kernel 0. Environment

Project Scoring

• Code – team– We only give score to “normally functioned” code– Do not COPY

• Presentation – team– Each member must present at least once

• Report – person– Write your own report by yourself– Submit report by e-mail

• Contribution – person– We will read your GIT commit logs

Page 7: Operating System Projects - AndroBenchcsl.skku.edu/uploads/SWE3030F17-41/swe3030f17_intro.pdf · 2017-09-01 · Schedule Week Title Projects 1 Introduction to Linux kernel 0. Environment

Commit Log Example

Page 8: Operating System Projects - AndroBenchcsl.skku.edu/uploads/SWE3030F17-41/swe3030f17_intro.pdf · 2017-09-01 · Schedule Week Title Projects 1 Introduction to Linux kernel 0. Environment

Tutors

• Sung-hun Kim– [email protected]– 85557, 산학협력관

• Youngjoo Woo– [email protected]– 85533, 산학협력관

• Gyusun Lee– [email protected]– 400512, 반도체관

• If you want to visit, send e-mail first

Page 9: Operating System Projects - AndroBenchcsl.skku.edu/uploads/SWE3030F17-41/swe3030f17_intro.pdf · 2017-09-01 · Schedule Week Title Projects 1 Introduction to Linux kernel 0. Environment

Introduction to Linux

Page 10: Operating System Projects - AndroBenchcsl.skku.edu/uploads/SWE3030F17-41/swe3030f17_intro.pdf · 2017-09-01 · Schedule Week Title Projects 1 Introduction to Linux kernel 0. Environment

Operating system

• What is an “operating system”?– A software that application software operates on

OSResourcemanagement- Isolation/protection

- Sharing

Page 11: Operating System Projects - AndroBenchcsl.skku.edu/uploads/SWE3030F17-41/swe3030f17_intro.pdf · 2017-09-01 · Schedule Week Title Projects 1 Introduction to Linux kernel 0. Environment

Linux operating system

• An UNIX-like operating system by Linus Torvalds

Linuxdistributions

Page 12: Operating System Projects - AndroBenchcsl.skku.edu/uploads/SWE3030F17-41/swe3030f17_intro.pdf · 2017-09-01 · Schedule Week Title Projects 1 Introduction to Linux kernel 0. Environment

GNU/Linux

• Linux distribution =– Applications– GNU (standard C library + system utilities)– Linux (kernel)

Page 13: Operating System Projects - AndroBenchcsl.skku.edu/uploads/SWE3030F17-41/swe3030f17_intro.pdf · 2017-09-01 · Schedule Week Title Projects 1 Introduction to Linux kernel 0. Environment

Linux kernel

• A preemptive multi-process monolithic kernel– Event driven architecture– Supports multiple architectures– Kernel modules to extend

Systemcall

Kernel

Applications

Scheduler

Devicedriver

Interrupt

VM Filesystem Network Framebuffer

Page 14: Operating System Projects - AndroBenchcsl.skku.edu/uploads/SWE3030F17-41/swe3030f17_intro.pdf · 2017-09-01 · Schedule Week Title Projects 1 Introduction to Linux kernel 0. Environment

Kernel abstraction

• Process, thread

• Virtual memory

• Block device, file

• Frame buffer device

• Socket

Character device

Page 15: Operating System Projects - AndroBenchcsl.skku.edu/uploads/SWE3030F17-41/swe3030f17_intro.pdf · 2017-09-01 · Schedule Week Title Projects 1 Introduction to Linux kernel 0. Environment

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 16: Operating System Projects - AndroBenchcsl.skku.edu/uploads/SWE3030F17-41/swe3030f17_intro.pdf · 2017-09-01 · Schedule Week Title Projects 1 Introduction to Linux kernel 0. Environment

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 17: Operating System Projects - AndroBenchcsl.skku.edu/uploads/SWE3030F17-41/swe3030f17_intro.pdf · 2017-09-01 · Schedule Week Title Projects 1 Introduction to Linux kernel 0. Environment

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)• init : initialization codes (main.c)

Page 18: Operating System Projects - AndroBenchcsl.skku.edu/uploads/SWE3030F17-41/swe3030f17_intro.pdf · 2017-09-01 · Schedule Week Title Projects 1 Introduction to Linux kernel 0. Environment

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