Operating System Three easy pieces Remzi H ArpaciDusseau

  • Slides: 10
Download presentation
Operating System : Three easy pieces Remzi H. Arpaci-Dusseau Andrea C. Arpaci-Dusseau Introduction to

Operating System : Three easy pieces Remzi H. Arpaci-Dusseau Andrea C. Arpaci-Dusseau Introduction to Operating Systems Hoyoon Jun(hoyoonjun@davinci. snu. ac. kr) School of Computer Science and Engineering Seoul National University

Motivation § Why do we need OS? § Imagine a computer which can only

Motivation § Why do we need OS? § Imagine a computer which can only provide followings • Execute a single program at a time • Enables every program to access any memory addresses • Need to provide appropriate instructions if two different program access same variable • Every power failure results loss of data § Programs can accomplish its tasks without help of OS • But without managing system, programmer should deal with problems above by him/herself every time § Primary goal of OS is that making the system easy to use Operating System : Three easy pieces 2

Three Main Features of Operating Systems § Concept based on top-down approach Virtualization CPU

Three Main Features of Operating Systems § Concept based on top-down approach Virtualization CPU Virtualization, Scheduling, Process… Memory Virtualization, Paging, Address Translation… Concurrency Threads, Locks and semaphores, Deadlocks… Persistence File system, I/O Devices, Journaling… Operating System : Three easy pieces 3

Comparing to Other OS Textbooks § Operating system concepts (Silberschatz at el) 9 th

Comparing to Other OS Textbooks § Operating system concepts (Silberschatz at el) 9 th ed. § Von Neumann architecture based on bottom-to-top approach Memory management Memory Control unit Process management Arithmetic logic unit Protection and security Accumulator Input Output Storage management Advanced topics Book cover source: http: //codex. cs. yale. edu/avi/os-book/OS 8/os 8 c/, retrieved 2015/04/20 Operating System : Three easy pieces 4

Virtualizing CPU § Gives illusion that the system has large number of virtual CPUs

Virtualizing CPU § Gives illusion that the system has large number of virtual CPUs § Allows many programs to seemingly run at once § Related to concurrency and resource management § Example: running many programs at once A B D C A C B D…. A B C D Operating System : Three easy pieces AAAA BBBB CCCC DDDD 5

Virtualizing Memory § Gives illusion that each process has its own private virtual address

Virtualizing Memory § Gives illusion that each process has its own private virtual address space § Related to protection and resource sharing • A memory reference within one running program does not affect the address space of other processes Process A Process B p=malloc(sizeof(int)) Address of p Physical memory p’=malloc(sizeof(int)) Address of p’ Operating System : Three easy pieces 6

Concurrency § Concurrent access of shared resources is subtle and error-prone § One need

Concurrency § Concurrent access of shared resources is subtle and error-prone § One need protection, lock or other synchronization methods § Example: concurrent updating of shared counter Process A Load counter Counter 6 6 6 Update counter 7 6 7 7 Store counter Process B 7 7 Load counter 6 Update counter 7 Store counter 7 7 7 Operating System : Three easy pieces 7

Persistence § Needs to support hardware and software to be able to store data

Persistence § Needs to support hardware and software to be able to store data persistently § Use file system to store and manage persistent data § High performance is also important! § Example: journaling file system Source: http: //www. howtogeek. com/howto/33552/htg-explains-which-linux-file-system-should-you-choose, retrieved 2015/04/20 Operating System : Three easy pieces 8

Brief History of Operating Systems § Note that development of OS concepts are provoked

Brief History of Operating Systems § Note that development of OS concepts are provoked by computer’s propagation Libraries Protection Multiprogramming Modern OS Mainframe era Transition era Minicomputer era PC era Set of commonly used functions Concept of OS privilege Multiprogramming Modern OS (Windows, OSX) Batch processing System call Memory protection between processes Human operator Trap handling Concurrency issues Operating System : Three easy pieces Mobile Green computing 9

Summaries § This book is based on three main concepts of operating systems §

Summaries § This book is based on three main concepts of operating systems § The virtualization, a technique which provides illusion of virtual resources • Introduced for the sake of easy-to-use system • CPU virtualization provides illusion of infinite virtual CPUs • Memory virtualization provides illusion of own private & large address space § Concurrency, a technique which manages shared resources in multiprogramming environment • Concept of atomicity, synchronization, and coherency will be introduced § Persistence, a technique for how to deal with persistent data • Files and directories are the building blocks to provide secure & reliable persistent data management • File systems and I/O device managements will be covered Operating System : Three easy pieces 10