Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 1: Introduction. What Operating Systems Do Computer-System Organization Operating-System Structure Operating-System functionalities Process Management.

Similar presentations


Presentation on theme: "Chapter 1: Introduction. What Operating Systems Do Computer-System Organization Operating-System Structure Operating-System functionalities Process Management."— Presentation transcript:

1 Chapter 1: Introduction

2 What Operating Systems Do Computer-System Organization Operating-System Structure Operating-System functionalities Process Management Memory Management Storage Management Protection and Security Computing Environments

3 Objectives To understand the computer system organization To understand the major operating system components

4 What is an Operating System? (user view) ? ? ?

5 OS #&*…%$ #@ For ease of use

6 What is an Operating System? (system view) CPU MEM data output

7 What is an Operating System? (system view) CPU MEM data output prog1 prog2 prog3 prog4 Resource allocator Control program

8 Computer-system operation (The OS initialization phase) ROM RAM 1 2 3

9 Computer-System Organization (after booting) OS Hardware applications Sys. call signal cmd interrupt polling

10 OS operations OS applications Sys. call return cmd controller buffer 1 2 3 4 interrupt AP1 AP2 I/O devices and the CPU execute concurrently

11 Common Functions of Interrupts (interrupt vector table, IVT) mem IDTR IDTR: interrupt descriptor table register ISR 1.Interrupt transfers control to the interrupt service routine 2.Disable all incoming interrupts (why?) 3.Save the CPU status of the interrupted program 1 2’ 2”

12 Common Functions of Interrupts OS kernel Hardware applications Sys. call signal cmd interrupt Software interrupt Basically, an operating system is interrupt driven. Dual-Mode operation: kernel mode + user mode polling

13 Interrupt Handling 1.Save the CPU status (including the CPU status register, program counter and some other registers) 2.Interrupt handling depends on the type of interrupt – polling – vectored interrupt system – vectored interrupt system + polling 3.Execute the interrupt service routine.

14 Direct Memory Access Structure (DMA) bus

15 Direct Memory Access Structure (DMA) cache bus

16 Two I/O Methods After I/O starts, control returns to user program only upon I/O completion. – Synchronous I/O – Cons:??? – Pros:??? After I/O starts, control returns to user program without waiting for I/O completion. – Asynchronous I/O – Cons:??? – Pros:???

17 Two I/O Methods Synchronous Asynchronous

18 Storage Hierarchy Storage systems organized in hierarchy. – Speed – Cost – Volatility Caching – a temporary storage area where frequently accessed data can be stored for rapid access. – Register: main memory – Cache memory: main memory – Main memory: disk

19 Storage-Device Hierarchy only large storage media that the CPU can access directly. extension of main memory that provides large nonvolatile storage capacity. compiler OS 刪掉

20 Performance of Various Levels of Storage

21 Cache (Coherency & consistency) L1 $ bus L1 $ a=2 a=3 a=0 for (i=0..3) { a=a+1; }

22 Cache (Coherency & consistency) L1 $ bus L1 $ a=2 a=3 a=0 for (i=0..3) { a=a+1; } coherency consistency

23 Operating System Structure Multiprogramming needed for efficiency Server When CPU has to wait (for I/O for example), OS switches to another program Timesharing (multitasking) creates interactive computing Personal computer + programs exhaust their time slice

24 Multiprogramming CPUI/OCPUready CPUI/O ready time

25 Time sharing CPUI/OCPUready I/O ready time CPU ready

26 Operating-System Operations OS applications Sys. call controller buffer interrupt AP2

27 Dual-mode operation (system call) OS applications Sys. call AP2 User mode Kernel mode

28 Dual-mode operation OS applications AP2 User mode Kernel mode trap ISR Syscall_handler Exception := Trap := Software interrupt Exception := Trap := Software interrupt 1.Mode=kernel_mode Push PC 1.Save machine status 2.Jump_to ISR 1.Mode=kernel_mode Push PC 1.Save machine status 2.Jump_to ISR CPU

29 Dual-mode operation OS applications Sys. call controller buffer 2 3 4 interrupt AP1 AP2 User mode Kernel mode Syscall_handler cmd 1

30 Dual-mode operation OS applications AP2 User mode Kernel mode trap ISR Syscall_handler 1.restore machine status 2.Mode=user_mode Pop PC 1.restore machine status 2.Mode=user_mode Pop PC CPU AP2

31 Timer CPUI/OCPUready I/O ready time CPU ready timer interrupt

32 OS Structure OS Protec- tion Process manage- ment Memory manage- ment Storage manage- ment security fork… malloc.. open & close… setuid… SELinux passwd …

33 Computing Environments (symmetric multiprocessor, SMP) bus CPU 1 CPU 2 CPU 0

34 CPU Computing Environments (chip multiprocessor, CMP) L1 $ bus L1 $ L2 $ Core 1 Core 0

35 CPU Computing Environments (simultaneously multithreading, SMT) bus L1 $ L2 $ Core Logical processor 0 Logical processor 1

36 CPU Computing Environments (CMP+SMT) L1 $ bus L1 $ L2 $ Core 1 Core 0 LP0 LP1 LP0 LP1

37 Computing Environments (symmetric multiprocessor, SMP) (UMA) bus CPU 1 CMP+SMT CPU 1 CMP+SMT CPU 2 CMP+SMT CPU 2 CMP+SMT CPU 0 CMP+SMT CPU 0 CMP+SMT

38 Computing Environments (symmetric multiprocessor, SMP) (NUMA) bus CPU 1 CMP+SMT CPU 1 CMP+SMT CPU 2 CMP+SMT CPU 2 CMP+SMT CPU 0 CMP+SMT CPU 0 CMP+SMT

39 Embedded systems & web computing internet WEB apps

40 參考資料 Silberschatz, Galvin and Gagne, “Operating system Principles,” 8 th ed Wikipedia, http://www.wikipedia.org/


Download ppt "Chapter 1: Introduction. What Operating Systems Do Computer-System Organization Operating-System Structure Operating-System functionalities Process Management."

Similar presentations


Ads by Google