From d9c47d52039be7a61d3e9d3652f73322fb6f47ba Mon Sep 17 00:00:00 2001 From: salmonik Date: Sat, 1 Aug 2026 21:30:48 +0200 Subject: rsnix v0.5.1: force the GUI canvas to 800x600 via GOP SetMode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The kernel used to inherit whatever GOP mode the firmware picked (QEMU/OVMF gave 1280x800). Now every surface derives from a fixed 800x600 canvas: - uefi: typed EfiGopQueryMode/SetMode/GetMode fn pointers in GraphicsOutputProtocol (were raw *mut c_void, never called). - gop::select_gop_mode: scan the mode list for an exact 800x600 (32-bit BGR/RGB only, the driver assumes 4 Bpp), SetMode it; fall back to the smallest mode that fits the canvas, then to the firmware's choice. SetMode may move both the mode info pointer and the framebuffer base, so both are re-read after the switch. Boot log: 'gop: mode 3 selected — 800x600 (was 1280x800)'. - tests: relative assertions are resolution-agnostic; test-gfx and test-mouse had a boot-log race (shell line prints before the cursor task line) — now wait for the cursor line instead of grepping once. All four suites pass at 800x600. 0 build warnings. --- rsnix/src/uefi.rs | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'rsnix/src/uefi.rs') diff --git a/rsnix/src/uefi.rs b/rsnix/src/uefi.rs index f947c90..c311ad9 100644 --- a/rsnix/src/uefi.rs +++ b/rsnix/src/uefi.rs @@ -321,12 +321,28 @@ pub struct GopMode { #[repr(C)] pub struct GraphicsOutputProtocol { - pub query_mode: *mut c_void, - pub set_mode: *mut c_void, - pub get_current_mode: *mut c_void, + pub query_mode: EfiGopQueryMode, + pub set_mode: EfiGopSetMode, + pub get_current_mode: EfiGopGetMode, pub mode: *mut GopMode, } +pub type EfiGopQueryMode = unsafe extern "efiapi" fn( + *mut GraphicsOutputProtocol, + u32, // mode number + *mut usize, // out: size of info + *mut *mut GopModeInfo, // out: info pointer (firmware-owned) +) -> Status; + +pub type EfiGopSetMode = unsafe extern "efiapi" fn(*mut GraphicsOutputProtocol, u32) -> Status; + +pub type EfiGopGetMode = unsafe extern "efiapi" fn( + *mut GraphicsOutputProtocol, + *mut u32, // out: current mode + *mut u32, // out: size of info + *mut *mut GopModeInfo, // out: info pointer +) -> Status; + // --------------------------------------------------------------------------- // System table // --------------------------------------------------------------------------- -- cgit v1.2.3