fl2440的内核移植总结

来源:互联网 发布:网络技术交流 编辑:程序博客网 时间:2024/06/08 12:23

以下是基于fl2440开发板子上的内核移植实验总结

1.      解码内核源码包

2.      修改makefile中的arch和交叉工具链

3.      ARCH            ?= arm

4.      CROSS_COMPILE   ?= arm-­linux­  (前提交叉工具链已经加入Path环境变量)

也可以将路径写死,这样更方便

CROSS_COMPILE     ?=/work/cross_compile_3.4.1/usr/local/arm/3.4.1/bin/arm-linux-

也可以在make是传入

如:make ARCH=ia64 CROSS_COMPILE= arm­linux­

5.      将默认config复制到根目录下,改名为.config,以备mak menuconfig 使用

 cp arch/arm/configs/smdk2410_defconfig .config

6.      make menucofnig 配置内核功能支持(包括驱动加载方式,文件系统支持等)

1.奇怪,怎么不是猜的节目而命令行界面,相当于make config

原因:没有启动系统中的图形引擎,我们startx,图形引擎启动

但出现

root@ubuntu:/home/hfl/hflsamb/linux-kernel/linux-2.6.28.7#sudo make menuconfig

 *** Unable to find the ncurses libraries orthe

 *** required header files.

 *** 'make menuconfig' requires the ncurseslibraries.

 ***

 *** Install ncurses (ncurses-devel) and tryagain.

原来是没有缺少一个库文

sudo apt-get install libncurses5-dev

再次make menuconfig

2.默认情况下是pc基础x86配置,必须以下命令

sudo make menuconfig ARCH=arm

为嵌入式配置。

3.为什么在Kconfig中新添加的一个配置项,在make menuconfig中为什么没有出现,或者出现了不能选择M,而只能选择YN

 原因;如果Kconfig某个选择中有depend by语法,必须要依赖条件为真(上一级开关打开)才会出现该选择,否则不满足条件不会出现该选项。

如果在内核配置中,

┌──────────Linux Kernel Configuration────────────────────┐
│  Arrow keysnavigate the menu.  <Enter> selects submenus--->.  Highlightedletters are hotkeys.  Pressing <Y> includes,<N> excludes, <M> modularizes features.  Press<Esc>  to exit, <?> for Help, </> for Search.  Legend:[*] built-in  [ ] excluded  <M> module < >modulecapable                                                                             
│ ┌───────────────────────────────────────────┐
│ │             Generalsetup  --->                                                      │
│ │         [*] Enable loadable modulesupport  --->                                     │
│ │         -*- Enable the blocklayer  --->                                             │
│ │             SystemType  --->                                                        │
│ │             Bus support  --->                                                        │
│ │             KernelFeatures  --->                                                    │
│ │             Bootoptions  --->                                                       │
│ │             CPU PowerManagement  --->                                               │
│ │             Floating pointemulation  --->                                           │
│ │             Userspace binaryformats  --->                                           │
│ │             Power managementoptions  --->                                           │
│ │         [*] Networkingsupport  --->                                                 │
│ │             DeviceDrivers  --->                                                     │
│ │             Filesystems  --->                                                       │
│ └─────────┴(+)───────────────────────────────│
├────────────────────────────────────────────┤
│                              <Select>    < Exit >    <Help>                          │
└────────────────────────────────────────────┘

必须要选上enalbe loadable moudules  support这个选项,否则就是你定义一个tristate一个配置,也不支持M选择,这个问题被困了很久才发现,一定要谨记。

 

7.    make(或者make zImage

make 默认生成的使vmlinux很大。一般使用压缩格式格式:zImage(由make zImage产生)如果是uboot系统的话,要生成uImage(该镜像是zImage的基础上,由uboot中的工具制作成的,即在zImage的基础上,打一个uboot头而已。

注意zImage在\linux-kernel\linux-2.6.28.7\arch\arm\boot\compressed下生成

vmlinux在内核的根目录下生成。

0 0
原创粉丝点击