Please enable JavaScript.
Coggle requires JavaScript to display documents.
Operating System (Chapter 3 (Memory Management: Virtual Memory Systems)…
Operating System
Chapter 3 (Memory Management: Virtual Memory Systems)
Paged
Divided into pages of equal size (program memory noncontiguous)
Adv: Efficient memory use: no external fragmentation
Disadv: Keep track of job's pages (high OS overhead), internal fragmentation
Demand Paging
Swapping
Loads only part of the program into memory
Requires high speed secondary storage
Page replacement policy algorithms
First-in first-out (FIFO)
Least Recently Used (LRU)
Segmented
Divides jobs into segments (different sizes)
Adv: Reduced page faults
Disadv: External fragmentation
Segmented/Demand Paging
Subdivides segments: equal-sized pages
Adv: Segmentation problems removed
Disadv: Overhead & Time
Chapter 1 (Introducing OS)
Essential Components of OS
Memory Manager
RAM
Reallocating memory
Deallocating memory
Volatile
ROM
Non-volatile
Holds firmware
Processor Manager
In charge of allocating CPU
"Traffic controller" for processes
Multiple CPUs, more complex management
Device Manager
Connecting with every available devices
Identify each device uniquely
Start device opeation (when appropriate)
Monitor device progress
File Manager
Track every file in the system
Access restrictions
Allocate space
Retrieve files efficiently
(Extra) Network Manager
Authorise users to share resources
User Interface
Graphical user interface (GUI)
Command line interface (CLI)
Direct interaction with users
Cooperation Issues
Every element of OS performs individual task and harmoniously interacts with other managers
Chapter 2 (Memory Management: Simple Systems)
Types of memory allocation schemes
Single-user systems (Multiprogramming not allowed)
Fixed partitions
Dynamic partitions (Unlike Fixed partition)
Relocatable dynamic partitions (Smarter Dynamic)
Bounds register
(Stores highest location for program)
Relocation register
(Contains adjustment value)
Method of allocation
Best-Fit
Best use of memory space
Slower allocation
First-Fit
Faster allocation
Memory waste
External and Internal fragmentation
Internal fragmentation: memory of program > every free memory space
Chapter 5 (Process Management)
Deadlock
Eg. 2 processes waiting for each other, while each have the resource occupied by opponent
Results in both processes stop working
Conditions:
Mutual exclusion (Resources involved are
unshareable
)
Resource holding (Process
holds resource
while waiting)
No pre-emption (Resources
can't taken away
while being used)
Circular wait (Chain of
waiting
)
Handling Deadlocks
Prevention: prevent the conditions
Avoidance: avoid if it becomes probable
Detection
Recovery
Starvation
A process has to
wait for free resource
Like: 4 persons want to use 3 taps, there is 1 people need to wait for available tap
Results in job execution prevented in a process
Prevention
Implement algorithm to track each job's waiting time (aging)
Block new jobs until starving jobs satisfied
Livelock
Deadlock can be solved by system watchdog
Watchdog gives timeout for deadlock and reset the resources
The same situation
repeated
after reset is called livelock
Chapter 6 (Concurrent Processes)
Parallel Processing (The computation)
Multiple processors
operate in a system concurrently
Increased
reliability
: if one processor fails, others take over
Faster
processing: multiple instructions being carried concurrently
Challenges
Connecting processors
into configurations
Orchestrating
processor interaction
Multiprocessing (The use multiple CPUs)
Levels
Process level
Thread level
Job level
Configurations
Master/Slave
Master processor
manages entire system
Slave processors
can directly access the main memory
But all I/O request must send through master processor
Simple, but poor system reliability
Loosely coupled
Each processor do their own work and has own resource
Fault tolerance, but difficult to detect if one fails
Symmetric
Decentralised
processor scheduling
More reliable and efficient than Loosely coupled
Most difficult to implement (avoid starvation and deadlocks)
Process syncronisation
needed for
handling starvation and deadlock
Algorithm implemented
inside critical part of program
Types of locking mechanisms
Test-and-set
WAIT and SIGNAL
Semaphores
Processor Management
Types of system
Simple system
Multiprogramming environment
Processor Manager
Job Scheduler
Selects incoming job from queue
Places in process queue
Decides on job initiation criteria
Process Scheduler
Determines job to get CPU resource
Decides interrupt processing
determines queues for job movement during execution
Determines job termination