Linux3.6.7中Make uImage的load address 和 Entry Point相同的问题

u-boot-2012.10那里拷贝mkimage工具放在/usr/bin目录下,make uImage发现load address 和entry point都是0x50008000.结果u-bootbootm命令一直starting kernel......

手工entry point=0x50008040就可以启动了。那么,怎样让make uImage自动entry point设置为50008040呢?网上资料arch/arm/boot/里面的Makefile文件


$(obj)/uImage: STARTADDR=$(LOADADDR)
改为
$(obj)/uImage: STARTADDR=$(shell echo $(LOADADDR) | sed -e "s/..$$/40/")
其中,sed -e "s/..$$/40/"的意思是,把输出的字符串的最后两个字符删掉,并且用40来补充,也可以理解为,把字符串最后两个字符用40来替换。

通过对比3.0.1版本和3.6.7版本发现前者有这样的内容,但后者的make file却找不到

STARTADDR这变量。找了半天才发现,linux3.6.7版本中设置mkimage传递的参数不是放在arch/arm/boot目录的makefile中,而是放在scripts目录下的makefile.lib文件中,内容如下:

# U-Boot mkimage
# ---------------------------------------------------------------------------

MKIMAGE := $(srctree)/scripts/mkuboot.sh

# SRCARCH just happens to match slightly more than ARCH (on sparc), so reduces
# the number of overrides in arch makefiles
UIMAGE_ARCH ?= $(SRCARCH)
UIMAGE_COMPRESSION ?= $(if $(2),$(2),none)
UIMAGE_OPTS-y ?=
UIMAGE_TYPE ?= kernel
UIMAGE_LOADADDR ?= arch_must_set_this
#UIMAGE_ENTRYADDR ?= $(UIMAGE_LOADADDR)##这是原来的配置
UIMAGE_ENTRYADDR =$(shell echo $(UIMAGE_LOADADDR) | sed -e "s/..$$/40/")##这是我修改后的配置

UIMAGE_NAME ?= 'Linux-$(KERNELRELEASE)'
UIMAGE_IN ?= $<
UIMAGE_OUT ?= $@

quiet_cmd_uimage = UIMAGE $(UIMAGE_OUT)
cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A $(UIMAGE_ARCH) -O linux \
-C $(UIMAGE_COMPRESSION) $(UIMAGE_OPTS-y) \
-T $(UIMAGE_TYPE) \
-a $(UIMAGE_LOADADDR) -e $(UIMAGE_ENTRYADDR) \
-n $(UIMAGE_NAME) -d $(UIMAGE_IN) $(UIMAGE_OUT)

通过上面修改后,make uImage如下:

root@ubuntu:/home/my/linux-3.6.7# make uImage
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: “include/generated/mach-types.h”是最新的。
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
Kernel: arch/arm/boot/Image is ready
Kernel: arch/arm/boot/zImage is ready
UIMAGE arch/arm/boot/uImage
Image Name: Linux-3.6.7
Created: Mon Nov 26 12:37:17 2012
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1476744 Bytes = 1442.13 kB = 1.41 MB
Load Address: 50008000
Entry Point: 50008040

Image arch/arm/boot/uImage is ready
root@ubuntu:/home/my/linux-3.6.7#

阅读(6) | 评论(0) | 转发(0) |
0

上一篇:UBOOT-2012-10在OK6410平台的移植(十二)移植结束

下一篇:YAFFS2移植到linux3.6.7

相关热门文章
  • Linux3.6.7在OK6410平台的移植...
  • Linux3.6.7在OK6410平台的移植...
  • Linux3.6.7在OK6410平台的移植...
  • Linux3.6.7在OK6410平台的移植...
  • Linux3.6.7在OK6410平台的移植...
  • linux 常见服务端口
  • 【ROOTFS搭建】busybox的httpd...
  • 什么是shell
  • linux socket的bug??
  • linux的线程是否受到了保护?...
  • 虚拟机中ubuntu无线连接问题...
  • IBM DS3400 盘阵怎么查看是单...
  • 启动auditd时,报错如下,怎么...
  • CGSL系统中root密码正确,但无...
  • 在CGSL系统中,如何为不同的用...
给主人留下些什么吧!~~
评论热议

你可能感兴趣的:(LINUX)