Skip to content

Conversation

@ryanbreen
Copy link
Owner

Summary

Phase 5 of the graphics stack implementation:

  • Resolution Control: Configure framebuffer resolution via QEMU virtio-vga

    • Default: 1920x1080 (highest resolution in OVMF GOP mode list)
    • Configurable via BREENIX_FB_WIDTH / BREENIX_FB_HEIGHT env vars
    • Always uses virtio-vga for consistent resolution control
  • FbInfo Syscall (410): Query framebuffer information from userspace

    • Returns: width, height, stride, bytes_per_pixel, pixel_format
    • Includes userspace pointer validation (security)
    • Works in both interactive and non-interactive modes
  • libbreenix graphics module: Userspace wrapper for graphics syscalls

    • FbInfo struct matching kernel ABI
    • fbinfo() function with proper error handling
  • Utilities:

    • /sbin/resolution: Display current framebuffer info
    • fbinfo_test: Integration test with boot stage marker

Test plan

  • Build succeeds with no warnings
  • Boot stages test passes (208/227 - TCP issues unrelated)
  • FbInfo syscall test passes (stage 227/227)
  • Resolution utility builds and is included in test disk

🤖 Generated with Claude Code

ryanbreen and others added 3 commits January 16, 2026 19:06
Add configurable framebuffer resolution support:

**build.rs:**
- Configure bootloader BootConfig with minimum framebuffer dimensions
- Default to 1920x1080 for better interactive experience
- Resolution overridable via BREENIX_FB_WIDTH/HEIGHT env vars

**qemu-uefi.rs:**
- Use virtio-vga device in interactive mode for high-res support
- virtio-vga supports configurable xres/yres parameters
- Headless mode (-nographic) preserved for CI testing
- Resolution from BREENIX_FB_WIDTH/HEIGHT passed to QEMU

**demo.rs:**
- Display current resolution in demo header
- Update footer to show "Phase 5: Resolution Control Active"

Usage:
  # Default 1920x1080
  cargo run -p xtask -- interactive

  # Custom resolution
  BREENIX_FB_WIDTH=2560 BREENIX_FB_HEIGHT=1440 cargo run -p xtask -- interactive

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Phase 5 Resolution Control improvements:
- Add sys_fbinfo syscall (410) to query framebuffer info
- Add libbreenix graphics module with FbInfo wrapper
- Add /sbin/resolution userspace program to display FB info
- Fix resolution to 1920x1080 (1920x1200 not in OVMF GOP modes)
- Always use virtio-vga for consistent resolution control

The FbInfo syscall returns width, height, stride, bytes_per_pixel,
and pixel format. Conditionally compiled with interactive feature.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds comprehensive test coverage for the FbInfo syscall:
- Add fbinfo_test.rs integration test with assertions
- Add boot stage marker for CI validation
- Add test execution in kernel test sequence
- Add userspace pointer validation (security fix)
- Support both interactive and non-interactive modes

The test validates:
- Syscall returns valid framebuffer dimensions
- Width and height are positive
- Bytes per pixel is 3 or 4
- Pixel format is valid (RGB/BGR/grayscale)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ryanbreen ryanbreen force-pushed the feature/graphics-phase-4 branch from b78c405 to 68b5d86 Compare January 17, 2026 01:13
ryanbreen and others added 4 commits January 17, 2026 04:00
With 227 boot stages, CI environments need more time to complete
all tests. The previous 180s timeout was causing tests to fail
at 217/227 stages. Increased to 300s (5 minutes) for CI.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…ture

The FbInfo struct and USER_SPACE_MAX constant are only used in the
interactive version of sys_fbinfo. Adding cfg gates eliminates warnings
when building without the interactive feature.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove unused yellow_style variable in demo.rs
- Remove unused re-exports from graphics/mod.rs (Font, FontMetrics,
  FontSize, Glyph, Weight, TextStyle)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Previously, text rendering without an explicit background would just
darken the foreground color based on glyph intensity, resulting in
poor anti-aliasing against non-black backgrounds.

Now the text renderer:
- Reads the actual canvas pixel at each glyph position
- Properly alpha-blends the foreground color with the existing pixel
- Removes the intensity threshold (was skipping low-intensity pixels)

This requires adding get_pixel() and buffer() methods to the Canvas
trait, and from_pixel_bytes() to Color for reading pixels back.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ryanbreen ryanbreen merged commit dff6097 into main Jan 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants