You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Emulator needs a lot of file packages to start up the system: multiboot.bin, fvm.blk, fuchsia-ssh.zbi.
Let's explore how to generate these file packages.
By tracking Fuchsia's compilation, I figured it out.
Multiboot: fuchsia/out/default/multiboot.bin
Multiboot-compatible ELF kernel image. kernel bzImage type file
host_x64/fvm obj/build/images/fvm.blk create --slice 8388608 --blob obj/build/images/blob.blk --data obj/build/images/data.blk
host_x64/blobfs --depfile --json-output blobs.json --compress obj/build/images/blob.blk create --manifest obj/build/images/blob.manifest
# blob.blk is blob type file, include files in the blob.manifest
host_x64/minfs --depfile obj/build/images/data.blk create
# data.blk is empty, and it's encrypted data type
Ramdisk initrd: fuchsia-ssh.zbi
A Zircon Boot Image (ZBI) contains the kernel image and a RAM disk for the boot filesystem.
../../prebuilt/third_party/clang/linux-x64/bin/clang++ -o kernel-x64-clang/obj/kernel/image -Wl,-T,../../zircon/kernel/image.ld -Wl,--just-symbols,@kernel-x64-clang/gen/kernel/zircon.elf.rsp -fuse-ld=lld -Wl,-z,combreloc -Wl,-z,relro -Wl,-z,now -Wl,-z,text -Wl,--pack-dyn-relocs=relr --target=x86_64-fuchsia -mcx16 -march=x86-64 -fcrash-diagnostics-dir=clang-crashreports -fcolor-diagnostics -Wl,--color-diagnostics -Wl,-z,max-page-size=4096 -fdebug-prefix-map=fuchsia/out/default.zircon=. -fdebug-prefix-map=fuchsia/fuchsia/out=.. -fdebug-prefix-map=fuchsia=../.. -no-canonical-prefixes -O2 -g3 -Wl,--icf=all -fno-exceptions -fno-rtti -nostdlib -static -Wl,--no-pie -noprofilelib -fno-sanitize-link-runtime -fno-exceptions -fdata-sections -ffunction-sections -Wl,--gc-sections -fdata-sections -Wl,--build-id=none -Wl,-defsym,KERNEL_BASE=0xffffffff80100000 -Wl,-defsym,SMP_MAX_CPUS=32 -Wl,-defsym,BOOT_HEADER_SIZE=0x50 -Wl,-Map,kernel-x64-clang/obj/kernel/image.map -Wl,--start-group @'kernel-x64-clang/obj/kernel/image.rsp' -Wl,--end-group
# **Kernel** image
|
V
cd out/default.zircon ; ../../prebuilt/third_party/clang/linux-x64/bin/llvm-objcopy -O binary kernel-x64-clang/obj/kernel/image kernel-x64-clang/kernel.zbi
|
V
# kernel.zbi and files in various manifests and some specific files with --entry parameter
|
V
host_x64/zbi --output=fuchsia.zbi --depfile=fuchsia.zbi.d --complete=x64 --compressed=zstd obj/build/images/boot.manifest ../default.zircon/kernel-x64-clang/kernel.zbi obj/src/devices/bin/driver_manager/driver_manager.manifest obj/src/devices/devices.manifest obj/src/power/shutdown-shim/shutdown-shim.manifest obj/src/sys/bootstrap/root_manifests.manifest obj/src/sys/component_manager/component_manager_bootfs.manifest obj/src/security/policy/component_manager_policy.manifest --entry=config/devmgr=obj/build/images/devmgr_config.txt --entry=config/zxcrypt=obj/build/images/zxcrypt_config.txt --type=cmdline --entry=console.shell=true --entry=kernel.enable-debugging-syscalls=true --entry=kernel.enable-serial-syscalls=true --entry=netsvc.all-features=true --entry=netsvc.disable=false --entry=kernel.oom.behavior=reboot --entry=virtcon.hide-on-boot
# fuchsia/out/default/fuchsia.zbi
We know how to run Fuchsia to the graphical interface with emulator FEMU:
Emulator needs a lot of file packages to start up the system:
multiboot.bin
,fvm.blk
,fuchsia-ssh.zbi
.Let's explore how to generate these file packages.
By tracking Fuchsia's compilation, I figured it out.
Multiboot: fuchsia/out/default/multiboot.bin
Multiboot-compatible ELF kernel image. kernel bzImage type file
Drive file: fvm.blk
fuchsia/out/default/obj/build/images/fvm.blk
Ramdisk initrd: fuchsia-ssh.zbi
A Zircon Boot Image (ZBI) contains the kernel image and a RAM disk for the boot filesystem.
ZBI package
How to show contents of a zbi package:
How to decompless a zbi package:
How to merge a zbi package and a folder into a new zbi package:
The text was updated successfully, but these errors were encountered: