Download presentation
Presentation is loading. Please wait.
1
Chapter 1: Introduction
2
Chapter 1: Introduction
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
What is an Operating System? (user view)
OS For ease of use
6
What is an Operating System? (system view)
output CPU data MEM
7
What is an Operating System? (system view)
output CPU data MEM prog1 prog2 prog3 prog4 Control program Resource allocator
8
Computer-system operation (The OS initialization phase)
ROM 1 2 RAM 3
9
Computer-System Organization (after booting)
applications Sys. call signal OS cmd Hardware polling interrupt
10
OS operations I/O devices and the CPU execute concurrently AP1
applications I/O devices and the CPU execute concurrently AP1 AP2 AP2 Sys. call signal OS 1 cmd 4 3 interrupt buffer 2 controller
11
Common Functions of Interrupts (interrupt vector table, IVT)
mem Interrupt transfers control to the interrupt service routine Disable all incoming interrupts (???) Save the CPU status of the interrupted program IDTR 1 2’ ISR 2” IDTR: interrupt descriptor table register
12
Common Functions of Interrupts
applications Software interrupt Sys. call signal OS kernel cmd Hardware polling interrupt Basically, an operating system is interrupt driven. Dual-Mode operation: kernel mode + user mode
13
Interrupt Handling Save the CPU status (including the CPU status register, program counter and some other registers) Interrupt handling depends on the type of interrupt polling vectored interrupt system vectored interrupt system + polling 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
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
compiler OS only large storage media that the CPU can access directly. extension of main memory that provides large nonvolatile storage capacity. 刪掉
20
Performance of Various Levels of Storage
(OS)
21
Cache (Coherency & consistency)
L1 $ L1 $ L2 $ L2 $ bus
22
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
23
Multiprogramming CPU I/O ready CPU ready CPU I/O time
24
Timesharing CPU ready CPU I/O CPU ready CPU ready CPU I/O time
25
Operating-System Operations
applications AP1 AP2 AP2 Sys. call int_ret OS 1 cmd 4 3 interrupt buffer 2 controller
26
Dual-mode operation AP1 applications AP2 AP2 User mode Sys. call
Int_ret Kernel mode OS 1 cmd 4 3 interrupt buffer 2 controller
27
Dual-mode operation applications trap AP2 User mode Kernel mode OS
Syscall_handler ISR CPU Mode=kernel_mode Push PC Save machine status Jump_to ISR Exception := Trap := Software interrupt
28
Dual-mode operation AP1 applications AP2 AP2 User mode Sys. call
Int_ret Kernel mode OS Syscall_handler 1 cmd 4 3 interrupt buffer 2 controller
29
Dual-mode operation applications trap AP2 AP2 User mode Kernel mode OS
Syscall_handler ISR CPU restore machine status Mode=user_mode Pop PC
30
Timer time CPU ready CPU I/O CPU ready CPU ready CPU I/O timer
interrupt time timer
31
OS OS Structure Protec-tion Process manage-ment Memory manage-ment
setuid… SELinux OS Protec-tion Process manage-ment Memory manage-ment Storage manage-ment security passwd… fork… open & close… malloc..
32
Computing Environments (symmetric multiprocessor, SMP)
CPU 0 CPU 1 CPU 2 bus
33
Computing Environments (chip multiprocessor, CMP)
CPU Core 0 Core 1 L1 $ L1 $ L2 $ bus
34
Computing Environments (simultaneously multithreading, SMT)
CPU Core Logical processor 0 Logical processor 1 L1 $ L2 $ bus
35
Computing Environments (CMP+SMT)
CPU Core 0 Core 1 LP0 LP1 LP0 LP1 L1 $ L1 $ L2 $ bus
36
Computing Environments (symmetric multiprocessor, SMP) (UMA)
CPU 0 CMP+SMT CPU 1 CMP+SMT CPU 2 CMP+SMT bus
37
Computing Environments (symmetric multiprocessor, SMP) (NUMA)
CPU 0 CMP+SMT CPU 1 CMP+SMT CPU 2 CMP+SMT bus
38
Embedded systems & web computing
internet WEB apps
39
參考資料 Silberschatz, Galvin and Gagne, “Operating system Principles,” 8th ed Wikipedia,
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.