Вы находитесь на странице: 1из 29

Kernel

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

System call interface

File subsystem IPC

Buffer cache Process control


scheduler
subsystem
Character Block Memory
management
Device drivers

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

• The module-init-tools package is needed


if you wish to use Linux kernel modules.
• To determine which version of the
module-init-tools package you have on
your system, run the following
command:
• $ depmod -V
Metadata In Kernels
• All kernels can and should contain metadata–descriptive
information about the basic kernel data.
• Metadata might convey:
– when, where, how and by whom the file was made
– for what purpose the file was made
– what source data were used to make the file
– key characteristics of the file, such as:
• start and stop times
• information about data gaps
• notes on expected data accuracy
– cautions on use of the file
– whatever else the file creator thinks could be useful
to consumers of the data product
Booting of Kernel
• Initially the Kernel image is loaded
into the primary memory, which is a
secured one for the kernel.
• Then the Kernel creates a limited
address space including the kernel's
code and data segment, the initial
Page Tables, and a 128KB for some
dynamic data structures.
Examples of Kernel
Modules
• Scheduler
• Supervisor
• Interrupt Handler
• Memory Manger
Examples of Kernel
Modules(2)
• Scheduler : Which is concerned with the Time of
kernel provided to the processes.
• Supervisor : Which grants the Use of Kernel to
each process.
• Interrupt Handler: Handles all the mask able
and non mask able interrupts like io request,
exception etc.
• Memory Manager: Handles the memory
allocation to the file and maintains the uarea.
History of Linux
• Linux was created originally by and named after a young
student Linus Torvald at the University of Helsinki in Finland.
• Linux began searching for ways to get more out of Minix in
the spring of 1991.
• On october 5th 1991, Linus announced his first "official"
version of Linux, version 0.02.
• Three years later, in 1994, version 1.0 was officially released.
Some Basic Characteristics of
Linux
• Multi-user System

• Multiprogramming/Multitasking system

• Uses Time Sharing

• Access rights for Files and Processes

• Uses File and Process hierarchies


Advantages and Disadvantages
Advantages:
(a) Cost
The Linux OS is entirely cost- and license-free. The only expenses
involved are those of hardware and maintenance.

(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.

(e) Power and Customization


Linux can be tailored to your specific hardware and software needs,
as well as other operating systems.
(f) Support
Support for the Linux OS is entirely free. There is extensive
documentation covering almost everything you will use.
Advantages and Disadvantages
Disadvantages:

(a) Lack of technical support


Having no source of technical support for the linux
operating system, so for its application.
(b) Hardware problems
Linux can be hard to install and doesn’t work on all
hardware platforms as it is not a commercial
program development operation.
Advantages and Disadvantages
Disadvantages:
(c) Maintainance
Linux requires that you learn to perform administration
tasks like adding new users and installing software.
(d) Lack of experience
It has many features which require patience to learn, and
experience to fully understand.
(e) Accountability
Use of the Linux OS is strictly at-your-own-risk. There is no
one who is responsible if the OS fails.
Applications
Linux contains a wide variety of applications.

 (a)General Business Applications - Office Suites, Financial


Programs, Word Processors, Text Editors, Spreadsheets

 (b)Database Tools - Databases, Database Tools and Utilities

 (c) Development Tools - Programming Software, Tools, and


Utilities
Applications

 (e) Internet Utilities - HTML Editors, Internet Applications


and Utilities, Email ,Software, Web Browsers, Web Servers

 (f) Networking Tools -- Networking Tools and Utilities

 (g) Miscellaneous Applications

 (h) Linux Software Map (LSM)


What Next?????????
• Hybrid Kernel
– The Kernel with the extended
functionalities added by the means of
the modules…………………….
– Ex: Device Drivers
References
• www.wikipedia.org
• http://it.toolbox.com/
• www.linuxforumes.org
• www.kernel.org.in
Any
Questions???????

Вам также может понравиться