1 / 16

What is a Kernel

What is a Kernel. The kernel of any operating system is the core of all the system’s software. The only thing more fundamental than the kernel is the hardware.

taariq
Download Presentation

What is a Kernel

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. What is a Kernel • The kernel of any operating system is the core of all the system’s software. The only thing more fundamental than the kernel is the hardware. • The kernel has many jobs. The essence of its job is to provide a running environment for application software. The environment has to handle issues such as networking, disk access, virtual memory and multitasking. • Although the kernel is a small part of the complete linux system, it is by far the most critical element. If the kernel fails, the rest of system goes with it.

  2. Linux Kernel • The kernel is responsible for: • CPU resource scheduling • Process management • Signals and semaphores • Virtual memory (swapping, paging, and mapping) • Filesystem • Interprocess communication

  3. Kernel • The SA is able to directly customize a kernel. Some of the reasons for doing this might be: • The system hardware has been modified by adding devices, memory and processors etc. • Memory usage needs to be optimized • The speed and performance of the system may need improvement • The actual kernel size varies from machine to machine, depending on what features are compiled onto it, what modifications you have made to the kernel data structures and what additions you have made to the code.

  4. Example of Some Sample Tunable Kernel Parameters • /etc/sysctl.conf

  5. Finding and unpacking the kernel source code • The distribution of Linux should have the source code to that specific kernel. Otherwise, the source code can be obtained from the vendor. • Traditionally, the kernel source is located at /usr/src. Before you unpack a new source tree, you should always save and rename the current one. In /usr/src, there should be a directory named linux, which contains the current source tree. Most distributions do not install the entire source tree by default. Only the necessary files for development are installed. The safest path to upgrading is to rename the existing tree with a suffix indicating its associated version number.

  6. The UNIX Architecture Interactive User Libraries Commands Application Programs … OS System Call Interface Trap Table Device Driver • Monolithic Kernel Module • Process Management • Memory Management • File Management • Device Mgmt Infrastructure Device Driver … Driver Interface Device Driver

  7. Building the Kernel • Building the kernel allows the user to thin down the feature list so that UNIX can run on less-powerful systems, with the same performance. • Building the kernel requires configuring and compiling. If you have windows running, this process would be simpler, because it can be menu driven.

  8. Modules • When configuring, there is a choice of making modules. As a systems administrator, there are situations where a kernel feature is necessary for a short period of time. • With the module system, it allows parts of the kernel, called modules, to be dynamically loaded and unloaded from the kernel as needed. Features often not used can thus be enabled but won’t waste memory when they aren’t being used. The kernel automatically determines what to load and when.

  9. Prerequisites • linux-source (latest release of Ubuntu kernel code) • build-essential (packages required to compile the code) • fakeroot (kernel specific) • kernel-package (kernel specific) • ncurses-dev (use make menuconfig) • libglade2-dev (use make gconfig} • module-assistant, debhelper (to create modules)

  10. Download and install the kernel source code using aptitude • sudo aptitude update • sudo aptitude install linux-source • ls –l /usr/src/linux-source* • cd /usr/src • tar –xjf linux-source-2.6.31.tar.bz2 • sudo aptitude install git-core • cd /usr/src/linux-source-2.6.31 • make menuconfig

  11. Customizing the Kernel • Under /usr/src/linux-source-***: make menuconfig • Check the hidden .config file

  12. Compiling/Installing a kernel image file and loadable modules • make-kpkg–rootcmd fakeroot kernel-image • man make-kpkg • Compile the kernel • /var/cache/apt/archives/linux-image-***deb • sudo dpkg –i linux-image*.deb: • Install the kernel

  13. Search the package • aptitude search source$ • To display a list of available *-source packages • Source$ ensures that the string matches only the last part of a package name

  14. Downloading, compiling, and installing nonstandard modules • module-assistant –text-mode auto-install line6-usb-source • Module-assistant utility calls sudo to run apt-get and dpkg

  15. Load a module • After a module is installed with module-assistant, it must be loaded to make it available to the kernel • depmod: works with dependencies for modules • insmod: loads modules in a running kernel • insmod /lib/modules/2.6.31-*/kernel/drivers/block/floppy.ko • lsmod: lists information about all loaded modules • modinfo: list information about a module

  16. Load a module • modprobe: loads, unloads, and repots on modules • rmmod: unloads a module from a running kernel

More Related