Linux Device Drivers Part - 3 : Role of Linux Kernel

As a prerequisite, I strongly recommend you to watch Part-1 and Part-2 of Linux Device Drivers from MrTechpathi Tutorials.

mrtechpathi_tutorials_linux_device_drivers_part_3

In this part we will learn about Role of Linux Kernel.

Why this topic is choosen ?

This topic is choosen to understand the exact role played by Kernel to provide various services. In this part, I will just brief about kernel roles,     eventually we will be discussing them in detail in upcoming parts.

In a Linux system, several concurrent processes attend to different tasks. Each process asks for system resources like computing power, memory, "network connectivity", or some other resource.

Who will be serving these resources ?  Yes its the Kernel.

Kernel  is the big chunk of executable code in charge of handling all these requests.

Although distinction between the different kernel tasks isn't always clearly marked, the kernel's role can be split into the following parts.
  1. Process management
  2. Memory management
  3. File Systems
  4. Device control
  5. Networking
1. Process managament
As a part of process management, kernel is in charge of creating and destroying processes and handling input and output operations.

Communication amoung different proceess happens through various mechanims called Inter process communication mechanisms. We will discuss about various interprocesss mechanisms like signals,pipes,shared memory in upcoming topics.

In addition, the scheduler, which controls how processes share the CPU, is part of process management. More generally, the kernel's process management activity runs several processes on top of a single CPU or on multiple CPUs.

2. Memory Management
Memory management looks at how the kernel manages physical  memory.

Memory is a major resource, and the policy used to deal with it is a critical one for system performance. The kernel builds up a virtual addressing space for any and all processes on top of the limited available resources.

We will be discussing about virtual address space in upcoming topics.

The different parts of the kernel interact with the memory-management subsystem through a set of function calls, ranging from the simple malloc/free pair to much more complex functionalities.

 3. File Systems
Almost everything in Linux can be treated as a file. Linux is heavily based on the filesystem concept.

The kernel builds a structured filesystem on top of unstructured hardware, and the resulting file concept is heavily used throughout the whole system.

In addition, Linux also supports multiple filesystem types, that is, different ways of organizing data on the physical medium. For example, disks may be formatted with the Linux-standard ext3 filesystem... the commonly used FAT filesystem or several others.

Key point to remember here is "almost everything in Linux can be treated as a file".

4. Device Control
Almost every system operation eventually maps to a physical device.All device control operations are performed by code that is specific to the device being addressed. Only the exception entitites are processor, memory, and a very few other entities.

What does this mean ? It means in Linux every physical device is controlled by specific code called Device Driver.

The kernel must have embedded in it a device driver for every peripheral present on a system, from the hard drive to the keyboard and the tape drive. This aspect of the kernel's functions is our primary interest in this tutorial.

5. Networking
Networking must be managed by the operating system, because most network operations like asychronous incoming packets  are not specific to a process. The packets must be collected, identified, and dispatched before a process takes care of them.

The system is in charge of delivering data packets across program and network interfaces, and it must control the execution of programs according to their network activity. Additionally, all the routing and address resolution issues are implemented within the kernel.

Networking service from the kernel is the one which helps the programmer to explore and access various devices by accessing them remotely.

This is end of Part-3 Linux  Device Drivers.

We will continue our next topic in  Linux Device Drivers Part-4. Till then stay tuned ....

To know more in detail, watch below video.


Please feel free to comment and query.

Don’t forget to subscribe  mrtechpathi videos in youtube.

Comments

Popular posts from this blog

Linux Device Drivers - Part 4 : Linux Kernel Moduels (LKM) and types of LKM's

Linux Device Drivers Part - 5 : Building and Compiling Kernel Moduels

Linux Device Drivers - Part 13 : More on Device Numbers