What Is Kernel?
What Is Kernel?
A kernel is a central component of an operating system. It acts as an interface between the user
applications and the hardware. The sole aim of the kernel is to manage the communication
between the software (user level applications) and the hardware (CPU, disk memory etc). The
main tasks of the kernel are:
Process management
Device management
Memory management
Interrupt handling
I/O communication
File system...etc..
provide
their
operating
system
like
ubuntu,
suse,
centOS,
redHat
etc.
3. Types of Kernels
Kernels may be classified mainly in two categories
1. Monolithic
2. Micro Kernel
1 Monolithic Kernel
Earlier in this type of kernel architecture, all the basic system services like process and
memory management, interrupt handling etc were packaged into a single module in kernel
KELTRON
Page | 1
PGDAES
space. This type of architecture led to some serious drawbacks like 1) Size of kernel, which
was huge.
2) Poor maintainability, which means bug fixing or addition of new features resulted in
recompilation of the whole kernel which could consume hours
In a modern day approach to monolithic architecture, the kernel consists of different modules
which can be dynamically loaded and un-loaded. This modular approach allows easy extension
of OS's capabilities. With this approach, maintainability of kernel became very easy as only the
concerned module needs to be loaded and unloaded every time there is a change or bug fix in a
particular module. So, there is no need to bring down and recompile the whole kernel for a
smallest bit of change. Also, stripping of kernel for various platforms (say for embedded
devices etc) became very easy as we can easily unload the module that we do not want.
Linux follows the monolithic modular approach
Pros
Processes react faster because there isnt a queue for processor time
Cons
2 Microkernels
This architecture majorly caters to the problem of ever growing size of kernel code which we
could not control in the monolithic approach. This architecture allows some basic services like
device driver management, protocol stack, file system etc to run in user space. This reduces the
kernel code size and also increases the security and stability of OS as we have the bare
minimum code running in kernel. So, if suppose a basic service like network service crashes
KELTRON
Page | 2
PGDAES
due to buffer overflow, then only the networking service's memory would be corrupted, leaving
the rest of the system still functional.
In this architecture, all the basic OS services which are made part of user space are made to run
as servers which are used by other programs in the system through inter process
communication (IPC). eg: we have servers for device drivers, network protocol stacks, file
systems, graphics, etc. Microkernel servers are essentially daemon programs like any others,
except that the kernel grants some of them privileges to interact with parts of physical memory
that are otherwise off limits to most programs. This allows some servers, particularly device
drivers, to interact directly with hardware. These servers are started at the system start-up.
So, what the bare minimum that microkernel architecture recommends in kernel space?
Process scheduling
Apart from the above, all other basic services can be made part of user space and can be run in
the form of servers.
QNX follows the Microkernel approach
Pros
Portability
Security
Cons
1.
2.
A server is a program which responds to requests from other programs over some
inter-process communication mechanism (usually over a network). A service is what a
KELTRON
Page
| 3mapping service is provided as a PGDAES
server provides. For example, the NFS
port
separate
Hybrid Kernel
Hybrid kernels have the ability to pick and choose what they want to run in user mode and
what they want to run in supervisor mode. Often times things like device drivers and filesystem
I/O will be run in user mode while IPC and server calls will be kept in the supervisor mode.
This give the best of both worlds but often will require more work of the hardware
manufacturer because all of the driver responsibility is up to them. It also can have some of the
latency problems that is inherent with microkernels.
Pros
Developer can pick and choose what runs in user mode and what runs in supervisor
mode
Cons
The kernel file, in Ubuntu, is stored in your /boot folder and is called vmlinuz-version. The
name vmlinuz comes from the unix world where they used to call their kernels simply unix
KELTRON
Page | 4
PGDAES
back in the 60s so Linux started calling their kernel linux when it was first developed in the
90s.
When virtual memory was developed for easier multitasking abilities, vm was put at the
front of the file to show that the kernel supports virtual memory. For a while the Linux kernel
was called vmlinux, but the kernel grew too large to fit in the available boot memory so the
kernel image was compressed and the ending x was changed to a z to show it was compressed
with zlib compression
vmlinux
This is the Linux kernel in an statically linked executable file format. Generally, you don't have to
worry about this file, it's just a intermediate step in the boot procedure.
The raw vmlinux file may be useful for debugging purposes.
vmlinux.bin
The same as vmlinux, but in a bootable raw binary file format. All symbols and relocation
information is discarded. Generated from vmlinux by objcopy -O binary vmlinux vmlinux.bin.
vmlinuz
The vmlinux file usually gets compressed with zlib. Since 2.6.30 LZMA and bzip2 are also available.
By adding further boot and decompression capabilities to vmlinuz, the image can be used to boot a
system with the vmlinux kernel. The compression of vmlinux can occur with zImage or bzImage.
zImage:
For old kernels, just fit 640k ram size.
Page | 5
PGDAES