Linux Kernel Compilation

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Linux Kernel Compilation as PDF for free.

More details

  • Words: 1,000
  • Pages: 3
                                       Linux Kernel Internal                                              Kernel  What is Kernel?  This is a term for the computing elite, so proceed at your own risk. To understand what a kernel is,  you first need to know that today's operating systems are built in "layers." Each layer has different  functions such as serial port access, disk access, memory management, and the user interface itself.  The base layer, or the foundation of the operating system, is called the kernel. The kernel provides  the most basic "lowlevel" services, such as the hardwaresoftware interaction and memory  management. The more efficient the kernel is, the more efficiently the operating system will run.  The Basic Responsibilities of Kernel :                      Process Management                 •                      Memory Management                 •                      Device Management                 •                      System Calls                 •  How to compile Linux Kernel ?  1. Download kernel sources  You can download the latest Linux kernel sources at www.kernel.org.  Now put your kernel sources at /usr/src/. As root, unpack the tarball, and then make (or change) the  symbolic link to it as  ln s linux2.4.xx linux  2. Preparation – Gather the information about your system.  3. Configuration  This is the most difficult part for kernel compilation. To start configuration, change to /usr/src/linux  and type make menuconfig or make xconfig . If you have previously configured the kernel,  the configuration is saved in a file .config . You can load in this file to start your configuration  based on what you have done last time.  For each item, there is a help that you should look at. There some thing that you need to notice  when select  each item.                  Compile the support for your hard disk controller and your native file system (ext2) into              •                  kernel. Don't compile them as modules.                  You can select EXT3 Journaling file system support as a module. See the result of              •                  lsmod.                  You should select MS dos fat fs support and vfat (windows) fs support as modules if              •                  you mount a windows partition.                  Be sure to compile sound card support as a module. If not, you can't use sndconfig              •                  to configure your sound card later. 

                You can select support for USB as a module. And you should select 'y' to enable              •                  preliminary USB device file system.  4. Compile kernel and modules  After you are done with kernel configuration, use the following command to compile the kernel.                  make dep                  make clean                  make bzImage  The new kernel is named bzImage, and it is stored at /usr/src/linux/arch/i386/boot/bzImage. The  current kernel is normally  /boot/vmlinuz. You should copy the new kernel to the /boot directory  and give a new name. For example  cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz2.4.xx  Don't forget to compile and install the modules. You can do it by                  make modules                  make modules_install  5. Configure grub or lilo, the boot loader  To boot the new kernel you should add a new entry to grub or lilo, depending on which you are  using. To do it, edit the file /etc/grub.conf or /etc/lilo.conf.  For example, in /etc/grub, you can add the following entry. (suppose you just compiled the kernel  version 2.4.17)             title Red Hat Linux (2.4.17)             root (hd0,1)             kernel /boot/vmlinuz2.4.17 ro root=/dev/hda2  Now you can reboot your machine and select to boot the new kernel at the menu of grub or lilo. If  new kernel cannot boot correctly, you can press ctrl+alt+del to reboot and select the old  kernel for  troubleshooting.  Booting  of Kernel:                    BIOS selects the boot device.                •                    BIOS loads the boot sector from the boot device.                •                    Boot sector loads setup, decompression routines and compressed kernel image.                •                    The kernel is uncompressed in protected mode.                •                    Lowlevel initialization is performed by asm code.                •                    Highlevel C initialization.                • 

Inter Process Communication  InterProcess Communication (IPC) is a set of techniques for the exchange of data between two or  more threads in one or more processes. Processes may be running on one or more computers  connected by a network. IPC techniques are divided into methods for message passing,  synchronization, shared memory, and remote procedure calls (RPC). The method of IPC used may  vary based on the bandwidth and latency of communication between the threads, and the type of  data being communicated.  It is widely accepted that IPC can be implemented significantly faster in a micro kernel environment  than in classical monolithic kernel systems.  What is Multiprocessing?  Multiprocessing is a generic term for the use of two or more central processing units (CPUs) within  a single computer system. It also refers to the ability of a system to support more than one processor  and/or the  ability to allocate tasks between them.  Multiprocessing sometimes refers to the execution of multiple concurrent software processes in a  system as opposed to a single process at any one instant.  A system can be both multiprocessing and  multiprogramming, only one of the two, or neither of the two.  Multiprocessing operating systems enable several programs to run concurrently.  More than one  processor is running in multiprocessing system. UNIX is one of the most widely used  multiprocessing systems.   Advantages in Multiprocessing  Because multiprocessing targets database and transactional systems, its typical deployment occurs  on server boards carrying 4 to 8 processors. Often, highend systems will feature up to 32  processors working together to scale the workload. Using multiple threads with multiple  transactions, multiprocessing systems manage large dataintensive workloads without executing  demanding mathematical calculations. An interesting fact regarding the multiprocessing capability  to manage large amounts of data emerges as the amounts of data increase.  Disadvantages in Multiprocessing  Multiprocessing systems deal with four problem types associated with control processes, or with the  transmission of message packets to synchronize events between processors. These types are              Overhead—The time wasted in achieving the required communications and control           •              status prior to actually beginning the client’s processing request              Latency—The time delay between initiating a control command, or sending the           •              command message, and when the processors receive it and begin initiating the              appropriate actions              Determinism—The degree to which the processing events are precisely executed           •              Skew—A measurement of how far apart events occur in different processors, when they           •              should occur simultaneously. 

Related Documents

Linux Kernel Compilation
November 2019 8
Linux Kernel
November 2019 30
Linux Kernel Programming
November 2019 26