7.1 Compile Kernel Image
Type:
#make zImage
to compile the image of kernel. After the compilation is done, there will be a file named zImages under “arch/arm/boot”, we can burn this file into the TQ2440 board, and the boot will be like:
7.2 Save the Image to the specified location
For conviency, I also change the “Makefile” under “arch/arm/boot”, in line 58, we added the following marked as red. The red part move the generated zImage to the root directory of the kernel, i.e.e, linux-2.6.25.8, and rename it as zImage.bin:
$(obj)/zImage:$(obj)/compressed/vmlinux FORCE
$(call if_changed,objcopy)
@cp -f arch/arm/boot/zImage zImage.bin
@echo ‘ Kernel: $@ is ready’
We also change the Makefile under the root directory, line line 1156 (2.6.25.8) and line 1255 (2.6.30.4), add the following (marked as red), so that when we do
#make distclean
to clean the generated files, the zImage under the root will also be removed.
distclean: mrproper
@find $(srctree) $(RCS_FIND_IGNORE)
( -name ‘*.orig’ -o -name ‘*.rej’ -o -name ‘*~’ -o -name ‘*.bak’ -o -name ‘#*#’ -o -name ‘.*.orig’
-o -name ‘.*.rej’ -o -size 0
-o -name ‘*%’ -o -name ‘.*.cmd’ -o -name ‘core’ )
-type f -print | xargs rm -f rm -f zImage.bin
Note 1: until now, the kernel can just barely boot, we haven’t done any driver work of NAND Flash, so this is just first step.
Additional comments: We can also add a platform option for our board TQ2440, how to do?
An example explained using linux-2.6.30.4:
Add our own platform TQ2440 (follows SMDK244), first we analyze the dependency relationship of SMDK2440, mainly look at the Kconfig and Makefile under “arch/arm/machs3c2410/”
¡¢”arch/arm/mach-s3c2440/” and “arch/arm/plat-s3c24xx/”. Two important options ARCH_S3C2410 and MACH_SMDK. We follow it to make our own platform config.
Copy “arch/arm/mach-s3c2440/mach-smdk2440.c” as “mach-tq2440.c”
(Note: in the already ported kernel source files we provided, because we first modify config of smdk2440 options, and then copy to TQ2440, so machsmdk2330.c and mach-tq2440.c are almost identical.)
Copy “arch/arm/plat-s3c24xx/common-smdk.c” as “common-EmbedSky.c”£¬
Copy “arch/arm/plat-s3c24xx/include/plat/common-smdk.h” as”common-EmbedSky.h”¡£
You can also refer to the ported kernel source files for reference.
Note 2: When porting Linux-2.6.30.4, modifying mac-smdk2440.c referring to mach-tq2440.c in our files, and
modifying common-smdk.c refering to common-EmbedSky.c in the source files we provided.
Leave a Reply
You must be logged in to post a comment.