Chinaunix首页 | 论坛 | 博客
  • 博客访问: 298468
  • 博文数量: 134
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 118
  • 用 户 组: 普通用户
  • 注册时间: 2013-08-01 14:02
文章分类

全部博文(134)

文章存档

2015年(2)

2014年(4)

2013年(128)

分类: 嵌入式

2013-11-12 18:15:53

原文地址:编译内核 作者:丫叩酱


1) 解压 mc2440 下的 linux-2.6.15.4.tar.bz2 到 /home/akaedu/下,得到文件夹linux-2.6.27
$ tar zxvf linux-2.6.15.4.tar.bz2

2) 进入内核目录
$ cd linux-2.6.27

3) 修改Makefile,找到 (此处不用修改Makefile,)
ARCH ?= $(SUBARCH)
CROSS_COMPILE ?= 
    改为:
ARCH ?= arm (后面不能有空格)
CROSS_COMPILE ?= arm-linux-

4) 对内核打patch (打patch不要重复打)
$ patch -p1 <../patch-2.6.27-aka (忽略最外层名字的改变,进到二级目录打patch)

5) 以内核源代码自带的smdk2440基本配置文件为基础,使用menuconfig定制内核 (确认你的主机上安装了libncurses-dev软件包)
$ cp arch/arm/configs/akae2440_defconfig .config
$ make menuconfig
    查看配置菜单中的如下选项(有些已经默认选中):
#1 选中 Floating point emulation——>NWFPE math emulation
(由于ARM920T没有浮点协处理器,浮点指令需要其他指令仿真实现)
#2 选中 File systems——>Pseudo filesystems——> /proc file system support
  Sysctl support(/proc/sys)
  sysfs file system support
  Virtual memory file system support(former shm fs)
  Tmpfs POSIX Access control Lists
#3 不需要改变Boot options——>Default kernel command string
(因为bootloader中的内核启动参数会取代这里的设置)
#4 选中 Device Drivers——>Network device support——>Ethernet(10 or 100Mbit)——>CS8900A support
  选中 File systems——>Network File Systems——>NFS client support
   NFS client support for NFS version3
   NFS client support for the NFSv3 ACL protocol extension
   Root file system on NFS
#5 选中 Device Drivers——>Memory Technology Devices(MTD)——>MTD partitioning support
 NAND Device Support for S3C2410/S3C2440 SoC
 S3C2410 NAND driver debug
#6 选中 File systems——>Miscellaneous filesystems——>YAFFS2 file system support
 Auto select yaffs2 format
 cache short names in RAM
 Compressed ROM file system support (cramfs)
#7 选中 Device Drivers——>Graphics support——>Support for frame buffer devices——>Enable firmware EDID
  Enable video Mode Handling Helpers
  S3C2410 LCD framebuffer support
#8 选中 Device Drivers——>USB support——>Support for Host-side USB——>OHCI HCD support
  选中 Device Drivers——>Input device support——>Mouse interface,
设置屏幕分辨率Horizontal screen resolution和Vertical screen resolution为 1024 和 768
#9 选中 Device Drivers——>Real time clock——> Set system time from RTC on startup and resume
      /sys/class/rtc/rtcN (sysfs)
      /proc/drive/rtc (procfs for rtc0)
      /dev/rtcN (character devices)
      Test driver/device
#10 如果不希望在/dev目录下生成大量伪终端设备文件,可以取消选择 Device Drivers——>Character devices——>Legacy (BSD) PTY support

    配置完成后用make命令编译内核,这个过程需要较长时间,编译好的内核位于~/linux-2.6.27/arch/arm/boot/zImage。
    现在将自己编译好的内核下载到开发板,看系统能不能正常启动(用nfs)
阅读(474) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~