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?

Rafaelo
  • 33
  • 1
  • 15

1 Answers1

0

The build system compiles the kernel image into an ELF format for debugging and disassembly (this format contains debug symbols). From there, the image contents are stripped, flattened, and compressed into the final kernel.zbi image.

The Zircon Boot Image (ZBI) is a specialized format used for the Zircon kernel. You might find the following page on Fuchsia.dev helpful, which touches on the ZBI format: Zircon kernel to userspace bootstrapping.

devunwired
  • 62,780
  • 12
  • 127
  • 139