我的站点

一个系统软件工程师的随手涂鸦

Category: Xen 笔记

Xen 笔记 (2)——”xen”,”xen-syms” and “xen-*-dbg”文件

以下摘自Xen邮件列表

Hi all,

Since I am a newbie of Xen, this may be a dumb question. On my SuSE Xen, I find the following 4 “Xen” files:

-rw-r–r– 1 root rootÂÂÂ881967 Oct 27 05:46 xen-4.5.110-1.gz
-rw-r–r– 1 root root 16673080 Oct 27 05:46 xen-syms-4.5.1
10-1
-rw-r–r– 1 root rootÂÂÂ893428 Oct 27 05:45 xen-dbg-4.5.110-1.gz
-rw-r–r– 1 root root 16124144 Oct 27 05:45 xen-syms-dbg-4.5.1
10-1

Could anyone give a detailed explanation of the functions and differences about the 4 files?

TL;DR: Use xen-04.5.1_1-1.gz unless someone asks you to do otherwise or you are tracking down a bug.

xen.gz is the main/regular/normal release build of the Xen binary (e.g. the thing which you can boot). This is the thing you would boot on a regular production Xen system.

xen-syms.gz is the unstripped version of xen.gz, i.e. with all the ELF debug information present. You can e.g. run gdb on it to disassemble things if you are tracking down a bug. This image is not bootable.

The -dbg variants are not something which upstream produces, but I would assume that they are build with the debug=y, which means they will contain extra ASSERT statements and other things which aid debugging possibly at the expense of performance. Release builds (xen.gz et al) are build with debug=n. Like the release builds the xen-*-dbg ones come in the bootable (xen-dbg.gz) and xen-syms-dbg.gz variants, with the same distinction (the former is bootable, the latter is for running gdb on)

概括一下,xen文件是可以bootable的,也是用来启动xen系统的可执行文件。xen-symxen的保留所有调试信息的的版本,不可以bootable,仅用于调试功能。xen-*-dbg则是xenxen-sym对应的加了很多调试代码的版本。

 

Xen 笔记 (1)——为什么xen是32位的可执行程序?

今天编译了一下Xen,发现编出来的xen32位的可执行程序,而xen-syms却是64位的:

Linux:~/Downloads/xen-4.6.0/xen # file xen
xen: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped
Linux:~/Downloads/xen-4.6.0/xen # file xen-syms
xen-syms: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped

Roger在邮件里给了答案:

The Xen entry point is in 32bits (because that’s what the multiboot specification requires). Xen then jumps into long mode (64bits) by itself, so there’s only a very small amount of 32bit code that’s used as a trampoline.

原来是为了支持multibootxen实际运行以后还是64位程序。

参考资料:
[Xen-users] Why the built xen file is 32-bit on 64-bit OS?

 

Powered by WordPress & Theme by Anders Norén