// internals
Development
Working on Visor itself.
Ground rules
- Zero warnings on both
makeandmake ARCH=aarch64. - No floating point / libm — Q16 fixed-point for anything fractional.
- RELATIVE-only relocations — verify with
readelf -rafter every change (see Building). - ASCII-only UI text — the baked font covers ASCII.
- AArch64 strict alignment — read packed/foreign structures (device-path nodes, GPT entries, PE headers) via
CopyMeminto local variables, never by casting pointers. - Comment-free sources — the codebase intentionally carries no comments; names and structure do the explaining.
boot.conf.exampleis the exception (it is user documentation). - Log every fallible step — one
efi_log()line per decision or failure. Future-you debugging a stranger's laptop will be grateful.
How to add a config key
Example: a global key myfeature=1 with a per-entry override.
- Declare it. Add
int myfeature;toconfig_tinsrc/include/config.h(or toboot_entry_tinsrc/include/gui.hfor an entry key). - Default it. Set the default in
config_parse()insrc/config.c(globals) and inconfig_add_entry()(entry fields — every field is initialized there). - Parse it. Globals: add a branch in
apply_global()insrc/config.c— that function receives eachkey/valuepair, and theme files flow through the same path so themes can override it. Entry keys: the entry-block parser in the same file. - Use it. Read
config->myfeature(wired throughmain.cintogui_state_tif the GUI needs it — see howmouseorhotplugtravel). - Document it. Add a commented block to
boot.conf.exampleand a row to the README/Configuration tables. - Verify. Clean build on both arches and the relocation check.
Testing changes
- Config parser:
visor config validateagainst crafted configs. - Real hardware is the final word — firmware quirks (relocations, GetInfo lies, LoadImage behavior, USB enumeration) only show up there. Keep
boot.logfrom every test.
Anatomy of a boot entry
boot_entry_t (src/include/gui.h) is the central type: linked
list, display fields (name, icon, color), boot fields (kernel, initrd,
cmdline, uuid pin), security fields (sha256, encrypted flags, LUKS settings),
plus deployments (OSTree), snapshots, and the hotplug volume pin. It flows
from config.c (parser/detector) through gui.c (display/selection)
into linux_boot.c (boot). If you extend it, initialize the field in
config_add_entry() and free it in config_free() (and
hp_free_entry() if hotplug entries can carry it).
Contributing
- Repo: github.com/IO-ZetZor/Visor-BootManager — issues and PRs welcome.
- Keep PRs single-purpose; include the
boot.logof a real-hardware test where relevant. - License is BSD 2-Clause; contributions are accepted under the same terms.