sandeshMC

Definition and the functions of kernel

Oct 11th, 2014
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.30 KB | None | 0 0
  1. ## DEFINITION ##
  2. kernel is a computer program that manages input/output requests from software, and translates them into data processing instructions for the central processing unit and other electronic components of a computer. The kernel is a fundamental part of a modern computer's operating system.
  3. Because of its critical nature, the kernel code is usually loaded into a protected area of memory, which prevents it from being overwritten by other, less frequently used parts of the operating system or by application programs.
  4. Kernel is considered as the Heart of an Operating System. Kernel provides the lowest-level abstraction layer for the resources (especially processors and I/O devices) that application software must control to perform its function. It makes these facilities available to applicaton processes through Inter- Process Communication (IPC) mechanism and System Call.
  5.  
  6.  
  7.  
  8. ## FUNCTIONS OF LINUX KERNEL ##
  9. 1. Resource allocation- The kernel's primary function is to manage the computer's resources and allow other programs to run and use these resources. These resources are- CPU, Memory and I/O devices.
  10.  
  11.  
  12. 2. Process Management- A process defines which memory portions the application can access. The main task of a kernel is to allow the execution of applications and support them with features such as hardware abstraction.
  13. To run an application, a kernel first set up an address space for the application, then loads the file containing the application's code into memory, then set up a stack for the program and branches to a given location inside the program, thus finally starting its execution.
  14.  
  15.  
  16. 3. Memory Management- The kernel has full access to the system's memory. It allows processes to safely access this memory as they require it. Virtual addressing helps kernel to create virtual partitions of memory in two disjointed areas, one is reserved for the kernel (kernael space) and the other for the applications (user space).
  17.  
  18.  
  19. 4. I/O Device Management- To perform useful functions, processes need access to the peripherals connected to the computer, which are controlled by the kernel through Device Drivers. A device driver is a computer program that enables the operating system to interact with a hardware device. It provides the operating system with information of how to control and communicate with a certain piece of hardware.
  20. A kernel maintains a list of available devices. A device manager first performs a scan on different hardware buses, such as Peripheral Component Interconnect (PCI) or Universal Serial Bus (USB), to detect installed devices, then searches for the appropriate drivers. The kernel provides the I/O to allow drivers to physically access their devices through some port or memory location.
  21.  
  22.  
  23. 5. Inter- Process Communication- Kernel provides methods for Synchronization and Communication between processes called Inter- Process Communication (IPC). There are various approaches of IPC say, semaphore, shared memory, message queue, pipe (or named fifo), etc.
  24.  
  25.  
  26. 6. Scheduling- In a Multitasking system, the kernel will give every program a slice of time and switch from process to process so quickly that it will appear to the user as if these processes were being executed simultaneously. The kernel uses Scheduling Algorithms to determine which process is running next and how much time it will be given. The algorithm sets priority among the processes.
  27.  
  28.  
  29. 7. System Calls and Interrupt Handling- A system call is a mechanism that is used by the application program to request a service from the operating system. System calls include close, open, read, wait and write. To access the services provided by the kernel we need to invoke the related kernel functions. Most kernels provide a C Library or an API, which in turn invokes the related kernel functions.
  30. There are few methods by which the respective kernel function can be invoked- using Software- Simulated Interrupt, or using a Gate Call, or by using a Special System Call Instruction and by using a Memory- based Queue.
  31.  
  32.  
  33. 8. Security or Protection Management- Kernel also provides protection from faults (error control) and from malicious behaviors (Security). One approach toward this can be Language based protection system, in which the kernel will only allow code to execute which has been produced by a trusted language compiler.
Advertisement
Add Comment
Please, Sign In to add comment