格式:image header + linux kernel + rootfs
header 有 64kB,包含 target architecture、作業系統、kernel size、entry points 等。
建立
- 編譯 kernel 產生 vmlinux,以及編譯與產生 root 檔案系統
- strip -g vmlinux
- rootfs.ext2:ext2 檔案系統的 root 檔案系統,包括 /dev 目錄
genext2fs -m 0 -i 1024 -b $(SIZE_MB) -d $(the_root_dir) -D device_table.txt rootfs.ext2 - linux.ext2:kernel 附上 rootfs.ext2
objcopy --add-section .romfs=rootfs.ext2 --adjust-section-vma .romfs=$(addr_of_bss_end) --no-adjust-warnings --set-section-flags .romfs=alloc,load,data vmlinux linux.ext2 - 轉換成 binary:
objcopy -O binary -S linux.ext2 linux.bin - 壓縮成 linux.bin.gz:
gzip -f9 linux.bin
- 使用 mkimage 加入 image header 所需要的資訊
- uImage 如無法直接定址,需放到可直接定址的位置,如 SDRAM。
- 執行 u-boot 指令 bootm,會作下列動作
- 檢查 checksum
- 解壓縮到 Load Address,也就是 0x1000
- 複製 bootargs 到 scratchpad
- 最後從 Linux Kernel 的 Entry Point,也就是 0x1000 開始執行
- Bootable U-Boot Images (Blackfin Linux Docs)
- uClinux-dist Compiled Images (Blackfin Linux Docs)