Operating System
Defintion & Features
A collection of programs that provide an interface between the user & computer, enable the user to communicate with the computer & perform tasks involving the management of memory & resources.
- Memory management
- File management
- Utility software
- Security
- User interface
Paging
When memory is split up into equal-sized sections known as pages (4k bytes) 🟩 🟩 🟩 🟩 . These can then be swapped between main memory & the hard disk as needed.
Segmentation
Memory split into logical sized divisions, known as segments, which vary in size ⬛️ ◼️◾️▪️. These represent the structure & logical flow of the program.
Virtual Memory
Section of the hard drive acts as RAM when the space in main memory is insufficient to store programs being used. Sections of programs not currently being used are temporarily moved into virtual memory through paging, freeing up memory for other programs in RAM.
- Caues ‘disk thrashing’, computer ‘freezes’ due to pages being swapped too frequently between the hard disk and main
memory. Becomes worse as virtual memory is filled up.
Interrupts
Interrupt Service Routine
Scheduling
What is Scheduling & Types
The operating system ensures all sections of programs being run (known as ‘jobs’) receive a fair amount of processing time. Done through various scheduling algorithms,
Either:
- Pre-emptive: Jobs are actively made to start and stop by the operating system. (E.g SRT, RR)
- Non pre-emptive: Once a job is started, it is left alone until it is completed. (E.g FCFS, SJF)
Scheduling Algorithms
Round Robin: Jobs are given time slices for execution, repeating until completion.
- Advantages: All jobs eventually get processed.
- Disadvantages: Inefficient for longer jobs, no consideration for priority.
First Come First Served: Jobs processed in order of entry.
- Advantages: Simple implementation.
- Disadvantages: No consideration for priority or urgency.
Multilevel Feedback Queues: Uses multiple queues with different priorities.
- Advantages: Considers job priorities.
- Disadvantages: Complex to implement.
Shortest Job First: Queue ordered by total job completion time.
- Advantages: Reduces waiting time in batch systems.
- Disadvantages: Requires estimating job duration, potential processor starvation, no priority consideration.
Shortest Remaining Time: Queue ordered by time left for job completion.
- Advantages: Increases throughput for shorter jobs.
- Disadvantages: No priority consideration, potential processor starvation with continuous short jobs.
Types of Operating Systems
BIOS
Basic input output System
Device Drivers
Virtual Machine
Intermediate Code