搜尋此網誌

Find out Entry Point And Load address for you (Linux kernel) vmlinux.

I. For mips
1. Find ENTRY point:
example :
mips-linux-objdump -f vmlinux | grep start
arm-softfloat-linux-gnu-objdump  -f vmlinux | grep start


2.Find Load Point:
example :
mips-linux-nm vmlinux | grep _ftext
arm-softfloat-linux-gnu-nm | grep _ftext
 
Another way :
ENTRY=`readelf -a ${VMLINUX} |grep "Entry" |cut -d":" -f 2`
LDADDR=`readelf -a ${VMLINUX}| grep "\[ 1\]" |cut -d" " -f 26`



  II.For Arm
# 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)     
 
For arm system, the entry and load address just referenc follow 2 files :
(1) linuxsource/arch/arm/mach-xxxxxxxx/Makefile.boot
(2)linuxsource/arch/arm/boot/Makefile
 
Then using mkimage :
$(MKIMAGE) -A arm -O linux -T kernel -C none -a $(ZRELADDR) -e $(ZRELADDR) \
-n 'Linux-$(KERNELRELEASE)' -d $< $@
 
 
 
 
 

How to debug make build ..

Sometimes the build time is long , and the old log in console will been overwrite,
so redirect the build make log in to an file is a good way to debug build problem.

(1)
make 2>&1 | tee BUILD_OPENWRT_LOG.TXT

(2)
make V=99 2>&1 | tee BUILD_OPENWRT_LOG.TXT