Лист за преговор: Operating Systems Fundamentals

Operating System Processes & Memory Management Revision Sheet

1. 📌 Essentials

  • Processes are the fundamental units of execution, identified by PID.
  • System calls like fork() create new processes; exec() replaces process image.
  • Process states: ready, running, blocked; managed by the scheduler.
  • Threads are lightweight subprocesses sharing the same address space.
  • Virtual memory uses paging and segmentation; managed via tables.
  • Page replacement algorithms include, LRU, and Clock.
  • Synchronization mechanisms: semaphores, mutexes, monitors prevent race conditions.
  • Hardware features: registers, interrupts, privilege modes, cache, and protection.
  • Deadlock occurs with mutual exclusion, hold-and-wait, no preemption, circular wait.
  • Modern OS evolution: mechanical → vacuum tube → transistor → integrated → distributed/virtualized.

2. 🧩 Key Structures & Components

  • Process / Process Control Block (PCB) — contains PID, state, context, memory info.
  • Threads — share process resources; have own PC and stack.
  • Page Table — maps virtual addresses to physical frames.
  • TLB (Translation Lookaside Buffer) — cache for page table entries.
  • Page Replacement Algorithms — FIFO, LRU, Clock.
  • Semaphores — control access to critical sections.
  • Interrupt Vector Table — maps interrupt types to handlers.
  • Registers — PC (Program Counter), IR (Instruction Register), PSW (Program Status Word).
  • Protection Modes — user mode vs kernel mode.
  • Cache — exploits temporal and spatial locality.

3. 🔬 Functions, Mechanisms & Relationships

  • Process creation: fork() clones parent; exec() overlays process with new program.
  • Process lifecycle: created → scheduled → executed → terminated.
  • Threads: share process memory; enable parallelism.
  • Memory management:
    • Virtual addresses split into page number + offset.
    • Page tables translate virtual to physical addresses.
    • TLB caches recent translations for speed.
  • Page replacement:
    • When memory full, select a page to evict based on algorithm.
    • FIFO: oldest page.
    • LRU: least recently used.
    • Clock: approximates LRU with reference bits.
  • Synchronization:
    • Critical sections protected by semaphores/mutexes.
    • Deadlocks detected or avoided via resource allocation graphs.
  • Hardware support:
    • Interrupts signal hardware/software events.
    • Privilege modes restrict sensitive instructions.
    • Cache improves performance via locality.

4. Comparative Table

ItemKey FeaturesNotes / Differences
ProcessUnique PID, states, created via fork()/exec(), terminated by exit()Parent-child relations, separate address spaces
ThreadShares process resources, has own PC and stackFaster creation, lightweight
Virtual MemoryPaging, segmentation, page tables, TLBLarger address space than physical memory
Page ReplacementFIFO, LRU, ClockBalances page faults and memory utilization
SynchronizationSemaphores, mutexes, monitorsPrevent race conditions
Hardware SupportRegisters, interrupts, privilege modes, cacheEnforces protection, manages I/O

5. 🗂️ Hierarchical Diagram (ASCII)

Operating System
 ├─ Process Management
 │    ├─ Creation: fork(), exec()
 │    ├─ States: ready, running, blocked
 │    └─ Termination: exit()
 ├─ Threads
 │    ├─ Share resources
 │    └─ Managed by kernel/user
 ├─ Memory Management
 │    ├─ Virtual memory: paging, segmentation
 │    ├─ Page tables & TLB
 │    └─ Replacement algorithms: FIFO, LRU, Clock
 ├─ Synchronization & Communication
 │    ├─ Semaphores, mutexes
 │    └─ Deadlock detection/avoidance
 └─ Hardware & Protection
      ├─ Registers, interrupts
      ├─ Privilege modes
      └─ Cache, protection mechanisms

6. ⚠️ High-Yield Pitfalls & Confusions

  • Confusing fork() (creates a copy) with exec() (replaces process image).
  • Mixing up page replacement algorithms: FIFO (first-in), LRU (least recently used), Clock (approximate LRU).
  • Overlooking the difference between user mode and kernel mode.
  • Assuming threads are independent processes; they share memory.
  • Misunderstanding deadlock conditions: mutual exclusion, hold-and-wait, no preemption, circular wait.
  • Forgetting that TLB caching can cause consistency issues (TLB shootdown).
  • Confusing process states: ready vs blocked.
  • Ignoring the role of the scheduler in process/thread transitions.

7. ✅ Final Exam Checklist

  • Understand process creation: fork(), exec(), process states.
  • Know process identifiers: PID, UID, GID.
  • Differentiate between processes and threads.
  • Describe virtual memory: paging, segmentation, page tables.
  • Explain page replacement algorithms: FIFO, LRU, Clock.
  • Recognize synchronization tools: semaphores, mutexes, monitors.
  • Identify hardware components: registers, interrupts, privilege modes.
  • Understand deadlock conditions and prevention strategies.
  • Know the role of TLB and cache in memory management.
  • Describe scheduling algorithms: FCFS, SJF, Round Robin, Priority.
  • Trace the evolution of OS from mechanical to distributed systems.
  • Recognize the importance of protection modes and hardware support.
  • Be familiar with common pitfalls and misconceptions.
  • Use ASCII diagrams to visualize hierarchy and flow.
  • Relate hardware features to OS functions (e.g., interrupt handling, protection).

End of Revision Sheet

Тествайте знанията си

Тествайте знанията си по Operating Systems Fundamentals с 10 въпроса с множество отговори с подробни корекции.

1. What is the primary purpose of the fork() system call in process management?

2. What function in Unix-like operating systems is used to create a new process by cloning the parent process?

Вземете теста →

Прегледайте с флашкарти

Запомнете ключовите концепции на Operating Systems Fundamentals с 10 интерактивни флашкарти.

Process — creation method?

fork() and exec() system calls

Processes — definition?

Units of execution identified by PID.

Thread — resource sharing?

Share address space within a process

Вижте флашкартите →

Similar courses

Създайте свои собствени листове за преговор

Импортирайте курса си и AI генерира листове, тестове и флашкарти за 30 секунди.

Генератор на листове