用来做视频连接的网站,城市建设模拟游戏网站中文注解,境外服务器,咋样做班级主页网站编译完内核之后#xff0c;会产生zImage,而把它直接导入0x30008000#xff0c;会出现Bad Magic Number.查明是需要将内核加一个0x40大小的头,由mkimage工具来添加.mkimage在编译u-boot时在u-boot-1.1.6/tools下生成,可以为编译的内核添加头信息的.在bootm命令中会解析这个头,…编译完内核之后会产生zImage,而把它直接导入0x30008000会出现Bad Magic Number.查明是需要将内核加一个0x40大小的头,由mkimage工具来添加.mkimage在编译u-boot时在u-boot-1.1.6/tools下生成,可以为编译的内核添加头信息的.在bootm命令中会解析这个头,获得参数.zImage在编译内核时在arch/arm/boot目录下生成。我们需要把zImage用mkimage工具处理一下。mkimage参数的意义如下-A set architecture to arch-O set operating system to os-T set image type to type-C set compression type comp-a set load address to addr (hex)-e set entry point to ep (hex)-n set image name to name-d use image data from datafile-x set XIP (execute in place)首先可以把zImage拷贝到u-boot-1.1.6/tools目录下在此目录下执行如下命令./mkimage -n linux-2.6.26 -A arm -O linux -T kernel -C none -a 0x30007fc0 -e 0x30008000 -d zImage uImage输出信息如下Image Name:linux-2.6.26Created:Tue Jul 28 18:50:26 2009Image Type:ARM Linux Kernel Image (uncompressed)Data Size:1655648 Bytes 1616.84 kB 1.58 MBLoad Address: 0x30007FC0Entry Point:0x30008000可以看出加载地址是0x30007fc0,而入口地址是0x30008000.GEC2410 #tftp 30008000 uImageTFTP from server 192.168.0.50; our IP address is 192.168.0.100Filename uImage.Load address: 0x30008000Loading: ####################################################################################################################################################################################################################################################################################################################################doneBytes transferred 1655712 (1943a0 hex)GEC2410 #bootm 30008000## Booting image at 30008000 ...Image Name:linux-2.6.26Created:2009-07-2810:50:26 UTCImage Type:ARM Linux Kernel Image (uncompressed)Data Size:1655648 Bytes 1.6 MBLoad Address: 30007fc0Entry Point:30008000Verifying Checksum ... OKOKStarting kernel ...(卡死在这儿了)GEC2410 #tftp 30008000 uImageTFTP from server 192.168.0.50; our IP address is 192.168.0.100Filename uImage.Load address: 0x30008000Loading: ####################################################################################################################################################################################################################################################################################################################################doneBytes transferred 1655712 (1943a0 hex)GEC2410 #bootm 30007fc0## Booting image at 30007fc0 ...Bad Magic NumberGEC2410 #tftp 30007fc0 uImageTFTP from server 192.168.0.50; our IP address is 192.168.0.100Filename uImage.Load address: 0x30007fc0Loading: ####################################################################################################################################################################################################################################################################################################################################doneBytes transferred 1655712 (1943a0 hex)GEC2410 #bootm 30008000## Booting image at 30008000 ...Bad Magic NumberGEC2410 #GEC2410 # tftp 0x30007fc0 uImageTFTP from server 192.168.0.50; our IP address is 192.168.0.100Filename uImage.Load address: 0x30007fc0Loading: ####################################################################################################################################################################################################################################################################################################################################doneBytes transferred 1655712 (1943a0 hex)GEC2410 #bootm 30007fc0## Booting image at 30007fc0 ...Image Name:linux-2.6.26Created:2009-07-2810:50:26 UTCImage Type:ARM Linux Kernel Image (uncompressed)Data Size:1655648 Bytes 1.6 MBLoad Address: 30007fc0Entry Point:30008000Verifying Checksum ... OKXIP Kernel Image ... OKStarting kernel ...Uncompressing Linux............................................................................................................ done, booting the kernel.………………….(一大堆信息)从上面可以看出tftp下载的地址和bootm引导的地址是同一个地址且是mkimage的参数 -a 的地址即加载地址而不是入口地址。./mkimage -n linux-2.6.26 -A arm -O linux -T kernel -C none -a 0x30008000 -e 0x30008000 -d zImage uImageCreated:Tue Jul 28 19:21:15 2009Image Type:ARM Linux Kernel Image (uncompressed)Data Size:1655648 Bytes 1616.84 kB 1.58 MBLoad Address: 0x30008000Entry Point:0x30008000入口地址和加载地址一样的时候我在做这个尝试的时候导致开发板重启……。现在能正确引导内核啦但是GEC2410的网卡芯片是CS8900A的芯片要能正确的启动Linux系统还必须添加CS8900A的驱动……