免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 948 | 回复: 0
打印 上一主题 下一主题

arm linux kernel [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-12-25 22:04 |只看该作者 |倒序浏览
some tips:
1. Under the ARM kernel tree, you will find a suffix to the kernel version number: -rmkN, or -vrsN where 'N' is the patch release number.   
2. Other maintainers, such as Nicolas Pitre, may produce additional patches, and these will add an additional suffix to denote their version. Nicolas Pitre's patches add a -np suffix, eg 2.4.21-rmk2-np1.
3. Some files may be named (eg) pre-patch-x.y.z-rmkN.gz. These are alpha or beta patches, which are probably unstable.
4. Some kernels are based on the Alan Cox series of kernels. These have names similar to patch-x.y.z-acm-rmkN.gz where x.y.z is Linus' version number and m is Alan's version number. In this case, you will need to obtain Alan Cox's corresponding patch from the kernel.org servers, in the directory /pub/linux/kernel/people/alan/linux-2.4/.
5. after unzip linux kernel, you need to patch the arm kernel:
bash$ cd linux-2.4.26
bash$ zcat ../patch-2.4.26-vrs1.gz | patch -p1
6. kernels later than 2.6.0-test2 do not require a -rmk or -vrs patch to be applied since ARM architecture support is already merged.
7. Configuration of the kernel build environment
Normally, the kernel build system will build the kernel for the native machine architecture. This is not appropriate when cross compiling, so you will need to change two lines in the top level kernel Makefile. Examine the top level Makefile
in an editor and find the definitions for ARCH and CROSS_COMPILE. On 2.4.x kernels, they will look like this:
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
[...]
CROSS_COMPILE   =
and on 2.6.x kernels:
ARCH            ?= $(SUBARCH)
CROSS_COMPILE   ?=
Edit these two lines to read:ARCH                ?= arm
CROSS_COMPILE        ?= /usr/local/bin/arm-linux-
replacing /usr/local/bin/arm-linux- with the path to your ARM Linux toolchain.
This completes the configuration of the top level kernel makefile. The next step is to configure the kernel build to select the drivers that your platform requires.
You may like to read
linux/README
and
linux/Documentation/arm/README
before proceeding. Both these files provide further useful information which may be specific to your kernel version.
8. Configuration of the kernel sources
Configuration of 2.4 kernels
For 2.4 kernels use _config
format, for example:

  • a5k_config
  • ebsa110_config
  • netwinder_config
  • rpc_config
  • assabet_config

You should select one of these as the "basic" configuration as follows, and run make oldconfig immediately afterwards:        bash$ make netwinder_config
        bash$ make oldconfig
The oldconfig step will prompt you for any new configuration options which may have been added since the default machine configuration file was submitted. It is normally safe to say 'N' to these new options.
Note: If you want to change the configuration via make xxx_config, please remove the file linux/.config immediately prior to executing this command.

Configuration of 2.6 kernels

For 2.6 kernels, the process is similar. Use _defconfig to select the machine, eg:
        bash$ make netwinder_defconfig
In this case, there is no need to run a separate oldconfig step.
9. Compiling the kernel source
If you are only installing the kernel source tree for other programs, then you have finished. If you want to compile up a new kernel, type the following commands:
        bash$ make clean
        bash$ make dep
        bash$ make zImage
        bash$ make modules
The final two commands will actually compile the kernel and the kernel modules.
Note: With 2.6 kernels, the make dep stage is not necessary.
10. Installing the kernel
After the kernel has successfully compiled, you should have the kernel image, arch/arm/boot/zImage. What you do next depends if you are cross compiling or not.
11. Installing a native kernel
back the current kernel and modules
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#
install the new modules
bash# cd $HOME/linux
        bash# make modules_install
        bash#
install the new kernel
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.
12. running loadmap
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!
13. 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.



本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/6247/showart_221100.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP