今天把android内核交叉编译后移植到我的2440开发板,下面是一些心得。

1、从http://code.google.com/p/android/downloads/list上下载linux-2.6.25-android-1.0_r1.tar.gz
2、解压到任意目录下,解压命令为tar tar –zxvf linux-2.6.25-android-1.0_r1.tar.gz。
3、解压2440板的交叉编译工具arm-linux-gcc-3.4.1.tar.bz2命令为tar xjvf arm-linux-  3.4.1.tar.bz2,将文件解压到用户目录,如/usr/local/arm/下。
4、添加当前路径进入环境变量,命令export PATH=/usr/local/arm/3.4.1/bin:$PATH
5、进入内核文件夹,如cd ~/kernel.git/
6、修改Makefile文件,gedit Makefile,如下
   CROSS_COMPILE        ?= arm-linux-
7、运行make menuconfig
  (1)确保System Type ---> ARM system type ()中的内容为Samsung S3C2410, S3C2412, S3C2413, S3C2440, S3C2442, S3C2443
  (2)确保System Type ---> S3C2410 Machines --->SMDK2410/A9M2410被勾选
   (3)取消选择与Goldfish相关的内容,如下:
Device Drivers ---> Character devices ---> < > Goldfish TTY Driver
Device Drivers ---> Power supply class support ---> < >   Goldfish battery driver (NEW)
Device Drivers ---> Real Time Clock ---> < >   GOLDFISH (NEW)
Device Drivers ---> Graphics support ---> Support for frame buffer devices ---> < >   Goldfish Framebuffer
device drivers->Graphics support->Console display driver support->[]VGA text console
  (4)选择S3C2410 LCD相关的内容
Device Drivers ---> Graphics support ---> Support for frame buffer devices ---> <*>   S3C2410 LCD framebuffer support
Device Drivers ---> Graphics support ---> Bootup logo ---> Standard black and white Linux logo
Device Drivers ---> Graphics support ---> Bootup logo ---> Standard 16-color Linux logo
Device Drivers ---> Graphics support ---> Bootup logo ---> Standard 224-color Linux logo
  (5) 选中Android内核必须选项
General setup ---> Use full shmem filesystem
General setup ---> Enable Android's Shared Memory Subsystem
System Type ---> Support Thumb user binaries
Device Drivers ---> Android ---> Android log driver
Device Drivers ---> Android ---> <*> Binder IPC Driver
  (6) 尽量选中Android内核可选选项
Device Drivers ---> Android ---> RAM buffer console
Device Drivers ---> Android ---> Android timed gpio driver
Device Drivers ---> Android ---> Only allow certain groups to create sockets
  (7)退出并保存.config
8、使用命令make zImage生成映像。

出现的一些问题
问题一:
  CC      arch/arm/kernel/asm-offsets.s
  cc1: error: invalid option `abi=aapcs-linux'
  make[1]: *** [arch/arm/kernel/asm-offsets.s] Error 1
  make: *** [prepare0] Error 2
解决方法:
    关闭kernel features -->Use EABI。

问题二:
  drivers/video/console/vgacon.c:494: error: `PCIMEM_BASE' undeclared (first use in this function)
  drivers/video/console/vgacon.c:494: error: (Each undeclared identifier is reported only once
解决方法:
  device drivers->
   Graphics support->
      Console display driver support->
         [ ]VGA text console(取消)

 

以上步骤中,省略了内核移植中的nandflash、lcd及yaffs2文件系统的支持,有机会补上去。

     下载到开发板上就可以了,能够启动起来,遗憾的是,这个内核没能启动我的yaffs2根文件系统。我有点纳闷了,不知道错在哪里,明明已经让内核支持了yaffs2文件系统了,但是下载内核及根文件系统后,重新启动Linux系统,到内核启动完成,要加载根文件系统的地方就中断了,具体错误如下:


待解决。

Logo

更多推荐