Download presentation
Presentation is loading. Please wait.
1
Winter 20021 CMPE 155 Week 2
2
Winter 20022 Review? Computers Operating Systems Kernels Distributed Systems
3
Winter 20023 Computer “Hardware”. Processor(s), main memory, disk(s), keyboard, display(s), network interface, other I/O devices.
4
Winter 20024 Multiple Processor Systems (1) “Tightly-coupled” –Shared-memory muliprocessor P …… Shared Memory
5
Winter 20025 Multiple Processor Systems (2) “Less tightly-coupled” –Message-passing multicomputer P …… M P M P M P M
6
Winter 20026 Multiple Processor Systems (3) “Loosely-coupled” –Distributed systems” Network Computer
7
Winter 20027 What is an OS? Machine/resource manager. Physical Devices Microarchitecture Instruction Set Architecture Operating System Compilers, Editors, etc. Hardware Application programs
8
Winter 20028 OS as extended machine… Top-down view. Layer of software that hides hardware. Provides programmer easier instructions. –E.g., read block from file. (Part of) the OS runs in supervisor (privileged) mode: can execute priviledged instructions (e.g., access to physical decices through drivers).
9
Winter 20029 OS as resource manager Bottom-up view. Provides orderly and controlled allocation of resources. Provides (“concurrent”) programs (fair) access to resources (processor, disk, printer). Time (e.g., CPU) and space (e.g., memory) multiplexing.
10
Winter 200210 OS History
11
Winter 200211 First generation: 1945-1955 Vacuum tubes: machines took whole rooms! Machine language programming (plugboard wiring). No OS.
12
Winter 200212 Second generation: 1955-1965 Transistors made computers commercially viable. Builders, operators, users. Mainframes: multimillion dollar machines. Punch cards, input and output tapes. Batch systems.
13
Winter 200213 Third generation: 1965-1980 ICs. Multiprogramming. –Machine shared by “concurrent” programs. –Memory partitions hold multiple jobs. Timesharing. –Multiprogramming still batch processing: scientific computation and commercial data processing. –Cheap terminals: interactive use. –Interactive service + batch processing.
14
Winter 200214 Fourth generation: 1980-… High-scale circuit integration. Computer miniaturization. Mainframes -> minicomputers -> microcomputers or PCs. PC OSs: CP/M, DOS, MS-DOS. GUI-based OSs: UNIX-based, MS Windows-based, MAC OS, …
15
Winter 200215 Modern OSs Mainframe OSs: IBM’s OS/390, DEC’s VMS. Server OSs: Solaris, FreeBSD, etc. PC OS: Linux, MacOS, Windows… Real-time OSs: VxWorks. Embedded OSs: Linux, PalmOS, Windows CE Smart card OSs
16
Winter 200216 Basic OS Concepts
17
Winter 200217 Processes Process: program in execution. –Address space: memory usable by program (text, data, stack). –State: registers. OS uses process table to keep track of processes. Processes can create other (child) processes.
18
Winter 200218 Inter-Process Communication (IPC) Shared memory. –Processes communicate/synchronize through a shared data item. Message passing. –Processes communicate via messages.
19
Winter 200219 Shared Memory Processes must access shared data in a mutual exclusive way. Primitives: –Semaphores: Dijkstra(1965) P(S) and V(S) operations. Atomic (indivisible) operations. –(Conditional) Critical Regions –Monitors
20
Winter 200220 Message Passing Processes communicate/synchronize by sending/receiving messages. Primitives: –Send(message), receive(message). Issues: –Synchronous versus asynchronous. –Reliable versus unreliable.
21
Winter 200221 Distributed Shared Memory Sharing data among computers that don’t share physical memory. DSM provides shared memory abstraction. –Read- and write-like primitives. Needs message passing to convey updates among physically disjoint processing elements.
22
Winter 200222 Deadlocks Shared data/resource may lead to deadlock: processes get “stuck”. Example: v is using r1 and requests r2; w is using r2 and requests r1. vw
23
Winter 200223 Memory Management Share memory among several processes. Monoprogramming: memory sharing between OS and program (embedded OSs). Multiprogramming: multiple processes (partially or totally) in memory. –Swapping. –Virtual memory: paging.
24
Winter 200224 I/O OS I/O subsystem manages I/O devices. –Device-dependent (device drivers) or independent. File system: –File as an abstraction. –Basic operations: create, delete, read, write. Hierarchical file systems. –Dynamically attach tree branches (e.g., mount system call in UNIX). Access control: permissions.
25
Winter 200225 System Calls Interface between OS and user program: set of system calls. –E.g., access a file, create a process, etc. Like making a special procedure call. –System calls executed by kernel. –Calling program pushes parameters onto stack; calls library; library routine (same name as system call) executes TRAP, switching to kernel mode; OS handles call; returns control to library; library returns to user program. Example system calls for file system –open, close, read, write, mkdir, rmdir.
26
Winter 200226 System Calls User-level process Kernel Physical machine System call to access physical resources System call: implemented by hardware interrupt (trap) which puts processor in supervisor mode and kernel address space; executes kernel-supplied handler routine (device driver) executing with interrupts disabled.
27
Winter 200227 Kernels Executes in supervisor mode. –Privilege to access machine’s physical resources. User-level process: executes in “user” mode. –Restricted access to resources. –Address space boundary restrictions.
28
Winter 200228 Kernel Functions Memory management. –Address space allocation. –Memory protection. Process management. –Process creation, deletion. –Scheduling. Resource management. –Device drivers/handlers.
29
Winter 200229 Kernel and Distributed Systems Inter-process communication: RPC, MP, DSM. Distributed (Networked) File systems. Some parts may run as user-level and some as kernel processes.
30
Winter 200230 Be or not to be in the kernel? Monolithic kernels versus microkernels.
31
Winter 200231 Monolithic kernels Examples: Unix, Sprite. “Kernel does it all” approach. Based on argument that inside kernel, processes execute more efficiently and securely. Problems: massive, non-modular, hard to maintain and extend.
32
Winter 200232 Microkernels Take as much out of the kernel as possible. Minimalist approach. Modular and small. –10KBytes -> several hundred Kbytes. –Easier to port, maintain and extend. –No fixed definition of what should be in the kernel. –Typically process management, memory management, IPC. Example: Mach (CMU),
33
Winter 200233 Micro- versus Monolithic Kernels S1S4S3 S4 S1S4S2S3 Monolithic kernel Microkernel Services (file, network). Kernel code and data
34
Winter 200234 Microkernel Application OS Services Microkernel Hardware. Services dynamically loaded at appropriate servers.. Some microkernels run service processes only @ user space; others allow them to be loaded into either kernel or user space.
35
Winter 200235 Extensible Kernels “Extensible” OS. Provides core set of extensible services + extension infrastructure. Extensions: allow applications to specialize the underlying OS to achieve performance and functionality. –Extensions can be loaded into kernel any time. Example: general purpose OS doesn’t provide adequate disk management for database applications.
36
Winter 200236 Extensions Applications can extend OS servers to provide better match for its needs. Goal: build general purpose OS that provides extensibility+safety+performance. Example: UofWashington’s SPIN kernel.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.