Linux Porting - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

Linux Porting

Description:

Created directory : /usr/src/linux-2.4/arch/i386/boot ... [RT] http://kldp.org - Korea Linux Documentation Project [IP] Linux IP Networking, Glenn Herrin ... – PowerPoint PPT presentation

Number of Views:23
Avg rating:3.0/5.0
Slides: 17
Provided by: sumi4
Category:
Tags: linux | porting

less

Transcript and Presenter's Notes

Title: Linux Porting


1
Linux Porting Routing
  • 9th May 2006
  • Kim Su Min
  • CNR, EECS, KAIST
  • smkim_at_cnr.kaist.ac.kr

2
Contents
  • Linux Overview
  • Linux Compiling
  • Routing in Linux
  • Announcements
  • Pre-Lab
  • Main-Lab
  • References

3
Linux Overview
  • Linux
  • 1989, Linuz Torvalds (Finland)
  • Free Operating System
  • Open Source Code
  • Linux is composed of
  • Boot
  • Scheduler multi-process
  • Memory-management virtual memory
  • File system
  • Network protocols and routing facilities
  • Terminal handling

4
Linux Compiling (1/6)
  • Kernel version
  • Redhat 9.0 supports kernel version 2.4.20
  • We will use kernel version 2.4.21
  • Download kernel source
  • Access to ftp.kr.kernel.org
  • Then, access to /pub/linux/kernel/v.24/
  • Download linux-2.4.21.tar.gz (33.8MB)
  • Decompress this file in temporal directory
    (/usr/src/linux2)
  • These are kernel source files

5
Linux Compiling (2/6)
  • Architecture of kernel source

6
Linux Compiling (3/6)
  • Configuration
  • Location kernel source directory
    (/usr/src/linux2)
  • Command make menuconfig (or xconfig)
  • Choose options
  • exclude
  • include in kernel
  • M install in kernel as module

7
Linux Compiling (4/6)
  • Kernel compile
  • Location kernel source directory(/usr/src/linux2
    )
  • Command make dep
  • Make dependency between source and reference
    files to compile kernel
  • Command make clean
  • Delete unnecessary files (object, temporal files,
    etc)
  • Command make bzImage
  • Create kernel image file
  • Created directory /usr/src/linux-2.4/arch/i386/b
    oot
  • Command make modules make modules_install
  • Make object files (modules) about device driver
    of Ethernet Cardand copy them into module
    directory
  • Copy this new kernel
  • cp /usr/src/linux-2.4/arch/i386/boot/bzImage
    /boot/linux-2.4.21

8
Linux Compiling (5/6)
  • Edit LILO
  • Command vi /etc/lilo.conf
  • Add to the following into the configuration file

9
Linux Compiling (6/6)
  • Rebooting
  • Command shutdown r now or reboot
  • (cf. Halt Command shutdown h now or halt)
  • LILO is executed every booting time.
  • LInux LOader
  • Kernel Selection (choosing kernel 2.4.21)

10
Routing in Linux (1/3)
  • Routing
  • Store-and-Forward

11
Routing in Linux (2/3)
  • Routing Table
  • Routing Table
  • Route command (show route table) /sbin/route
  • Route Add command route add host
    143.248.148.155 gw 143.248.148.22 eth0
  • Result of Route Add
  • Route Delete command route del host
    143.248.148.155 eth0

12
Routing in Linux (3/3)
  • Routing Cache
  • Route cache command (show route cache table)
    /sbin/route C
  • IP forwarding
  • Command echo 1gt /proc/sys/net/ipv4/ip_forward
  • Routing test
  • Command ping, traceroute

13
Pre-Lab
  • Find all options related with routing in kernel
    compile.(during make menuconfig)
  • Explain the differences among bridge, router, and
    gateway. NET
  • Survey linux commands to check routing table. (at
    least 2) RT
  • Check the meaning of each entry in routing table
    and when and where the entry is used. TCP, RT
  • What is hashing.
  • How does Linux deal with excessive incoming
    traffic that exceeds its handling ability.
  • Due date pm 1159, 16th May (Tuesday)
  • Location Box in the Chips building 1st floor

14
Main-Lab (1/2)
  • Compile kernel
  • Use Redhat 9.0 (And append the kernel 2.4.21)
  • Compile kernel with minimum options to support
    routing according to the process in the document
  • Modify lilo.conf
  • Reboot and select new kernel
  • Check if the new kernel behaves correctly
  • Modify routing table
  • Check current routing table
  • Modify it to make A always send packets to C
    through B(A and B are Linux machine and in the
    same LAN, C can be any arbitrary host in
    Internet)

15
Main-Lab (2/2)
  • Modify routing code
  • Explain the functions net_bh(), ip_rcv(),
    ip_route_input(), ip_route_input_slow(). And
    insert a code line in each function in order to
    print the function name when each function is
    executed.
  • Explain the ICMP redirect message and the
    function ip_rt_send_redirect(). And insert a code
    line in this function in order to print ICMP
    message sent when the ICMP redirect message is
    sent. (To see ICMP redirect message, C in 2.b
    must be in the same LAN.) TCP
  • ltHintgt
  • - net_bh() /proc/sys/net/core/dev.c
  • - ip_rcv() /proc/sys/net/ipv4/ip_input.
    c
  • - ip_route_input() /proc/sys/net/ipv4/r
    oute.c
  • - ip_route_input_slow()
    /proc/sys/net/ipv4/route.c
  • - ip_rt_send_redirect()
    /proc/sys/net/ipv4/route.c
  • - print function for kernel printk()
    usage is similar to printf()
  • exgt printk(net_bh() has been
    executed!!)
  • Due date pm 1159, 26th May (Friday)
  • Location Box in the Chips building 1st floor

16
References
  • OS The Design and Implementation of the 4.4 BSD
    Operating System, Marshall K. McKusick, and 3
    more, Addison Wesley
  • TCP TCP/IP illustrated volume 1, Stevens,
    Addison Wesley
  • NET An Engineering Approach to Computer
    Networking, Keshav, Addison Wesley
  • RT http//kldp.org
  • - Korea Linux Documentation Project
  • IP Linux IP Networking, Glenn Herrin
Write a Comment
User Comments (0)
About PowerShow.com