Presentation is loading. Please wait.

Presentation is loading. Please wait.

Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3.

Similar presentations


Presentation on theme: "Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3."— Presentation transcript:

1 Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3

2 Slide 3-2 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 3 Operating System Organization

3 Slide 3-3 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Operating System Structures OS Design Constraints OS Basic Functions OS Structures

4 Slide 3-4 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Purpose of an OS The Abstractions Create the Abstractions Coordinate Use of the Abstractions Processes

5 Slide 3-5 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 OS Requirements Provide resource abstractions –Process abstraction of CPU/memory use Address space Thread abstraction of CPU within address space –Resource abstraction “Anything a process can request that can block the process if it is unavailable” NT uses “object abstraction” to reference resources –File abstraction of secondary storage use

6 Slide 3-6 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 DOS -- Resource Abstraction Only Processor(s)Main MemoryDevices Program OS Services Libraries ROM Routines

7 Slide 3-7 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 OS Requirements (cont) Provide resource abstractions Manage resource sharing –Time/space-multiplexing –Exclusive use of a resource –Isolation –Managed sharing

8 Slide 3-8 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Abstraction & Sharing Processor(s)Main MemoryDevices Libraries ROM Routines Program State Process Program State Process Program State Process OS Services Abstraction Manage sharing

9 Slide 3-9 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 OS Design Constraints Performance Protection and security Correctness Maintainability Commercial factors Standards and open systems

10 Slide 3-10 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Performance The OS is an overhead function  should not use too much of machine’s resources Minimum functionality is to implement abstractions Additional function must be traded off against performance –DOS: one process –UNIX: low level file system

11 Slide 3-11 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Protection & Security Multiprogramming  resource sharing Therefore, need software-controlled resource isolation Security policy: Sharing strategy chosen by computer’s owner Protection mechanism: Tool to implement a family of security policies

12 Slide 3-12 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Correctness & Maintainability Security depends on correct operation of software  trusted vs untrusted software Maintainability relates to ability of software to be changed If either is sufficiently important, can limit the function of the OS –Guiding a manned spaceship –Managing a nuclear reactor

13 Slide 3-13 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 OS Basic Functions Device management Process & resource management Memory Management File Management

14 Slide 3-14 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Device Management Device-Independent Part Device-Independent Part Device-Dependent Part Device-Dependent Part Device … Device-Dependent Part Device-Dependent Part Device-Dependent Part Device-Dependent Part

15 Slide 3-15 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Device Management OS Manages the allocation, sharing and isolation of I/O devices (disks, tapes, terminals, etc.) Most Operating Systems treat all devices in the same general manner –UNIX treats them all like files Chapters 4 & 5 discuss Device Management

16 Slide 3-16 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Process, Thread, and Resource Management … Processor Primary Memory Abstract Resources Multiprogramming Thread Abstraction Thread Abstraction Process Abstraction Process Abstraction Generic Resource Manager Generic Resource Manager Other

17 Slide 3-17 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Process & Resource Management A process is the basic unit of computation Resources are the elements needed by a process so that it can execute –CPU, Memory, I/O devices, data etc. OS provides a set of process management mechanisms: for process creation, blocking, resumption, termination,etc

18 Slide 3-18 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Process & Resource Management OS manages computer resources so that multiple processes can execute simultaneously –CPU scheduling –resource allocation, sharing & process synchronization Chapters 6 - 10

19 Slide 3-19 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Memory Management Primary Memory Process Manager Process Manager Block Allocation Block Allocation Virtual Memory Virtual Memory Isolation & Sharing Isolation & Sharing Storage Devices

20 Slide 3-20 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Memory Management Allocation and use of the primary memory resource –memory allocation among competing processes –enforce memory isolation and sharing Most modern OS support virtual memory. –Virtual memory allows processes to access data in secondary storage as if it were in main memory. Chapters 11&12

21 Slide 3-21 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 File Management Information that need to be saved "permanently" must be stored in a secondary storage device e.g. a disk, tape, etc. Files are an abstraction of secondary storage devices File manager is responsible for –managing the file system: file & directory creation and manipulation –mapping files into physical storage devices

22 Slide 3-22 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Exclusive Access to a Resource Process A Supervisor Program Supervisor Program A’s Protected Object A’s Protected Object Processor Process B

23 Slide 3-23 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Processor Modes Mode bit: Supervisor or User mode Supervisor mode –Can execute all machine instructions –Can reference all memory locations User mode –Can only execute a subset of instructions –Can only reference a subset of memory locations

24 Slide 3-24 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Supervisor and User Memory User Space User Space Supervisor Space Supervisor Space User Process User Process Supervisor Process Supervisor Process

25 Slide 3-25 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Kernels The part of the OS critical to correct operation (trusted software) Executes in supervisor mode The trap instruction is used to switch from user to supervisor mode, entering the OS

26 Slide 3-26 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Procedure Call and Message Passing Operating Systems call(…); trap return; send(…, A, …); receive(…, B, …); receive(…A, …); … send(…, B, …); send/receive

27 Slide 3-27 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 System Call Using the trap Instruction … fork(); … fork() { … trapN_SYS_FORK() … } sys_fork() sys_fork() { /* system function */ … return; } Kernel Trap Table

28 Slide 3-28 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 A Thread Performing a System Call User SpaceKernel Space fork(); sys_fork() { } Thread

29 Slide 3-29 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Basic Operating System Organization Processor(s)Main MemoryDevices Process, Thread & Resource Manager Memory Manager Device Manager File Manager

30 Slide 3-30 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 OS Structures-Simple Approach MS-DOS - written to provide the most functionality in the least space –not divided into modules –Although MS-DOS has some structures, its interfaces and levels of functionality are not well separated. application programs are able to access BIOS routines directly (bypassing DOS).

31 Slide 3-31 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 OS Structures--UNIX UNIX -- modular UNIX consists of two separate parts: –System programs (Shells and commands, compilers and interpreters, system libraries) –The kernel: part of OS that is most critical to its correct operation (trusted) provides CPU scheduling, memory management, file management, and other operating system functions.

32 Slide 3-32 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Libraries Commands Device Driver The UNIX Architecture Interactive User Application Programs Application Programs OS System Call Interface Device Driver Driver Interface … Monolithic Kernel Module Process Management Memory Management File Management Device Mgmt Infrastructure Trap Table …

33 Slide 3-33 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Microkernel Organization Device Drivers Microkernel Processor(s)Main MemoryDevices Libraries Process Server User Supervisor

34 Slide 3-34 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Linux A contemporary, open source implementation of UNIX, introduced in 1991 (Linus Trovalds) A universal system: timesharing OS, personal computer and workstations OS, embedded systems OS, SCC (small communicating computers) OS, network OS Today’s Linux distribution includes the OS and a spectrum of supplementary tools, written by many different contributors Originally implemented for Intel 80386/80486/80586 (x86 or i386), now for DEC/Compaq/HP Alpha, Sun Sparc, Motorola 68K, MIPS, Power PC Monolithic kernel, supports dynamically installable modules

35 Slide 3-35 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Windows NT Organization Processor(s)Main MemoryDevices Libraries Process Subsystem User Supervisor Subsystem Hardware Abstraction Layer NT Kernel NT Executive I/O Subsystem T T T T T T TT T Process Management Memory Management File Management Device Mgmt Infrastructure

36 Slide 3-36 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Monitoring the Kernel Processor(s)Main MemoryDevices Libraries Process Subsystem Hardware Abstraction Layer NT Kernel NT Executive I/O Subsystem T T T T T T TT T Task Manager pview pstat Supervisor User


Download ppt "Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3."

Similar presentations


Ads by Google