Image vs zImage vs uImage [英] Image vs zImage vs uImage

查看:17
本文介绍了Image vs zImage vs uImage的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它们之间有什么区别?

我知道 u-boot 需要一个 uImage 格式的内核.

I know that u-boot needs a kernel in uImage format.

我使用的系统首先从第 1 阶段加载程序启动,然后调用 u-boot.我想放弃 u-boot 并直接从第 1 阶段加载程序启动.我必须使用哪种类型的内核映像?

The system I use first boots from stage 1 loader and then it calls u-boot. I want to discard u-boot and directly boot from stage 1 loader. Which type of kernel image do I have to use?

推荐答案

它们之间有什么区别?

What is the difference between them?

Image:通用的 Linux 内核二进制映像文件.

Image: the generic Linux kernel binary image file.

zImage:自解压的 Linux 内核映像的压缩版本.

zImage: a compressed version of the Linux kernel image that is self-extracting.

uImage:具有 U-Boot 包装器(由 mkimage 实用程序安装)的图像文件,其中包含操作系统类型和加载程序信息.
一个非常常见的做法(例如典型的 Linux 内核 Makefile)是使用 zImage 文件.由于 zImage 文件是自解压的(即不需要外部解压缩器),包装器会指示该内核未压缩",即使它实际上是.

uImage: an image file that has a U-Boot wrapper (installed by the mkimage utility) that includes the OS type and loader information.
A very common practice (e.g. the typical Linux kernel Makefile) is to use a zImage file. Since a zImage file is self-extracting (i.e. needs no external decompressors), the wrapper would indicate that this kernel is "not compressed" even though it actually is.

请注意,U-Boot 的作者/维护者认为在 uImage 中使用 zImage 的(广泛)使用是有问题的:

Note that the author/maintainer of U-Boot considers the (widespread) use of using a zImage inside a uImage questionable:

实际上在 uImage 中使用 zImage 是非常愚蠢的.它是使用普通(未压缩)内核映像要好得多,压缩它仅使用 gzip,并将其用作 mkimage 的 poayload.这条路U-Boot 进行解压缩,而不是包含另一个使用每个内核映像解压缩.

Actually it's pretty stupid to use a zImage inside an uImage. It is much better to use normal (uncompressed) kernel image, compress it using just gzip, and use this as poayload for mkimage. This way U-Boot does the uncompresiong instead of including yet another uncompressor with each kernel image.

(引自 https://lists.yoctoproject.org/pipermail/yocto/2013-October/016778.html)

我必须使用哪种类型的内核映像?

Which type of kernel image do I have to use?

你可以选择任何你想编程的内容.
为了节省存储空间,您可能应该选择压缩图像而不是未压缩图像.
请注意,执行内核(大概是 Linux 内核)不仅仅涉及将内核映像加载到内存中.根据架构(例如 ARM)和 Linux 内核版本(例如有或没有 DTB),可能必须为内核准备寄存器和内存缓冲区.在一种情况下,U-Boot 还执行了必须复制的硬件初始化.

You could choose whatever you want to program for.
For economy of storage, you should probably chose a compressed image over the uncompressed one.
Beware that executing the kernel (presumably the Linux kernel) involves more than just loading the kernel image into memory. Depending on the architecture (e.g. ARM) and the Linux kernel version (e.g. with or without DTB), there are registers and memory buffers that may have to be prepared for the kernel. In one instance there was also hardware initialization that U-Boot performed that had to be replicated.

附录

我知道 u-boot 需要一个 uImage 格式的内核.

I know that u-boot needs a kernel in uImage format.

这对于只有 bootm 命令的所有 U-Boot 版本都是准确的.
但是更新版本的 U-Boot 也可以有 bootz 命令来引导 zImage.

That is accurate for all versions of U-Boot which only have the bootm command.
But more recent versions of U-Boot could also have the bootz command that can boot a zImage.

这篇关于Image vs zImage vs uImage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆