今天编译了一下Xen
,发现编出来的xen
是32
位的可执行程序,而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.
原来是为了支持multiboot
,xen
实际运行以后还是64
位程序。
参考资料:
[Xen-users] Why the built xen file is 32-bit on 64-bit OS?。