Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 2 Introduction to OS Chien-Chung Shen CIS, UD

Similar presentations


Presentation on theme: "Chapter 2 Introduction to OS Chien-Chung Shen CIS, UD"— Presentation transcript:

1 Chapter 2 Introduction to OS Chien-Chung Shen CIS, UD cshen@cis.udel.edu

2 Operating System Goal: make the system easy to use (or run programs) –run many programs at the same time –allow programs to share memory –enable programs to interact with devices –etc. How: virtualization – take a physical resource (e.g., processor, memory, or disk) and transform it into a more general, powerful, and easy-to-use virtual form of itself –refer OS as a virtual machine

3 Virtual Machine (VM) To allow users to tell OS what to do and thus make use of the features of VM (e.g., run programs, allocate memory, access files), OS provide interfaces (APIs) that can be called –system calls and standard library OS as resource manager –virtualization –concurrency –persistency

4 Virtualization How to virtualize resources? –policies and mechanisms Virtualize CPU –cpu.c and common.h –./cpu A & ;./cpu B &;./cpu C & Virtualize memory –mem.c (with address-space randomization disabled)

5 Concurrency Working on many things at once (concurrently) in the same program –OS itself –multithreaded programs –threads.v0.c (race condition) –threads.v1.c (atomic)

6 Persistence DRAM is volatile Disk (hard drive) and solid-state drive (SSD) File system (the part of OS that manages disk/SSD and files) io.c Sharing of disks

7 Design Goals of OS Build abstraction Provide high performance and minimize OS overhead Provide protection between applications via isolation Reliability Energy efficiency Security Mobility

8 System Calls User applications run in user mode which means hardware restricts what applications can do (e.g., I/O requests) A system call transfers control (i.e., jumps) into the OS while simultaneously raising the hardware privilege level (kernel mode) When a system call is initiated (via special hardware instruction trap), hardware transfers control to a prespecified trap handler (that OS set up previously) and simultaneously raises the privilege level to kernel mode When OS is done servicing the request, it passes control back to the user via a special return-from-trap instruction, which reverts to user mode while simultaneously passing control back to where the application left off


Download ppt "Chapter 2 Introduction to OS Chien-Chung Shen CIS, UD"

Similar presentations


Ads by Google