免费注册 查看新帖 |

Chinaunix

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

Imigrate Linux to ARM/XSCAL -- Compile Kernel [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-05-04 21:32 |只看该作者 |倒序浏览

       
       
       
       
       
       
       
       
Before
starting to compile kernel, please read the doc carefully
[color="#000000"]。

[color="#000000"]http://www.arm.linux.org.uk/docs/kerncomp.php


       
       
       
       
       
       
       
       
1. Get kernel package
From
[color="#0000ff"]http://www.kernel.org
download source package and patch(option)
      linux-2.6.21.tar.bz2
      copy
lnux-2.6.21.tar.bz2 and path-2.6.21.bz2 into $HOME(from kerncomp.php
doc I know it is better putting kernel into $HOME).
After unpacking
linux-2.6.21.tar.bz2, Change into the newly created
directory(linux-2.6.21) and apply the patch files, eg:
        bash$ cd linux-2.6.21
        bash$ cp ~/patch-2.6.21.bz2
.
        bash$ bzip2 -dc
patch-2.6.21.bz2  | patch -p1 --dry-run
      bash$ bzip2 -dc
patch-2.6.21.bz2  | patch -p1
** For
this version kernel it's not necessary to path, since the kernel
source code contains the path context.
        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.6.x kernels:
ARCH            ?= $(SUBARCH)
[color="#000000"]CROSS_COMPILE   ?=
Edit these two lines to read:
ARCH            ?= arm
[color="#000000"]CROSS_COMPILE   ?= /usr/local/bin/arm-linux-
replacing
/usr/local/bin/arm-linux- with the path to your ARM Linux
toolchain. For me it's
/home/cknr34/develops/arm-linux-tools-20061213/bin/arm-linux-
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.
2. configure
kernel

        There
are many default configure files in /usr/src/linux/arch/arm/configs .
It's a good way for us choosing a similar configure file to modify
for our develop board.
Tips:
lubbock_defconfig is for ARM/XScale PXA25X ; mainstone_defconfig is
for ARM/XScale PXA27X

Configuration
of 2.6 kernels

For
2.6 kernels, the process is similar. Use [color="#000000"]_defconfig
to select the machine, eg:
[color="#000000"]        bash$ make netwinder_defconfig
In
this case, there is no need to run a separate [color="#000000"]oldconfig
step.
For
me, I compile PXA27X main board use the following command, eg:
[s3sdf@power
linux-2.6.21]$ make mainstone_defconfig
It
will create .config file in linux-2.6.21 directory.
3. Compile
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          #full build
      bash$ make zImage
[color="#000000"]        bash$ make modules
The final two commands will
actually compile the kernel and the kernel modules.
I
am lucky that a file of zImage is created in
linux-2.6.21/arch/arm/boot directory. It's with 1179828 byte size.
   
               
               
               
               
               

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

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP