operating system organization
DESCRIPTION
Operating System Organization. 3. Purpose of an OS. Coordinate Use of the Abstractions. Processes. The Abstractions. Create the Abstractions. OS Requirements. Provide resource abstractions Process abstraction of CPU/memory use Address space - PowerPoint PPT PresentationTRANSCRIPT
Operating Systems: A Modern Perspective, Chapter 3
Slide 3-1
Copyright © 2004 Pearson Education, Inc.
Operating Systems: A Modern Perspective, Chapter 3
Slide 3-2
Copyright © 2004 Pearson Education, Inc.
3Operating SystemOrganization
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
…
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
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
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