Start porting kernel 2.6.27.8 to qq2440 (2) -- zImage generation
2008-12-12 11:00
141 查看
今天看了下zImage的生成,真是晕哦,头大了一圈,主要还是对Makefile和lds链接脚本不熟练。参考了一本书 《Embedded.Linux.Primer》,上面讲得很不错。不过到现在也还没搞得太清楚,算是有了一个大的轮廓。先记一下。
首先,编译过程会产生一个vmlinux文件,这个就已经是完整的内核了,不过是没有压缩的,然后copy为Image,相关过程见arch/arm/boot/Makefile,里面有些地方我也没弄明白。
然后在 arch/arm/boot/compressed/Makefile中,会将这个Image压缩成piggy.gz,改名为piggy.o,然后再根据链接脚本,链接上 head.o(arch/arm/boot/compressed), misc.o(解压程序)等,生成最终的vmlinux, 这个就是最终的zImage了。
注意的是有两个vmlinux,第一个是没有压缩的kernel,第二个是压缩了,同时包括初始化代码和解压代码的最终映像。
head.S也有两个。arch/arm/boot/compress/head.S这个是bootloader将要跳转到的地方,其中完成一些初始化之后,会跳转到misc.c的decompress_kernel,开始解压内核,同时显示"Uncompressing Linux....",完成后就会跳转到解压出来的kernel中去(这个地方应该是到了arch/arm/kernel/head.S吧,不过现在还不能肯定)
首先,编译过程会产生一个vmlinux文件,这个就已经是完整的内核了,不过是没有压缩的,然后copy为Image,相关过程见arch/arm/boot/Makefile,里面有些地方我也没弄明白。
然后在 arch/arm/boot/compressed/Makefile中,会将这个Image压缩成piggy.gz,改名为piggy.o,然后再根据链接脚本,链接上 head.o(arch/arm/boot/compressed), misc.o(解压程序)等,生成最终的vmlinux, 这个就是最终的zImage了。
注意的是有两个vmlinux,第一个是没有压缩的kernel,第二个是压缩了,同时包括初始化代码和解压代码的最终映像。
head.S也有两个。arch/arm/boot/compress/head.S这个是bootloader将要跳转到的地方,其中完成一些初始化之后,会跳转到misc.c的decompress_kernel,开始解压内核,同时显示"Uncompressing Linux....",完成后就会跳转到解压出来的kernel中去(这个地方应该是到了arch/arm/kernel/head.S吧,不过现在还不能肯定)
相关文章推荐
- Start porting kernel 2.6.27.8 to qq2440 (3) -- clock initialization
- Start porting kernel 2.6.27.8 to qq2440 (4) --Congratuation! Kernel boots OK!
- Start porting kernel 2.6.27.8 to qq2440 (5) -- clock issue
- Start porting kernel 2.6.27.8 to qq2440 (1)
- From kernel startup entry point to start_kernel (2)
- mini2440 to qq2440
- PYQt4运行界面只能显示一次之后出现下面的错误:It seems the kernel died unexpectedly. Use 'Restart kernel' to continue usi
- From kernel startup entry point to start_kernel (1)
- 修复:"Failed to start Load Kernel Modules"
- [lwn]Porting device drivers to the 2.6 kernel
- fedora21: failed to start load kernel modules 解决方法
- driver porting from Android to My kernel
- Ubuntu升级到16.04后出现"Failed to start Load Kernel Modules"问题的解决方案
- HOWTO Change the Linux Kernel Start Address
- From kernel startup entry point to start_kernel (3)
- Ubuntu 16.04 开机启动失败 Failed to start Load Kernel Modules
- 开机 出现Failed to start Load Kernel Modules(Archlinux)
- android点滴16:Unable to start service Intent 的一种可能
- Start to work at sigma MS
- centos 7安装vmtools时提示The path "" is not a valid path to the xxx kernel headers.