tree: 655118dcd455050485be7c98488d72ea7865dee6 [path history] [tgz]
  1. legacy_c_gigaboot/
  2. tests/
  3. acpi.cc
  4. acpi.h
  5. backends.gni
  6. backends.h
  7. backends_nuc.cc
  8. boot_zbi_items.cc
  9. boot_zbi_items.h
  10. BUILD.gn
  11. cmdline.cc
  12. cmdline.h
  13. device_path.cc
  14. device_path.h
  15. efi_variables.cc
  16. efi_variables.h
  17. fastboot.cc
  18. fastboot.h
  19. fastboot_tcp.cc
  20. fastboot_tcp.h
  21. gpt.cc
  22. gpt.h
  23. input.cc
  24. input.h
  25. main.cc
  26. malloc.cc
  27. mdns.cc
  28. mdns.h
  29. network.cc
  30. network.h
  31. partition.cc
  32. partition.h
  33. permanent_attributes_to_cc.py
  34. README.md
  35. sysdeps.cc
  36. tss2_uefi.cc
  37. tss2_uefi.h
  38. utils.cc
  39. utils.h
  40. zircon_boot_ops.cc
  41. zircon_boot_ops.h
src/firmware/gigaboot/cpp/README.md

Gigaboot in C++

This folder contains source code for Fuchsia Gigaboot written in C++. It is built using the physboot toolchain defined in zircon/kernel/phys/efi/BUILD.gn. The code is currently under construction. It'll eventually replace the C gigaboot implementation in the parent folder (b/235489025).

A gn target src/firmware/gigaboot/cpp:esp is added for producing a bootable UEFI image that can be flashed to the device. To build the target, follow steps:

fx set workstation_eng.x64
fx build

The output path of the image is <build_out_dir>/fuchsia.esp.blk. The following gives two ways to flash the image to a NUC device.

Unit testing

To enable and run the unit test target, run:

fx set workstation_eng.x64 --with //src/firmware/gigaboot/cpp/tests
fx build
fx test --host gigaboot_unittests

Userspace fastboot with USB installer

  1. Follow instructions in Install Fuchsia on a NUC to prepare a bootable USB with the Fuchsia installer image and bootstrap NUC for the first time. The USB Fuchsia installer image has a userspace fastboot over tcp component that can be used to flash gigaboot. This only needs to be done once.

  2. Plug in the bootable USB and power on NUC. Find out the ip address of the device from the serial log or via ffx target list.

  3. Run fastboot flash fuchsia-esp <gigaboot image> -s tcp:<ip address>

  4. Unplug the USB and power cycle the device. The device will now run the new gigaboot image.

Repeat step 2-4 for future flash.

Fastboot over tcp from gigaboot

Fastboot over tcp is enabled on gigaboot and supports fastboot flash. Once device powers up, keep pressing f key to put device into fastboot mode. The ip6 address is printed on the console/monitor. Run fastboot flash fuchsia-esp <gigaboot image> -s tcp:<ip address> to flash the image.

If a broken gigaboot is flashed to the device during development, use the USB installer approach to recover.