CS-150 Operating Systems – Vocabulary Flashcards
Operating System Basics
- Operating System (OS): core system software managing hardware & providing user/application interface.
- Application software ⟂ System software (OS + utilities).
Key Roles / Services
- Resource management: CPU, memory, I/O, files.
- User interface (CLI/GUI).
- Program execution & process control.
- Security, authentication, access control.
- Error detection, accounting, part of booting.
OS Types
- Single‐tasking vs multi‐tasking.
- Single‐user vs multi‐user.
- Distributed, Embedded, Real-time.
Process Management
- Process = program in execution.
- OS tracks processes via Process Control Block (PCB): \text{PC},\;\text{registers},\;\text{state},\;\text{priority},\;\text{memory info},\;\text{accounting}.
- States: New → Ready → Running → (Blocked/Suspended) → Terminated.
- Creation: by OS (services) or parent (child processes).
- Termination triggers: normal exit, user log-off, error, parent/OS shutdown.
- Suspension: waiting for resource, debugging, periodic tasks, resource reallocation.
- Context switch (expensive): save current registers to PCB, load next PCB.
CPU Scheduling
- Goal: select ready process for CPU.
- Non-pre-emptive: running process yields CPU.
- Pre-emptive: OS can forcibly switch.
Algorithms
- First-Come First-Served (FCFS).
- Shortest Job Next (SJN) – optimal but needs future knowledge.
- Round Robin – time slice q (e.g., 100 ms).
Evaluation Metrics
- Turnaround time =\text{finish} - \text{arrival}.
- % Delay =\dfrac{\text{turnaround} - \text{service}}{\text{service}} \times 100.
- Processor utilisation = \dfrac{\text{CPU busy time}}{\text{total time}} \times 100.
Memory Management
- Logical address: offset within process space.
- Physical address: actual RAM location.
- OS duties: isolation, allocation/deallocation, protection, long-term storage.
Single Contiguous
- Only OS + one user program; simple, used in tiny embedded systems.
- Address binding: physical = \text{base} + \text{logical}.
Partition Memory Management
- Multiple concurrent processes + OS.
Schemes
- Fixed partitions: pre-set sizes.
- Dynamic partitions: created on demand.
Registers
- Base: start address of current partition.
- Limit: length of current partition.
Allocation Algorithms (fixed)
- Best Fit – smallest sufficient hole.
- First Fit – first sufficient hole.
- Next Fit – continue search from last placement.
- Worst Fit – largest hole (mainly dynamic).
Fragmentation
- Internal: unused space inside allocated partition.
- External: free space scattered into unusable small holes.
Paged Memory Management & Virtual Memory
- Break process into equal-size pages; RAM divided into frames (same size).
- Pages can load into any frame ⇒ eliminates external fragmentation.
- Page Map Table (PMT) maps page → frame.
- Address translation: logical → (page, offset) → frame + offset.
- Demand paging: load page only when referenced; may cause page swap.
- Virtual memory illusion: program larger than RAM.
- Thrashing: excessive page swapping, low CPU efficiency.
File Systems
- File: named collection of related data; text vs binary.
- File system: OS view + operations (create, read, write, delete, copy, rename, permission, metadata).
- File type/format often indicated by extension (e.g., .txt, .mp3, .class).
- Access modes: Sequential vs Direct (random).
- Protection: define who (owner, group, others) & what (read/write/execute) can access.
Directory Trees & Paths
- Directory: named group of files; can nest ⇒ tree hierarchy.
- Root directory at top; parent "..", self "." references.
- Working directory: current location in tree.
- Path: route to file/dir.
• Absolute: starts at root (e.g., /home/smith/reports/week2.txt).
• Relative: starts at working dir (e.g., ../smith/reports/week2.txt).