Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

1. 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..

2. Is LINUX A Kernel Or An Operating System?


Well, there is a difference between kernel and OS. Kernel as described above is the heart of OS
which manages the core features of an OS while if some useful applications and utilities are
added over the kernel, then the complete package becomes an OS. So, it can easily be said that
an operating system consists of a kernel space and a user space.
So, we can say that Linux is a kernel as it does not include applications like file-system
utilities, windowing systems and graphical desktops, system administrator commands, text
editors, compilers etc. So, various companies add these kind of applications over linux kernel
and

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

More direct access to hardware for programs

Easier for processes to communicate between each other

If your device is supported, it should work with no additional installations

Processes react faster because there isnt a queue for processor time

Cons

Large install footprint

Large memory footprint

Less secure because everything runs in supervisor mode

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?

Managing memory protection

Process scheduling

Inter Process communication (IPC)

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

Small install footprint

Small memory footprint

Security

Cons

Hardware is more abstracted through drivers

Hardware may react slower because drivers are in user mode

Processes have to wait in a queue to get information

Processes cant get access to other processes without waiting

1.

A daemon is a background, non-interactive program. It is detached from the


keyboard and display of any interactive user. The word daemon for denoting a
background program is from the Unix culture; it is not universal.

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

portmap server, which is implemented as the portmapd daemo

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

Smaller install footprint than monolithic kernel

More flexible than other models

Cons

Can suffer from same process lag as microkernel

Device drivers need to be managed by user (typically)

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.

The function decompress_kernel() handles the decompression of vmlinuz at bootup, a


message indicates this:
Decompressing Linux... done
Booting the kernel.
zImage (make zImage)
This is the old format for small kernels (compressed, below 512KB). At boot, this image gets
loaded low in memory (the first 640KB of the RAM).
bzImage (make bzImage)
The
big zImage (this has nothing to do with bzip2), was created while the kernel grew and
vmlinux:
handles bigger images (compressed, over 512KB). The image gets loaded high in memory
A non-compressed
and
Linux
file format,
to
(above
1MB RAM).
Asnon-bootable
today's kernels
arekernel
way over
512KB,just
thisanisintermediate
usually the step
preferred
producing vmlinuz.
way.
vmlinuz:
A compressed and bootable Linux kernel file. It is actually zImage or bzImage file.
KELTRON

zImage:
For old kernels, just fit 640k ram size.

Page | 5

PGDAES

You might also like