Operating System Organization
-
Upload
moses-barton -
Category
Documents
-
view
37 -
download
2
description
Transcript of Operating System Organization
![Page 1: Operating System Organization](https://reader030.fdocuments.net/reader030/viewer/2022032805/56813323550346895d9a030a/html5/thumbnails/1.jpg)
Operating Systems: A Modern Perspective, Chapter 3
Slide 3-1
Copyright © 2004 Pearson Education, Inc.
![Page 2: Operating System Organization](https://reader030.fdocuments.net/reader030/viewer/2022032805/56813323550346895d9a030a/html5/thumbnails/2.jpg)
Operating Systems: A Modern Perspective, Chapter 3
Slide 3-2
Copyright © 2004 Pearson Education, Inc.
3Operating SystemOrganization
![Page 3: Operating System Organization](https://reader030.fdocuments.net/reader030/viewer/2022032805/56813323550346895d9a030a/html5/thumbnails/3.jpg)
Operating Systems: A Modern Perspective, Chapter 3
Slide 3-3
Copyright © 2004 Pearson Education, Inc.
Purpose of an OS
The Abstractions
Create the Abstractions
Coordinate Useof the AbstractionsProcesses
![Page 4: Operating System Organization](https://reader030.fdocuments.net/reader030/viewer/2022032805/56813323550346895d9a030a/html5/thumbnails/4.jpg)
Operating Systems: A Modern Perspective, Chapter 3
Slide 3-4
Copyright © 2004 Pearson Education, Inc.
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
![Page 5: Operating System Organization](https://reader030.fdocuments.net/reader030/viewer/2022032805/56813323550346895d9a030a/html5/thumbnails/5.jpg)
Operating Systems: A Modern Perspective, Chapter 3
Slide 3-5
Copyright © 2004 Pearson Education, Inc.
DOS -- Resource Abstraction Only
Processor(s) Main Memory Devices
ProgramProgram
ProgramProgram
ProgramProgram
OS ServicesOS Services
LibrariesLibraries
ROM RoutinesROM Routines
![Page 6: Operating System Organization](https://reader030.fdocuments.net/reader030/viewer/2022032805/56813323550346895d9a030a/html5/thumbnails/6.jpg)
Operating Systems: A Modern Perspective, Chapter 3
Slide 3-6
Copyright © 2004 Pearson Education, Inc.
OS Requirements (cont)
• Provide resource abstractions
• Manage resource sharing– Time/space-multiplexing– Exclusive use of a resource– Isolation– Managed sharing
![Page 7: Operating System Organization](https://reader030.fdocuments.net/reader030/viewer/2022032805/56813323550346895d9a030a/html5/thumbnails/7.jpg)
Operating Systems: A Modern Perspective, Chapter 3
Slide 3-7
Copyright © 2004 Pearson Education, Inc.
Abstraction & Sharing
Processor(s) Main Memory Devices
LibrariesLibraries
ROM RoutinesROM Routines
ProgramProgramStateState
Process
ProgramProgramStateState
Process
ProgramProgramStateState
Process
OS Services • Abstraction• Manage sharing
![Page 8: Operating System Organization](https://reader030.fdocuments.net/reader030/viewer/2022032805/56813323550346895d9a030a/html5/thumbnails/8.jpg)
Operating Systems: A Modern Perspective, Chapter 3
Slide 3-8
Copyright © 2004 Pearson Education, Inc.
OS Design Constraints
• Performance
• Protection and security
• Correctness
• Maintainability
• Commercial factors
• Standards and open systems
![Page 9: Operating System Organization](https://reader030.fdocuments.net/reader030/viewer/2022032805/56813323550346895d9a030a/html5/thumbnails/9.jpg)
Operating Systems: A Modern Perspective, Chapter 3
Slide 3-9
Copyright © 2004 Pearson Education, Inc.
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
![Page 10: Operating System Organization](https://reader030.fdocuments.net/reader030/viewer/2022032805/56813323550346895d9a030a/html5/thumbnails/10.jpg)
Operating Systems: A Modern Perspective, Chapter 3
Slide 3-10
Copyright © 2004 Pearson Education, Inc.
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
![Page 11: Operating System Organization](https://reader030.fdocuments.net/reader030/viewer/2022032805/56813323550346895d9a030a/html5/thumbnails/11.jpg)
Operating Systems: A Modern Perspective, Chapter 3
Slide 3-11
Copyright © 2004 Pearson Education, Inc.
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
![Page 12: Operating System Organization](https://reader030.fdocuments.net/reader030/viewer/2022032805/56813323550346895d9a030a/html5/thumbnails/12.jpg)
Operating Systems: A Modern Perspective, Chapter 3
Slide 3-12
Copyright © 2004 Pearson Education, Inc.
Device Management
Device-IndependentPart
Device-IndependentPart
Device-DependentPart
Device-DependentPart
Device …Device Device
Device-DependentPart
Device-DependentPart
Device-DependentPart
Device-DependentPart
![Page 13: Operating System Organization](https://reader030.fdocuments.net/reader030/viewer/2022032805/56813323550346895d9a030a/html5/thumbnails/13.jpg)
Operating Systems: A Modern Perspective, Chapter 3
Slide 3-13
Copyright © 2004 Pearson Education, Inc.
Process, Thread, and Resource Management
…Processor
PrimaryMemory
AbstractResources
MultiprogrammingMultiprogramming
ThreadAbstraction
ThreadAbstraction
ProcessAbstraction
ProcessAbstraction Generic
ResourceManager
GenericResourceManager
OtherOther
![Page 14: Operating System Organization](https://reader030.fdocuments.net/reader030/viewer/2022032805/56813323550346895d9a030a/html5/thumbnails/14.jpg)
Operating Systems: A Modern Perspective, Chapter 3
Slide 3-14
Copyright © 2004 Pearson Education, Inc.
Memory Management
PrimaryMemory
ProcessManager
ProcessManager
BlockAllocation
BlockAllocation
VirtualMemory
VirtualMemory
Isolation &Sharing
Isolation &Sharing
StorageDevices
![Page 15: Operating System Organization](https://reader030.fdocuments.net/reader030/viewer/2022032805/56813323550346895d9a030a/html5/thumbnails/15.jpg)
Operating Systems: A Modern Perspective, Chapter 3
Slide 3-15
Copyright © 2004 Pearson Education, Inc.
Exclusive Access to a Resource
Process AProcess A
SupervisorProgram
SupervisorProgram
A’s ProtectedObject
A’s ProtectedObject
Processor
Process BProcess B
![Page 16: Operating System Organization](https://reader030.fdocuments.net/reader030/viewer/2022032805/56813323550346895d9a030a/html5/thumbnails/16.jpg)
Operating Systems: A Modern Perspective, Chapter 3
Slide 3-16
Copyright © 2004 Pearson Education, Inc.
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
![Page 17: Operating System Organization](https://reader030.fdocuments.net/reader030/viewer/2022032805/56813323550346895d9a030a/html5/thumbnails/17.jpg)
Operating Systems: A Modern Perspective, Chapter 3
Slide 3-17
Copyright © 2004 Pearson Education, Inc.
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
![Page 18: Operating System Organization](https://reader030.fdocuments.net/reader030/viewer/2022032805/56813323550346895d9a030a/html5/thumbnails/18.jpg)
Operating Systems: A Modern Perspective, Chapter 3
Slide 3-18
Copyright © 2004 Pearson Education, Inc.
Supervisor and User Memory
UserSpace
UserSpace
SupervisorSpace
SupervisorSpace
UserProcess
UserProcess
SupervisorProcess
SupervisorProcess
![Page 19: Operating System Organization](https://reader030.fdocuments.net/reader030/viewer/2022032805/56813323550346895d9a030a/html5/thumbnails/19.jpg)
Operating Systems: A Modern Perspective, Chapter 3
Slide 3-19
Copyright © 2004 Pearson Education, Inc.
Procedure Call and Message Passing Operating Systems
call(…);
trap
return;
send(…, A, …);receive(…, B, …);
receive(…A, …); …send(…, B, …);
send/receive
![Page 20: Operating System Organization](https://reader030.fdocuments.net/reader030/viewer/2022032805/56813323550346895d9a030a/html5/thumbnails/20.jpg)
Operating Systems: A Modern Perspective, Chapter 3
Slide 3-20
Copyright © 2004 Pearson Education, Inc.
System Call Using the trap Instruction
…fork();…
fork() {…trap N_SYS_FORK()…}
sys_fork()
sys_fork() {/* system function */ … return;}
KernelTrap Table
![Page 21: Operating System Organization](https://reader030.fdocuments.net/reader030/viewer/2022032805/56813323550346895d9a030a/html5/thumbnails/21.jpg)
Operating Systems: A Modern Perspective, Chapter 3
Slide 3-21
Copyright © 2004 Pearson Education, Inc.
A Thread Performing a System Call
User Space Kernel Space
fork();
sys_fork() {
}
Thread
![Page 22: Operating System Organization](https://reader030.fdocuments.net/reader030/viewer/2022032805/56813323550346895d9a030a/html5/thumbnails/22.jpg)
Operating Systems: A Modern Perspective, Chapter 3
Slide 3-22
Copyright © 2004 Pearson Education, Inc.
Basic Operating System Organization
Processor(s) Main Memory Devices
Process, Thread &Resource Manager
MemoryManager
DeviceManager
FileManager
![Page 23: Operating System Organization](https://reader030.fdocuments.net/reader030/viewer/2022032805/56813323550346895d9a030a/html5/thumbnails/23.jpg)
Operating Systems: A Modern Perspective, Chapter 3
Slide 3-23
Copyright © 2004 Pearson Education, Inc.
LibrariesLibraries CommandsCommands
Device DriverDevice Driver
The UNIX ArchitectureInteractive User
ApplicationPrograms
ApplicationPrograms
OS System Call Interface
Device DriverDevice Driver
Device DriverDevice Driver
Dri
ver
Inte
rfac
eD
rive
r In
terf
ace
…Monolithic Kernel Module•Process Management•Memory Management•File Management•Device Mgmt Infrastructure
Trap Table
…
![Page 24: Operating System Organization](https://reader030.fdocuments.net/reader030/viewer/2022032805/56813323550346895d9a030a/html5/thumbnails/24.jpg)
Operating Systems: A Modern Perspective, Chapter 3
Slide 3-24
Copyright © 2004 Pearson Education, Inc.
Microkernel Organization
Device DriversDevice DriversMicrokernelMicrokernel
Processor(s) Main Memory Devices
LibrariesLibraries
ProcessProcess
ProcessProcess
ProcessProcess
ServerServer ServerServer ServerServer
User
Supervisor
![Page 25: Operating System Organization](https://reader030.fdocuments.net/reader030/viewer/2022032805/56813323550346895d9a030a/html5/thumbnails/25.jpg)
Operating Systems: A Modern Perspective, Chapter 3
Slide 3-25
Copyright © 2004 Pearson Education, Inc.
Windows NT Organization
Processor(s) Main Memory Devices
LibrariesLibraries
ProcessProcess
ProcessProcess
ProcessProcess
SubsystemSubsystemUser
Supervisor
SubsystemSubsystem SubsystemSubsystem
Hardware Abstraction LayerHardware Abstraction LayerNT Kernel
NT ExecutiveI/O SubsystemI/O Subsystem
TT
TT
TT T T
T
Process ManagementMemory ManagementFile ManagementDevice Mgmt Infrastructure
![Page 26: Operating System Organization](https://reader030.fdocuments.net/reader030/viewer/2022032805/56813323550346895d9a030a/html5/thumbnails/26.jpg)
Operating Systems: A Modern Perspective, Chapter 3
Slide 3-26
Copyright © 2004 Pearson Education, Inc.
Monitoring the Kernel
Processor(s) Main Memory Devices
LibrariesLibraries
ProcessProcess
ProcessProcess
ProcessProcess
SubsystemSubsystem SubsystemSubsystem SubsystemSubsystem
Hardware Abstraction LayerHardware Abstraction LayerNT Kernel
NT ExecutiveI/O SubsystemI/O Subsystem
TT
TT
TT T T
TTaskManager
pview
pstat
Supervisor
User