OS Kernel

The OS kernel is the core component of an operating system, managing system resources like the CPU, memory, and devices, and acting as the primary interface bet...

The OS kernel is the central component of an operating system, acting as the primary interface between the computer's hardware and the software running on it. It is the first program loaded on startup (after the bootloader) and remains in memory throughout the system's operation. Architecturally, the kernel manages the system's resources, including the CPU, memory, and peripheral devices. It provides essential services to other parts of the OS and to application programs through system calls. Key functions include [process management](/es/terms/process-management) (creating, scheduling, and terminating processes), memory management (allocating and deallocating memory space, virtual memory implementation), device management (interacting with hardware via device drivers), and system call handling (processing requests from user-space applications). Kernels can be broadly categorized into monolithic kernels, microkernels, and hybrid kernels. Monolithic kernels (like Linux) run all core OS services in a single, large process in kernel space, offering high performance due to direct function calls but potentially lower modularity and stability. Microkernels (like MINIX 3) run only the most essential services (like inter-process communication, basic scheduling, and memory management) in kernel space, moving other services to user space, enhancing modularity and security but often incurring performance overhead due to frequent context switching and message passing. Hybrid kernels (like Windows NT) attempt to combine the performance benefits of monolithic kernels with the modularity of microkernels. Trade-offs involve performance, security, stability, and modularity.

        graph LR
  Center["OS Kernel"]:::main
  Rel_advanced_propulsion_systems["advanced-propulsion-systems"]:::related -.-> Center
  click Rel_advanced_propulsion_systems "/terms/advanced-propulsion-systems"
  Rel_function["function"]:::related -.-> Center
  click Rel_function "/terms/function"
  Rel_kernel["kernel"]:::related -.-> Center
  click Rel_kernel "/terms/kernel"
  classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
  classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
  classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
  classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
  linkStyle default stroke:#4b5563,stroke-width:2px;

      

🧒 Explícalo como si tuviera 5 años

The [kernel](/es/terms/kernel) is like the engine and driver of a car. It controls all the basic parts (engine, wheels, steering) and makes sure everything runs smoothly so you can drive your car (run your apps).

🤓 Expert Deep Dive

Kernel space operates in a privileged mode (e.g., Ring 0 on x86 architectures), with direct access to hardware and memory, whereas user space applications run in a less privileged mode (e.g., Ring 3). System calls are the carefully defined interfaces through which user-space programs request kernel services, involving a context switch from user mode to kernel mode. Process scheduling algorithms (e.g., preemptive, cooperative) determine how CPU time is allocated among competing processes. Memory management techniques like paging and segmentation are implemented within the kernel to provide virtual memory abstractions and enforce memory protection. Device drivers, often loaded as modules, abstract hardware complexities, allowing the kernel to interact with diverse peripherals uniformly. Vulnerabilities within the kernel (e.g., buffer overflows, race conditions) are critical as they can lead to system-wide compromise. Architectural choices like loadable kernel modules (LKMs) in monolithic kernels offer flexibility but also increase the attack surface.

📚 Fuentes