Kernel Development in LINUX
Kernel Development in LINUX
Kernel Development in LINUX
Development in
LINUX
Prepared by: Utkarsh Thakkar
Guided by: Prof. Jitendra
Bhatia
Context
• Kernel
– Definition
– Types
– Architecture
– Requirements
– Modules
• Linux
– Features
– Advantages
Defination of Kernel
• Kernel is a set of interrelated Modules by which
the the operating system can handle all the
resources of the system hardware.
• The kernel is a program that constitutes the
central core of a computer operating system. It
has complete control over everything that
occurs in the system.
• The kernel code is written in C with some
modules as assembly codes.
How to get the Kernel
Code??
• We can download the kernel source from the
command line, using the wget or curl utilities,
both of which should come with your Linux
distribution.
• To download the 2.6.17.8 kernel version
using wget, enter:
• $ wget
http://www.kernel.org/pub/linux/kernel/v2.6/li
nux-2.6.17.8.tar.gz
Types of Kernel
• Monolithic Kernel
• Micro Kernel
• Exo Kernel
• Hybrid Kernel
Monolithic Kernel
• Monolithic kernels are part of Unix-
like 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 Kernel
• 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 microkernels.
Exo Kernel
• 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).
Traditional Unix Kernel
User programs
Libraries
User level
Kernel level
Hardware control
Kernel level
Hardware level
Hardware
Tools to Build the Kernel
• Only three packages that are needed
in order to successfully build a kernel
A Compiler
A Linker
A Make utility
Module-init-tools
Compiler
• The Linux kernel is written in the C programming
language, with a small amount of assembly
language in some places. To build the kernel, the
gcc C compiler must be used.
• To determine which version of gcc you have on
your system, run the following command:
• $ gcc --version
Linker
• The C compiler, gcc, does not do all of the compiling on
its own. It needs an additional set of tools known as
binutils to do the linking and assembling of source files.
The binutils package also contains useful utilities that
can manipulate object files in lots of useful ways, such
as to view the contents of a library.
• To determine which version of binutils you have on your
system, run the following command:
• $ ld –v
Make Utility
• Make is a tool that walks the kernel
source tree to determine which files
need to be compiled, and then calls
the compiler and other build tools to
do the work in building the kernel.
Module-init-tools
• Multiprogramming/Multitasking system
(b) OS Stability
Linux almost never freezes under normal use.
Linux has been known to run some applications for months and years
at a time.
(c) Speed
Linux machines are also known to be extremely fast, because the
operating system is very efficient at managing resources .
Advantages and Disadvantages
Advantages:
(d) Portability
Linux can run on ARMs, DEC Alphas, SUN Sparcs, M68000 machines
(like Atari and Amiga), MIPS and PowerPCs, and others. So no matter
what computer you're running, Linux will work on your hardware.