Setup and compile linux kernel
This presentation is the property of its rightful owner.
Sponsored Links
1 / 33

Setup and Compile Linux Kernel PowerPoint PPT Presentation


  • 102 Views
  • Uploaded on
  • Presentation posted in: General

Setup and Compile Linux Kernel. Speaker: Yi-Ji Jheng Date: 2007.10.31. Outline. Understand Linux Kernel Setup and Compile Linux Kernel Setup and Compile micro-Linux Kernel. UNDERSTAND LINUX KERNEL. Where is Kernel ?. User. Shell. Shell, KDE, AP. Kernel. Hardware. Kernel. Hardware.

Download Presentation

Setup and Compile Linux 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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Setup and compile linux kernel

Setup and Compile Linux Kernel

Speaker: Yi-Ji Jheng

Date: 2007.10.31


Outline

Outline

  • Understand Linux Kernel

  • Setup and Compile Linux Kernel

  • Setup and Compile micro-Linux Kernel


Understand linux kernel

UNDERSTAND LINUX KERNEL


Where is kernel

Where is Kernel ?

User

Shell

Shell, KDE, AP.

Kernel

Hardware

Kernel

Hardware


What is kernel

What is Kernel ?

  • Kernel(widely)

    • Code

      • Used by application

      • Control hardware

    • Hardware driver

      • Modularization of driver

        • Dynamic

        • Static


Role of kernel when boot 1 2

Role of Kernel when boot (1/2)

  • 1. Boot

    • Turn on PC

  • 2. Read BIOS

    • Know boot device of sequence

  • 3. Read MBR(Master Boot Record) on H.D.

    • If the boot device is H.D. that we set


Role of kernel when boot 2 2

Role of Kernel when boot (2/2)

  • 4. Execute the Boot Loader

    • We use GRUB that is a kind of Boot Loader

      • Load Kernel in main memory

  • 5. Kernel work

    • Decompress itself

    • Know File System *

    • Mount “/” and load modules

    • Run

      • Detect and drive hardware

  • 6. Run first program - init


Why need to make kernel

Why need to make kernel ?

  • Stable

    • Make system match your hardware

  • New hardware support

  • Other

    • Embedded system


Get linux kernel

Get Linux Kernel

  • http://www.kernel.org/

  • 交大資科:ftp://linux.cis.nctu.edu.tw/kernel/

  • 義守大學:http://ftp.isu.edu.tw/pub/Linux/kernel/


Setup and compile linux kernel1

Setup and Compile Linux Kernel


Setup 1 2

Setup (1/2)

  • #tar zxvf linux-2.4.25.tar.gz

  • #cd ./linux-2.4.25

  • #make mrproper

    • Clean all of old *.o

  • #cp /boot/config-2.4.20-8 ./.config

    • Use default (Host Linux) setup to modify


Setup 2 2

Setup (2/2)

  • #make menuconfig

    • A text mode to select modules that we want

    • Press “Y”, means to include in Kernel

    • Press “M”, means to be modules

    • Press “N”, means not to be modules and don’t include in Kernel


Modify scsi setup

Modify SCSI setup

  • <M>SCSI support --> <*>

  • <M>SCSI disk support --> <*>

  • SCSI low-level drivers

    <M>BusLogic SCSI support ---> <*>

  • Save and quit


Make kernel 1 2

Make Kernel (1/2)

  • #make dep

    • Check dependency

  • #make bzImage

    • Make Kernel and compress to bzImage

  • #make modules


Make kernel 2 2

Make Kernel (2/2)

  • #make modules_install

    • After install, modules would locate in

      /lib/modules/<kernel version>

  • #cp -a ./arch/i386/boot/bzImage /boot/bzImage-2.4.25

    • Install Kernel by manual


Modify grub

Modify GRUB

  • #vi /boot/grub/grub.conf

    title Red Hat Linux (2.4.25)

    root (hd0,0)

    kernel /bzImage-2.4.25 ro root=/dev/sda2

  • Save and quit


Reboot

Reboot

  • Reboot and select your new Kernel


Setup and compile micro linux kernel

Setup and Compile micro-Linux Kernel


Setup

Setup

  • #cd ./linux-2.4.25

  • #make clean

  • #make menuconfig

    • Disable all modules, unless mention below

    • Tip : disable all modules first before you want to select


Processor type and features

Processor type and features

  • Processor type and features --->

    (386) Processor family


General setup

General setup

  • General setup --->

    [*] Networking support

    [*] PCI support

    (Any) PCI access mode

    (ELF) Kernel core (/proc/kcore) format

    [*] Kernel support for ELF binaries


Networking options

Networking options

  • Networking options --->

    [*] Packet socket

    [*] Unix domain sockets

    [*] TCP/IP networking

    [*] IP: multicasting


Scsi support

SCSI support

  • SCSI support --->

    [*] SCSI support

    [*] SCSI disk support

    [*] Probe all LUNson each SCSI device

  • SCSI low-level drivers --->

    [*] BusLogicSCSI support


Network device support

Network device support

  • Network device support --->

    [*] Network device support

  • Ethernet (10 or 100Mbit) --->

    [*] Ethernet (10 or 100Mbit)

    [*] EISA, VLB, PCI and on board controllers

    [*] AMD PCnet32 PCI support


Character devices

Character devices

  • Character devices --->

    [*] Virtual terminal

    [*] Support for console on virtual terminal

    [*] Standard/generic (8250/16550 and compatible UARTs) serial support


File systems

File systems

  • File systems --->

    [*] Ext3 journallingfile system support

    [*] /proc file system support

    [*] Second extended fssupport


Console drivers

Console drivers

  • Console drivers --->

    [*] VGA text console


Modify version of information

Modify version of information

  • #vi ./include/linux/version.h

    #define UTS_RELEASE "2.4.25-min"


Make kernel

Make Kernel

  • #make dep

  • #make bzImage

  • #cp -a ./arch/i386/boot/bzImage /boot/bzImage-2.4.25-min


Modify grub1

Modify GRUB

  • #vi /boot/grub/grub.conf

    title Red Hat Linux (2.4.25-min)

    root (hd0,0)

    kernel /bzImage-2.4.25-min ro root=/dev/sda2

  • Save and quit


Reboot1

Reboot

  • Reboot and select your new Kernel


Replenish

REPLENISH


Kernel vs file system

Kernel vs. File System

  • If Kernel don’t know your File System

    • Must make a Initrd(Initial RAM Disk)

    • linuxrc that can let Kernel know File System of modules

  • Kernel can know File System after it use Initrd to load module first


  • Login