Department of Computer Science & Engineering: - + 'KLE Society's KLE Technological University HUBLI-31
Department of Computer Science & Engineering: - + 'KLE Society's KLE Technological University HUBLI-31
`KLE Society's
KLE Technological University
HUBLI-31
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
Report on
Submitted By:
Prof.Shantala.G
Contents
5. Stepwise Implementation 7
Kernel modules are pieces of code that can be loaded and unloaded into the
kernel upon demand. They extend the functionality of the kernel without the
need to reboot the system.
Custom codes can be added to Linux kernels via two methods.
The basic way is to add the code to the kernel source tree and
recompile the kernel.
A more efficient way is to do this is by adding code to the kernel
while it is running. This process is called loading the module, where
module refers to the code that we want to add to the kernel.
Introduction to Tiny Core OS:
Tiny Core Linux (TCL) is a minimal Linux operating system focusing on
providing a base system using BusyBox and FLTK, developed by Robert
Shingledecker.[3] The distribution is notable for its small size (11 to 16 MB) and
minimalism; additional functions are provided by extensions. Tiny Core Linux
is free and open source software and is licensed under the GNU General Public
License version 2. TinyCore becomes simply an example of what the core
project can produce an 16MB FLTK desktop. It is not a complete desktop nor is
all hardware completely supported. It represents only the core needed to boot
into a very minimal X desktop typically with wired internet access. The user has
complete control over which applications and/or additional hardware to have
supported, be it for a desktop, a netbook, an appliance, or server, selectable by
the user by installing additional applications from online repositories, or easily
compiling most anything you desire using tools provided.
Types of Cores:
System Requirements:
RAM: (min) 46MB.
CPU: i486DX
Linux Kernel Module
Kernel modules are piece of code that can be loaded and unloaded from kernel
on demand.
Kernel modules offers an easy way to extend the functionality of the base kernel
without having to rebuild or recompile the kernel again. Most of the drivers are
implemented as a Linux kernel modules. When those drivers are not needed, we
can unload only that specific driver, which will reduce the kernel image size.
The kernel modules will have a .ko extension. On a normal linux system, the
kernel modules will reside inside /lib/modules/<kernel_version>/kernel/
directory.
Use the make command to compile hello world kernel module as shown below.
4. Insert or Remove the Sample Kernel Module
Now that we have our hello.ko file, we can insert this module to the kernel by
When a module is inserted into the kernel, the module_init macro will be
invoked, which will call the function summary_init. Similarly, when the module
is removed with rmmod, module_exit macro will be invoked, which will call the
summary_exit. Using dmesg command, we can see the output from the sample
Kernel module.
4.Modinfo to display Kernel Module
The information of the module can be displayed by using the command
modinfo as shown below.