linux核心的生成過程, vmlinux除錯分析

2021-06-18 03:39:54 字數 3103 閱讀 5548

1. 依據arch/arm/kernel/vmlinux.lds 生成linux核心原始碼根目錄下的vmlinux,這個vmlinux屬於未壓縮,帶除錯資訊、符號表的最初的核心,大小約23mb; 

arm-linux-gnu-ld -el  -p --no-undefined -x -o vmlinux -t arch/arm/kernel/vmlinux.lds 

arch/arm/kernel/head.o   

arch/arm/kernel/init_task.o    

init/built-in.o   

--start-group    

usr/built-in.o    

arch/arm/kernel/built-in.o    

arch/arm/mm/built-in.o    

arch/arm/common/built-in.o    

arch/arm/mach-s3c2410/built-in.o    

arch/arm/nwfpe/built-in.o    

kernel/built-in.o           

mm/built-in.o    

fs/built-in.o    

ipc/built-in.o    

security/built-in.o    

crypto/built-in.o    

lib/lib.a    

arch/arm/lib/lib.a    

lib/built-in.o    

arch/arm/lib/built-in.o    

drivers/built-in.o    

sound/built-in.o    

net/built-in.o   

--end-group .tmp_kallsyms2.o  

2. 將上面的vmlinux去除除錯資訊、注釋、符號表等內容,生成arch/arm/boot/image,這是不帶多餘資訊的linux核心,image的大小約3.2mb;  

命令:arm-linux-gnu-objcopy -o binary -r .note -r .comment -s  vmlinux arch/arm/boot/image  

3. 將 arch/arm/boot/image 用gzip -9 壓縮生成arch/arm/boot/compressed/piggy.gz大小約1.5mb;  

命令:gzip -f -9 < arch/arm/boot/compressed/../image > arch/arm/boot/compressed/piggy.gz

4. 編譯arch/arm/boot/compressed/piggy.s 生成arch/arm/boot/compressed/piggy.o大小約1.5mb,這裡實際上是將piggy.gz通過piggy.s編譯進piggy.o檔案中。而piggy.s檔案僅有6行,只是包含了檔案piggy.gz;  

命令:arm-linux-gnu-gcc -wp,-md,arch/arm/boot/compressed/.piggy.o.d  -nostdinc -isystem /home/justin/crosstool/gcc-3.4.5-glibc-2.3.6/arm-linux-gnu/lib/gcc/arm-linux-gnu/3.4.5/include -d__kernel__ -iinclude  -mlittle-endian -d__assembly__ -wa,-l -gdwarf-2 -mapcs-32 -mno-thumb-interwork -d__linux_arm_arch__=4 -march=armv4 -mtune=arm9tdmi -msoft-float    -c -o arch/arm/boot/compressed/piggy.o arch/arm/boot/compressed/piggy.s  

5. 依據arch/arm/boot/compressed/vmlinux.lds 將arch/arm/boot/compressed/目錄下的檔案head.o 、piggy.o 、misc.o鏈結生成 arch/arm/boot/compressed/vmlinux,這個vmlinux是經過壓縮且含有自解壓**的核心,大小約1.5mb;  

命令:arm-linux-gnu-ld -el   --defsym zreladdr=0x30008000 --defsym params_phys=0x30000100 -p --no-undefined -x /home/justin/crosstool/gcc-3.4.5-glibc-2.3.6/arm-linux-gnu/lib/gcc/arm-linux-gnu/3.4.5/libgcc.a -t arch/arm/boot/compressed/vmlinux.lds arch/arm/boot/compressed/head.o arch/arm/boot/compressed/piggy.o arch/arm/boot/compressed/misc.o -o arch/arm/boot/compressed/vmlinux  

6. 將arch/arm/boot/compressed/vmlinux去除除錯資訊、注釋、符號表等內容,生成arch/arm/boot/zimage大小約1.5mb;這已經是乙個可以使用的linux核心映像檔案了;  

命令:arm-linux-gnu-objcopy -o binary -r .note -r .comment -s  arch/arm/boot/compressed/vmlinux arch/arm/boot/zimage  

7. 將arch/arm/boot/zimage新增64bytes的相關資訊打包為arch/arm/boot/uimage大小約1.5mb;  

命令:/bin/sh /home/farsight/resources/kernel/linux-2.6.14/scripts/mkuboot.sh -a arm -o linux -t kernel -c none -a 0x30008000 -e 0x30008000 -n 'linux-2.6.14' -d arch/arm/boot/zimage arch/arm/boot/uimage

linux核心的生成過程, vmlinux除錯分析

1.依據arch arm kernel vmlinux.lds 生成linux核心原始碼根目錄下的vmlinux,這個vmlinux屬於未壓縮,帶除錯資訊 符號表的最初的核心,大小約23mb arm linux gnu ld el p no undefined x o vmlinux t arch ...

linux核心的生成過程, vmlinux除錯分析

1.依據arch arm kernel vmlinux.lds 生成linux核心原始碼根目錄下的vmlinux,這個vmlinux屬於未壓縮,帶除錯資訊 符號表的最初的核心,大小約23mb arm linux gnu ld el p no undefined x o vmlinux t arch ...

WINCE核心生成過程

生成映像檔案nk.bin是平台建立過程的最後一步,也是配置windows ce的最終目標。makeimg.exe使用全部配置檔案把目標模組和檔案合併成乙個惟一的windows ce映像檔案nk.bin。圖1所示為nk.bin的生成過程。makeimg生成nk.bin的具體步驟 全並配置檔案 所有的....