Sei sulla pagina 1di 5

KERNEL What is Kernel? Kernel of UNIX is the hub of the Operating System.

A computer is nothing but a machine, which we can instruct around, so as to achieve lots of things. Kernel is the core OS program which does all the ground and dirty work of instructing different parts of the machine. Most of the programs that we use like Open Office, Gimp, xmms etc (application programs) get its job done by asking Kernel to give certain services. Now, the kernel has to run around, communicate with lot of hardware and some software to get the finished product from these places and get it delivered to the application programs. Kernel Architecture

1) User Space. The User Space is the space in memory where user processes run. This Space is protected. o The system prevents one process from interfering with another process. o Only Kernel processes can access a user process 2) Kernel Space The kernel Space is the space in memory where kernel processes run. The user has access to it only through the system call. 3) System Call User Space and Kernel Space are in different spaces. When a System Call is executed, the arguments to the call are passed from User Space to Kernel Space. A user process becomes a kernel process when it executes a system call.

Kernel Functional Overview 1) 2) 3) 4) 5) File System Process Management Device Driver Memory Management Networking

1. File System The UNIX system has the following types of files: Ordinary File Contain information entered into them by a user. Directory Files Manage the cataloguing of the file system Special Files (devices) Used to access the peripheral devices FIFO Files for Pipes 2. Process Management The Unix OS is a time-sharing system. Every process is scheduled to run for a period of time (time slice). Kernel creates, manages and deletes the processes. Every process (except init) in the system is created as the result of a fork system call. The fork system call splits a process into two processes (Parent and Child). Each process has a unique identifier (Process ID).

3. Device Manager One of the purposes of an OS is to hide the systems hardware from user. Instead of putting code to manage the HW controller into every application, the code is kept in the Linux kernel. It abstracts the handling of devices. All HW devices look like regular files. Types of Devices Character Devices - A character device is one that can be accessed as a stream of bytes. Block Devices - A block device can be accessed only as multiples of a block. Network Devices - They are created by Linux kernel.

4. Memory Management The term memory management refers to the mechanisms implemented by an operating system to provide memory-related services to applications. These services include virtual memory (use of a hard disk or other non-RAM storage media to provide additional program memory), protected memory (exclusive access to a region of memory by a process), and shared memory (cooperative access to a region of memory by multiple processes). Linuxs memory management services are built on a programming foundation that includes a peripheral device called a Memory Management Unit (MMU). An MMU translates physical memory addresses to linear addresses used by the operating system, and requests a page fault interrupt when the CPU tries to access memory that it is not entitled to.

5. Networking

Types of Kernel There are four popular categories or kinds of Kernels namely monolithic kernels, micro kernels, hybrid kernels and Exokernels. Monolithic kernels are part of Unixlike operating systems like Linux, FreeBSD etc. These types of kernels consist of the core functions of the operating system and the device drivers with the ability to load modules at runtime. Micro kernels are part of the operating systems like AIX, BeOS, Hurd, Mach, Mac OS X, MINIX and QNX. Etc. These types of kernels normally provide only the minimal services such as defining memory address spaces, Inter-process

communication (IPC) and the process management. The other functions such as running the hardware processes are not handled directly by micro kernels. Hybrid kernels are part of the operating systems such as Microsoft Windows NT, 2000 and XP. Dragonfly BSD etc. These types of kernels are extensions of micro kernels with some properties of monolithic kernels. Unlike monolithic kernels, these types of kernels are unable to load modules at runtime on their own. Exokernels are evolving and still under experimental stage in development of an operating system that could incorporate multiple library operating systems and are intended to simultaneously run multiple operating systems of different kinds like Linux and Microsoft Windows together using appropriate Application Programming Interface (API).

Kernel Compilation

Compiling the kernel is composed of three stages namely configuration, building (compiling) and installing. Its really quite simpler than it appears, and its very hard to cause damage and end with a non booting system. Need For Kernel Recompilation 1. Reduce the size of the kernel 2. Activation and deactivation of support for devices.

Potrebbero piacerti anche