Kernel

Kernel


Core of OS #

  • The Linux® kernel is the main component of a operating system (OS) and is the core interface between a computer’s hardware and its processes.
  • It communicates between the 2, managing resources as efficiently as possible.

The kernel is so named because—like a seed inside a hard shell— It exists within the OS and controls all the major functions of the hardware, whether it’s a phone, laptop, server, or any other kind of computer.

What the kernel does #

The kernel has 4 jobs:

  1. Memory management: Keep track of how much memory is used to store what, and where
  2. Process management: Determine which processes can use the central processing unit (CPU), when, and for how long
  3. Device drivers: Act as mediator/interpreter between the hardware and processes
  4. System calls and security: Receive requests for service from the processes

The kernel, if implemented properly, is invisible to the user, working in its own little world known as kernel space, where it allocates memory and keeps track of where everything is stored. What the user sees—like web browsers and files—are known as the user space. These applications interact with the kernel through a system call interface (SCI).

Think about it like this. The kernel is a busy personal assistant for a powerful executive (the hardware). It’s the assistant’s job to relay messages and requests (processes) from employees and the public (users) to the executive, to remember what is stored where (memory), and to determine who has access to the executive at any given time and for how long.

Our Red Hat Enterprise Linux product documentation has a lot more detail Where the kernel fits within the OS To put the kernel in context, you can think of a Linux machine as having 3 layers:

The hardware: The physical machine—the bottom or base of the system, made up of memory (RAM) and the processor or central processing unit (CPU), as well as input/output (I/O) devices such as storage, networking, and graphics. The CPU performs computations and reads from, and writes to, memory. The Linux kernel: The core of the OS. (See? It’s right in the middle.) It’s software residing in memory that tells the CPU what to do. User processes: These are the running programs that the kernel manages. User processes are what collectively make up user space. User processes are also known as just processes. The kernel also allows these processes and servers to communicate with each other (known as inter-process communication, or IPC). ref

what it is? #

  • The kernel (also called nucleus[citation needed]) is a computer program that constitutes the central core of a computer’s operating system. It has complete control over everything that occurs in the system.[1]

what it does? #

  • As such, it is the first program loaded on startup, and then manages the remainder of the startup, as well as input/output requests from software, translating them into data processing instructions for the central processing unit.
  • It is also responsible for managing memory, and for managing and communicating with computing peripherals, like printers, speakers, etc. The kernel is a fundamental part of a modern computer’s operating system.[2]

ref:

What is kernel? #

Kernel is nothing but the core of any operating system. It is the kernel that makes an OS entirely different from others. A kernel is actually a large block of code which keeps the system up and running from the time of booting, till shutdown. Kernel is that part of an OS which directly communicates with the hardware of the machine in which it runs and also with external hardware devices.

The kernel can be viewed as resource managing code of an OS. It is responsible for managing and allocating resources like memory, processors etc. It also allows OS to communicate and control various external hardware devices like pendrive, memory card, keyboard etc.

User Vs Kernel program: #

  • User program or applications runs in a memory area called “user space”.
  • The kernel program runs in another memory area called “kernel space”.
  • Kernel program always runs in a supper access mode. So from programming point of view, kernel programming means power to access anything and everything in a system.

Why kernel programming? #

Through kernel programming we can access or control the basic subsystems of kernel like, scheduling, memory management, file system management, networking management, inter-process communication etc. We can develop separate kernel modules which can be inserted into the kernel while the system is running.

The most attractive part of the kernel programming is device driver coding, through which we can interface various external hardware devices like USB, disk drives, data card or any other latest peripheral devices in the market.


Previous Next