Overview

The Kernel & System Architecture module details how an operating system controls physical hardware, enforces isolation, handles external events, and provides abstractions for execution. It covers hardware-level privilege enforcement, event-driven kernel execution, and the primary execution subsystems: Processes (resource containers), Threads (schedulable execution streams), and CPU Scheduling (policy-driven core allocation).


Module Structure & Notes

1. Hardware Privilege & Isolation Mechanics

Note LinkDescriptionCore Primitives
Dual-Mode Operation & Memory ProtectionHardware isolation via User/Kernel modes, mode bit registers, privileged instruction sets, and MMU protection.Mode Bit, Privileged Instructions, MMU
Interrupts and ExceptionsEvent-driven kernel architecture, handling asynchronous hardware interrupts, synchronous faults, and hardware timer preemption.Trap Vector Table, ISR, Hardware Timer
System CallsSoftware trap mechanisms (syscall), register parameter passing, and descriptor handle translation between user and kernel space.Software Traps, File Descriptors, Handles

2. Execution & Resource Subsystems

📁 Process Management Subsystem

  • Process Abstraction & PCB: Memory address space layouts (Text, Data, Heap, Stack), execution states, and Process Control Block (task_struct) structures.
  • Process Lifecycle & API: Creation models (fork() + exec() vs. CreateProcess), process hierarchies, termination (exit(), wait()), and Zombie/Orphan handling.

📁 Thread Management Subsystem

  • Thread Abstraction & TCB: Decoupling address space containers from execution streams, multithreaded memory layouts, TCBs, and Concurrency vs. Parallelism.
  • Thread Context Switch & Scheduling: State queues, voluntary yield() mechanics, low-level assembly context switches, and hardware timer preemption.
  • Kernel vs User Level Threads: Evaluating 1:1 Kernel-Level Threads, M:1 User-Level Threads, and M:N Hybrid Multithreading Models.

📁 CPU Scheduling Subsystem


System Architecture Map

+-----------------------------------------------------------------------+
| USER SPACE                                                            |
|  [Applications] ---> [C Library (glibc)]                              |
|                          |                                            |
|                    system calls (fork, exec, read, yield)             |
+--------------------------|--------------------------------------------+
| HARDWARE BOUNDARY        v                                            |
|                  [Software Traps / Interrupts / Faults]               |
+--------------------------|--------------------------------------------+
| KERNEL SPACE             v                                            |
|  +-----------------------------------------------------------------+  |
|  | Event Handlers & Syscall Dispatcher                             |  |
|  +-----------------------------------------------------------------+  |
|  | Process Subsystem      | Thread Subsystem     | CPU Scheduler   |  |
|  |  - PCBs (task_struct)  |  - TCBs & Stacks     |  - MLFQ / CFS   |  |
|  |  - Address Spaces      |  - Ready/Wait Queues |  - Policy vs    |  |
|  |  - IPC                 |  - Context Switch    |    Mechanism    |  |
|  +-----------------------------------------------------------------+  |
|  | Memory Management (MMU)         | Device Drivers & I/O Systems  |  |
+-----------------------------------------------------------------------+

Related Modules