热门关键字:  ubuntu  分区  Fedora  linux系统进程  函数

当前位置 :| 主页>Linux教程>内核研究>

Kernel Compilation

来源: 作者: 时间:2008-02-21 Tag: 点击:

 

  • Installing a native kernel

    Since you are about to upgrade system files, you need to become 'root'. To do this, type:
    	bash$ su
    Password:
    bash#
    It is highly advisable to keep a backup of your current kernel and modules. What you need to do is machine dependent. Note that it is a good idea to always keep a known good previous version of the kernel and modules in case you need to back down to a previous version.

    The following is given as an example (for a 2.4.3-rmk1 kernel):

    	bash# cd /lib/modules
    bash# mv 2.4.3-rmk1 2.4.3-rmk1.old
    bash# cd /boot
    bash# mv vmlinuz vmlinuz.bak
    bash# mv System.map System.map.bak
    bash#
    Now, install the new kernel modules:
    	bash# cd $HOME/linux
    bash# make modules_install
    bash#
    This will copy the modules into the /lib/modules/x.y.z directory. Next, install the kernel image (normally into /boot):
    	bash# cd /boot
    bash# cat $HOME/linux/arch/arm/boot/zImage >vmlinuz
    bash# cp $HOME/linux/System.map .
    bash#

    Note that the command to copy the new kernel image is cat and is not the usual cp. Unix traditionally will not allocate space on the filesystem to sections of files containing zero data, but instead creates "holes" in the file. Some kernel loaders do not understand files with holes in, and therefore using cat in this way ensures that this does not happen.

     

  • Running loadmap

    Loadmap is part of the Linux loader on Acorn machines, as well as EBSA285 machines using EBSA285BIOS with an IDE disk. For other machines, please refer to the documentation for your machine.

    Edit the loader configuration file /etc/boot.conf so that you can boot either the vmlinuz.bak or vmlinuz images. If you place the vmlinuz kernel first, then this will be the default kernel which the kernel loader will use.

    More information can be found by typing man boot.conf.

    Run the boot loader map utility:

    	bash# loadmap -v
    bash#
    to update the maps.

    You have finished, and are now ready to reboot your machine and try out your new kernel! If you experience problems, please go to the "Problems" step below.

     

  • Installing a cross compiled kernel

    Kernel modules are installed into the /lib/modules/x.y.z directory on the target system, though this will normally be a different directory on the host system. Where this directory is depends on your setup, but we will call it $TARGETDIR.

    Install the modules into $TARGETDIR as follows:

    	bash$ make modules_install INSTALL_MOD_PATH=$TARGETDIR
    bash$
    This will place the modules into the $TARGETDIR/lib/modules/x.y.z directory on the host, which can then be placed into an suitable filesystem, or transferred to the target machine. Please also note that you must not install these kernel modules into the hosts root filesystem (eg by omitting INSTALL_MOD_PATH or giving $TARGETDIR as "/"), since they are incompatible with your host kernel and therefore may leave you with an unbootable host system.

    The kernel will be available in $HOME/linux/arch/arm/boot/zImage and the kernel symbol information in $HOME/linux/System.map. Exactly how do install this is outside the scope of this document.

    It is important that you keep the System.map file safe - it contains the symbolic information for this kernel, which will be required if you need to debug or report a problem.

     

  • Reporting Problems

    Please follow the REPORTING-BUGS guide in the kernel source tree. However, please use the linux-arm-kernel mailing list to report problems, rather than the linux-kernel mailing list.



  • 相关文章:
    精通initramfs构建step by step
    Linux利用kexec迅速切换内核
    进程上下文VS中断上下文
    内核通知链 学习笔记
    linux spi子系统驱动分析
    menuconfig 配置选项
    《Linux操作系统内核实习》之练习一
    udev详解
    什么叫微内核,宏内核?
    Linux 信号signal处理机制
    开发简单的 Linux2.6 内核模块
    删除内核的perl脚本
    Linux2.6内核usb gadget驱动移植
    GCC hacks in the Linux kernel
    iomem
    kernel学习的想法
    让自己的驱动支持udev
    linux内核编译步骤
    内核的等待队列
    Linux内核wait_queue深入分析
    升级和删除内核
    SD卡驱动分析2
    Linux Kernel VDSO本地权限提升漏洞
    内核中的TCP的追踪分析-15-TCP(IPV4)的客户端与
    linux 2.6内核可加载模块的编译
    内核模块HelloWorld
    在环回接口上发送一个数据报
    ARP初始化
    1分钟编译FreeBSD内核
    linux设备模型之uart驱动架构分析