图像vs zImage vs uImage [英] Image vs zImage vs uImage

查看:112
本文介绍了图像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?

映像:通用的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会执行uncompringg,而不是再包含另一个 每个内核映像都需要解压.

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.

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

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