Linux内核移植编译时的错误


当我们都配置好以后执行make uImage时,出现了以下的错误信息,根据信息的大概意思是关于vga的支持问题,在这里我直接把关于vga的配置选项去掉不选

Device Drivers

      ---->Graphics support

              ----->Console display driver  support

                      ------>VGA text Console(这个选项不选就能解决此问题)

 

CC      drivers/video/console/dummycon.o

CC      drivers/video/console/vgacon.o
drivers/video/console/vgacon.c: In function 'vgacon_startup':
drivers/video/console/vgacon.c:489: error: 'PCIMEM_BASE' undeclared (first use in this function)
drivers/video/console/vgacon.c:489: error: (Each undeclared identifier is reported only once
drivers/video/console/vgacon.c:489: error: for each function it appears in.)
drivers/video/console/vgacon.c: In function 'vgacon_do_font_op':
drivers/video/console/vgacon.c:1047: error: 'PCIMEM_BASE' undeclared (first use in this function)
make[3]: *** [drivers/video/console/vgacon.o] 错误 1
make[2]: *** [drivers/video/console] 错误 2
make[1]: *** [drivers/video] 错误 2
make: *** [drivers] 错误 2
[root@localhost linux-2.6.22.6]#

上面这个问题解决后,我再次执行make uImage 命令,结果出来以下错误信息。

In file included from arch/arm/boot/compressed/misc.c:30:
include/asm/arch/uncompress.h:61: warning: conflicting types for built-in function 'putc'
  LD      arch/arm/boot/compressed/vmlinux
  OBJCOPY arch/arm/boot/zImage
  Kernel: arch/arm/boot/zImage is ready
  UIMAGE  arch/arm/boot/uImage
"mkimage" command not found - U-Boot images will not be built
  Image arch/arm/boot/uImage is ready
[root@localhost linux-2.6.22.6]#
到这边我们可以从上面的信息看到,已经生成vmlinux,Image,zImage,但是还没有生成U-BOOT格式的内核映象文件uImage文件,同时也提示我们mkimage命令没找到。对于不能直接生成uImage的内核,制作方法大家可以去看U—BOOT根目录下的README文件。(还没理解的问题:在linux-2.6.22.6的根目录下也同时生成一个vmlinux,这两个不知道是不是一样的还没得到验证,但是根据那个提示我想应该是要用compressed下那个。再次努力!!!!!!!!!!!)

此问题的解决方法:

(1)、先cd arch/arm/boot/compressed/

在这里依次执行以下命令
(1)、将vmlinux转换为二进制格式linux.bin文件

arm-linux-objcopy -O binary -R .note -R .comment -S vmlinux linux.bin

          会生成一个linux.bin的文件                 

(2)、压缩

gzip -9 linux.bin

 

这时在该目录会生成一个linux.bin.gz的文件

(3)、构造头部信息(里面包含有文件名称、大小、类型、CRC校验码等)

./mkimage -A arm -O linux -T kernel -C gzip -a 0x30008000 -e 0x30008000 -n "Linux Kernel Image" -d linux.bin.gz uImage(要先把上面生成的linux.bin.gz COPY 到U—BOOT目录tools下才能执行这个命令,不然找不到)

到此就可以生成U-BOOT格式文件uImage了。现在就可以下载uImage并启动它了:

tftp 0x32000000 uImage

bootm 0x32000000

 

关于上面说到的两个vmlinux该用哪一个的问题。

用arch/arm/boot/compressed/vmlinux下的这个时,启动时信息如下:

SMDK2440 # bootm 0x32000000
## Booting image at 32000000 ...
   Image Name:   Linux Kernel Image
   Created:      2009-07-17  12:44:53 UTC
   Image Type:   ARM Linux Kernel Image (gzip compressed)
   Data Size:    1055935 Bytes =  1 MB
   Load Address: 30008000
   Entry Point:  30008000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK

Starting kernel ...

Uncompressing Linux.............................................................
......... done, booting the kernel.

 

用根目录下那个vmlinux时启动信息如下:

 SMDK2440 # bootm 0x32000000
## Booting image at 32000000 ...
   Image Name:   Linux kernel Image
   Created:      2009-07-17  13:32:03 UTC
   Image Type:   ARM Linux Kernel Image (gzip compressed)
   Data Size:    1058086 Bytes =  1 MB
   Load Address: 30008000
   Entry Point:  30008000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK

Starting kernel ...(一直卡在这边)

我想这两个应该是不一样的,但是还没弄清楚?

相关内容