mkimage命令
# mkimage
Usage: mkimage -l image
-l ==> list image header information
mkimage [-x] -A arch -O os -T type -C comp -a addr -e ep -n name -d data_file[:data_file...] image
-A ==> set architecture to 'arch'
-O ==> set operating system to 'os'
-T ==> set image type to 'type'
-C ==> set compression type 'comp'
-a ==> set load address to 'addr' (hex)
-e ==> set entry point to 'ep' (hex)
-n ==> set image name to 'name'
-d ==> use image data from 'datafile'
-x ==> set XIP (execute in place)
mkimage [-D dtc_options] -f fit-image.its fit-image
mkimage -V ==> print version information and exit
A
:CPU的体系结构
- alpha
- arm
- x86 Intel x86
- ia64
- mips
- mips64
- ppc
- s390 IBM S390
- sh SuperH
- sparc
- sparc64
- m68k MC68000
O
:操作系统类型
- openbsd
- netbsd
- freebsd
- 4_4bsd
- linux
- svr4
- esix
- solaris
- irix
- sco
- dell
- ncr
- lynxos
- vxworks
- psos
- qnx
- u-boot
- rtems
- artos
T
:映象类型
- standalone
- kernel
- ramdisk
- multi
- firmware
- filesystem
C
:压缩方式
- none 不压缩
- gzip
- bzip2
a:映象在内存中的加载地址。映象下载到内存中时,根据这个地址来下载
e:映象运行的入口点地址。这个地址就是-a参数指定的值加上0x40(mkimage头)
n:映象名
d:制作映象的源文件
举例
# mkimage -n 'linux-2.6.14' -A arm -O linux -T kernel -C none -a 0x30008000 -e 0x30008040 -d zImage zImage.img
Image Name: linux-2.6.14
Load Address: 0x30008000
Entry Point: 0x30008040
# tftp xxx zImage.img
# bootm xxx
bootm命令会判断bootm地址是否与-a指定的地址相同
- 如果不同的话会从这个地址开始提取出这个0x40的头部,对其进行分析,然后把去掉头部的内核复制到-a指定的地址中去运行
- 如果相同的话,-e指定的入口地址会推后0x40,跳过头部
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!