UBOOT引导内核uImage问题
来源:互联网 发布:淘宝客服难学吗 编辑:程序博客网 时间:2024/04/28 05:19
【转】UBOOT引导内核uImage问题
UBOOT引导内核uImage问题
现象:
[u-boot@MINI2440]# boot
dm9000 i/o: 0x20000300, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 08:08:11:18:12:27
operating at 100M full duplex mode
Using dm9000 device
TFTP from server 192.168.1.62; our IP address is 192.168.1.144
Filename 'uImage'.
Load address: 0x30008000
Loading: T #################################################################
#################################################################
##########################################
done
Bytes transferred = 2517092 (266864 hex)
## Booting kernel from Legacy Image at 30008000 ...
Image Name: Linux-2.6.32.2-FriendlyARM
Created: 2010-07-19 11:41:56 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2517028 Bytes = 2.4 MB
Load Address: 30008000
Entry Point: 30008000
Verifying Checksum ... OK
XIP Kernel Image ... OK
OK
Starting kernel ...
data abort
pc : [<30008008>] lr : [<33fa6500>]
sp : 33f3dd24 ip : 00000000 fp : 30008000
r10: 33fc2f08 r9 : 000007cf r8 : 33f3ffe0
r7 : 33f3ffc4 r6 : 33f4131a r5 : 30000100 r4 : 00000000
r3 : 00000000 r2 : 30000100 r1 : 000007cf r0 : 00000000
Flags: nzCv IRQs off FIQs off Mode SVC_32
Resetting CPU ...
resetting ...
分析:
uImage的制作办法是make uImage, 其中的mkimage: /usr/local/bin/mkimage工具来自UBOOT编译结果。
原来为了便于多内核引导,u-boot的mkimage会在kernel前加上0x40(64bytes)的头,真正的内核入口就变成了0x30008040了。而在新版2.6.32的加载地址和入口点地址相同,所以就造成abort……
解决办法
1. 手动制作uImage:
./mkimage -A arm -O linux -T kernel -C none -a 0x30008000 -e 0x30008040 -n mini2440 -d zImage uImage
2.修改内核
linux-2.6.32.2/arch/arm/boot/Makefile
MKIMAGE := $(srctree)/scripts/mkuboot.sh
quiet_cmd_uimage = UIMAGE $@
cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux -T kernel \
-C none -a $(LOADADDR) -e $(STARTADDR) \
-n 'Linux-$(KERNELRELEASE)' -d $< $@
ifeq ($(CONFIG_ZBOOT_ROM),y)
$(obj)/uImage: LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT)
else
$(obj)/uImage: LOADADDR=$(ZRELADDR)
endif
# Note: the following conditions must always be true:
# ZRELADDR == virt_to_phys(PAGE_OFFSET + TEXT_OFFSET)
# PARAMS_PHYS must be within 4MB of ZRELADDR
# INITRD_PHYS must be in RAM
ZRELADDR := $(zreladdr-y)
PARAMS_PHYS := $(params_phys-y)
INITRD_PHYS := $(initrd_phys-y)
ifeq ($(CONFIG_THUMB2_KERNEL),y)
# Set bit 0 to 1 so that "mov pc, rx" switches to Thumb-2 mode
$(obj)/uImage: STARTADDR=$(shell echo $(LOADADDR) | sed -e "s/.$$/1/")
else
$(obj)/uImage: STARTADDR=$(LOADADDR)
endif
现象:
[u-boot@MINI2440]# boot
dm9000 i/o: 0x20000300, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 08:08:11:18:12:27
operating at 100M full duplex mode
Using dm9000 device
TFTP from server 192.168.1.62; our IP address is 192.168.1.144
Filename 'uImage'.
Load address: 0x30008000
Loading: T #################################################################
#################################################################
##########################################
done
Bytes transferred = 2517092 (266864 hex)
## Booting kernel from Legacy Image at 30008000 ...
Image Name: Linux-2.6.32.2-FriendlyARM
Created: 2010-07-19 11:41:56 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2517028 Bytes = 2.4 MB
Load Address: 30008000
Entry Point: 30008000
Verifying Checksum ... OK
XIP Kernel Image ... OK
OK
Starting kernel ...
data abort
pc : [<30008008>] lr : [<33fa6500>]
sp : 33f3dd24 ip : 00000000 fp : 30008000
r10: 33fc2f08 r9 : 000007cf r8 : 33f3ffe0
r7 : 33f3ffc4 r6 : 33f4131a r5 : 30000100 r4 : 00000000
r3 : 00000000 r2 : 30000100 r1 : 000007cf r0 : 00000000
Flags: nzCv IRQs off FIQs off Mode SVC_32
Resetting CPU ...
resetting ...
分析:
uImage的制作办法是make uImage, 其中的mkimage: /usr/local/bin/mkimage工具来自UBOOT编译结果。
原来为了便于多内核引导,u-boot的mkimage会在kernel前加上0x40(64bytes)的头,真正的内核入口就变成了0x30008040了。而在新版2.6.32的加载地址和入口点地址相同,所以就造成abort……
解决办法
1. 手动制作uImage:
./mkimage -A arm -O linux -T kernel -C none -a 0x30008000 -e 0x30008040 -n mini2440 -d zImage uImage
2.修改内核
linux-2.6.32.2/arch/arm/boot/Makefile
MKIMAGE := $(srctree)/scripts/mkuboot.sh
quiet_cmd_uimage = UIMAGE $@
cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux -T kernel \
-C none -a $(LOADADDR) -e $(STARTADDR) \
-n 'Linux-$(KERNELRELEASE)' -d $< $@
ifeq ($(CONFIG_ZBOOT_ROM),y)
$(obj)/uImage: LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT)
else
$(obj)/uImage: LOADADDR=$(ZRELADDR)
endif
# Note: the following conditions must always be true:
# ZRELADDR == virt_to_phys(PAGE_OFFSET + TEXT_OFFSET)
# PARAMS_PHYS must be within 4MB of ZRELADDR
# INITRD_PHYS must be in RAM
ZRELADDR := $(zreladdr-y)
PARAMS_PHYS := $(params_phys-y)
INITRD_PHYS := $(initrd_phys-y)
ifeq ($(CONFIG_THUMB2_KERNEL),y)
# Set bit 0 to 1 so that "mov pc, rx" switches to Thumb-2 mode
$(obj)/uImage: STARTADDR=$(shell echo $(LOADADDR) | sed -e "s/.$$/1/")
else
$(obj)/uImage: STARTADDR=$(LOADADDR)
endif
- UBOOT引导内核uImage问题
- uboot加载 big uImage问题
- uboot 自引导内核
- uboot引导linux内核
- uboot TFTP引导内核
- uboot nfs引导内核
- uboot引导linux内核
- uboot支持uImage格式的内核
- 内核运行之前的引导程序uboot --- 地址问题
- 内核运行之前的引导程序uboot --- 地址问题
- uboot自动引导内核参数
- uboot引导内核的经验总结
- Hi3536 uboot引导内核全过程
- 关于内核uImage和文件系统(rootfs.ext2.gz.uboot)
- uboot直接引导zImage内核镜像
- uboot 的bootm 引导内核的过程
- uboot 引导Linux 内核步骤--经典
- uboot引导linux内核命令bootm
- 任意泛型序列化工具类
- 如何使cron发送错误信息邮件
- 我的2013年oracle成长计划
- MVC4 基础
- android面试集锦-java基础10
- UBOOT引导内核uImage问题
- Android的引用计数(强弱指针)技术及一些问题
- 第十次上机实验
- Android系统的内存管理研究
- android面试集锦-java基础11
- 用pngcrush反编译ios app 资源文件
- nginx-第一次学习
- vb.net GDI窗体
- 上篇日本人经营之道 一利用人性的弱点引人上钩