$ show IO-ZetZor/Visor-BootManager
Visor is a modern, feature-rich UEFI boot manager written in C, targeting x86_64 and AArch64. It provides a fast, graphically appealing boot menu with auto-detection of operating systems (Linux via EFI stub or raw bzImage, Windows chainload, and other EFI executables). The system is built as a single self-contained EFI binary (~340 KB) using the gnu-efi toolchain, with a sophisticated feature build system that allows compiling optional capabilities (GUI, animations, audio, encryption, TPM, GPT repair, etc.) into lightweight profiles. It supports Secure Boot (including shim), TPM measured boot, LUKS encrypted boot, btrfs snapshot management (snapper/timeshift), BLS/OSTree deployments, and animated backgrounds (GIF, MJPEG, MP4, custom VBG codec). Configuration is done via a plain-text `boot.conf` file, and a companion CLI tool (`visor`) handles installation, updates, kernel encryption, and asset conversion. The codebase demonstrates high craftsmanship through its modular architecture, comprehensive feature stubbing, custom decoders (PNG, JPEG, GIF), GPT repair logic, and hardware-level audio driver (HDA).
The LLM identified 6 files worth highlighting for reuse:
Implements TPM 2.0 measured boot for UEFI, including TPM2 startup, PCR extend (PCR 5 and 12), event logging, and measurement of config/cmdline data. Demonstrates low-level TCG2 protocol interaction and can be reused in any UEFI application requiring TPM firmware measurement.
GPT partition table diagnosis engine that classifies GPT integrity states (valid, damaged primary/backup, LBA mismatches, CRC errors) and constructs repair plans. The `gpt_classify_gpt` function and state machine are cleanly isolated and could be extracted for a standalone disk repair tool.
Generates accent colors for the GUI by extracting a seed color from a background image using Wu quantizer + k-means clustering, then applying the HCT (Hue-Chroma-Tone) color model to build a harmonious palette. Showcases embedded fixed-point color science and can be reused in any application requiring image-derived accent colors.
Implements NVRAM boot entry self-healing: detects when a Boot#### entry (e.g., the fallback bootloader) has been lost, and restores it from a persistent config file. Uses a cooldown policy (off/ensure/first) and dry-run mode. Demonstrates a robust pattern for firmware-level resilience that can be adapted to other EFI-based tools.
Low-level Intel HD Audio driver that detects the PCI controller, enumerates codecs, configures the audio output path (DMA, stream descriptors, verb commands), and plays 16-bit stereo PCM audio. Encapsulates complex hardware interaction behind a clean `hda_play_begin/end/done` API, making it reusable for any UEFI application requiring audio output.
Custom 'VISORVBG' video codec for animated backgrounds, using delta frames with tile-based motion compensation and run-length encoding. The decoder is self-contained (parses VBG header, applies differencing, and renders to a framebuffer). Demonstrates a lightweight, embeddable video codec pattern that could be reused for low-power animation in embedded systems.