0

After building zircon, I get

lz@vm:~/fuchsia/out/default/kernel_arm64$ ls -la
total 73892
drwx------  4 lz lz     4096 jul 26 02:36 .
drwxrwxr-x 36 lz lz    20480 jul 26 02:39 ..
drwx------  4 lz lz     4096 jul 26 01:23 gen
-rwxrwxr-x  1 lz lz  3044192 jul 26 02:36 image
-rw-rw-r--  1 lz lz        0 jul 26 02:36 image.build-id.stamp
-rw-rw-r--  1 lz lz     3442 jul 26 02:36 image.map
-rwxrwxr-x  1 lz lz  2178064 jul 26 02:36 kernel.zbi
drwx------  8 lz lz     4096 jul 26 02:32 obj
-rw-rw-r--  1 lz lz    40021 jul 26 01:23 toolchain.ninja
-rwxrwxr-x  3 lz lz 66370040 jul 26 02:36 zircon.elf
-rw-rw-r--  1 lz lz       16 jul 26 02:36 zircon.elf.build-id.stamp
-rw-rw-r--  2 lz lz    36414 jul 26 01:03 zircon.elf-gdb.py
-rw-rw-r--  1 lz lz  3944049 jul 26 02:36 zircon.elf.map

As you see, it creates a .elf zircon kernel (image is also a .elf but I don't know what is the difference from zircon.elf).

I've seen ARM kernels in COFF format but not in ELF. Why does Fuchsia's kernel Zircon produces an elf file?

4

1 回答 1

0

构建系统将内核映像编译为 ELF 格式,用于调试和反汇编(该格式包含调试符号)。从那里,图像内容被剥离、展平并压缩成最终kernel.zbi图像。

Zircon 引导映像 (ZBI) 是用于 Zircon 内核的专用格式。您可能会发现 Fuchsia.dev 上的以下页面很有帮助,它涉及 ZBI 格式:Zircon kernel to userspace bootstrapping

于 2021-07-28T22:15:16.527 回答