Commit Graph

1 Commits

Author SHA1 Message Date
AI
993cf05712 feat: graphical framebuffer support for VGA driver
When GRUB is configured with multiboot2, it may provide a graphical
(RGB) framebuffer instead of legacy VGA text mode. This happens on
UTM/QEMU on macOS and other configurations where the bootloader
switches to a pixel-based display.

- Parse multiboot2 framebuffer tag in kernel_main to detect display mode
- Identity-map the framebuffer address (often at 0xFD000000+) after
  paging is enabled, with write-through caching
- Add framebuffer.h describing the boot-time display info
- Embed 8x16 VGA bitmap font (font8x16.h) for pixel-mode rendering
- Rewrite VGA driver to support both text mode and pixel mode:
  - Text mode: unchanged behavior writing to 0xB8000
  - Pixel mode: renders characters using the bitmap font to the
    GRUB-provided framebuffer, with proper VGA color palette mapping
  - Auto-detects mode from fb_info at init time
- Multiboot2 header now requests text mode via framebuffer tag, but
  gracefully falls back to pixel rendering if GRUB provides RGB
- Reverted grub.cfg gfxpayload=text (caused display issues on UTM)

Tested: boots in both text mode and graphical framebuffer mode.
2026-02-23 13:25:42 +00:00