summaryrefslogtreecommitdiffstats
path: root/rsnix/src/gop.rs
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-08-17 14:53:52 +0200
committersalmonik <salmonik@tuta.io>2026-08-17 14:53:52 +0200
commitbe868a43185826b02bf6d091019bb779678525bb (patch)
tree586988c15f1d700b1621c7f0208584b30878a56c /rsnix/src/gop.rs
parentv0.5.10: change em-dashes to dashes (diff)
downloadrs-dos-be868a43185826b02bf6d091019bb779678525bb.tar.gz
rs-dos-be868a43185826b02bf6d091019bb779678525bb.zip
USB2/1.1 (EHCI/UHCI) drivers + real-hardware bring-up hardening
- Add polled EHCI (USB2) and UHCI (USB1.1) host-controller drivers with HID boot mouse support, wired into cursor polling and the 'usb' shell cmd - Add USB Legacy ownership handoff (claim_usb_legacy) plus config_write_byte - Harden boot: verify the PIT/timer ticks before shell entry, EOI stray interrupts in the LAPIC to stop interrupt storms, bound PS/2 controller waits, and INTx-disable AHCI (polled driver) - Add boot stage markers, klog screen echo, and QR lock; scheduler mark_shell_running; NO_USB stopgap to keep BIOS USB-Legacy input alive - alloc_pages_above for DMA buffers that must avoid low conventional memory - Expand DEBUG_NOTES with EHCI/QEMU bring-up findings
Diffstat (limited to '')
-rw-r--r--rsnix/src/gop.rs18
1 files changed, 16 insertions, 2 deletions
diff --git a/rsnix/src/gop.rs b/rsnix/src/gop.rs
index ccc6509..676814e 100644
--- a/rsnix/src/gop.rs
+++ b/rsnix/src/gop.rs
@@ -7,7 +7,7 @@ use crate::font;
7use crate::uefi::{GopModeInfo, GraphicsOutputProtocol, EFI_SUCCESS, PIXEL_BGR, PIXEL_RGB}; 7use crate::uefi::{GopModeInfo, GraphicsOutputProtocol, EFI_SUCCESS, PIXEL_BGR, PIXEL_RGB};
8use core::fmt; 8use core::fmt;
9use core::ptr; 9use core::ptr;
10use core::sync::atomic::{AtomicU32, AtomicU64, AtomicU8, Ordering}; 10use core::sync::atomic::{AtomicBool, AtomicU32, AtomicU64, AtomicU8, Ordering};
11 11
12/// Framebuffer state captured before ExitBootServices. 12/// Framebuffer state captured before ExitBootServices.
13pub struct Framebuffer { 13pub struct Framebuffer {
@@ -91,6 +91,19 @@ pub fn last_boot_stage() -> alloc::string::String {
91/// the preemptive scheduler. Set via the shell `stall` command. 91/// the preemptive scheduler. Set via the shell `stall` command.
92pub static DISPLAY_STALL: AtomicU32 = AtomicU32::new(0); 92pub static DISPLAY_STALL: AtomicU32 = AtomicU32::new(0);
93 93
94/// Set once a diagnostic QR has been rendered on screen. While locked, the
95/// klog screen echo is suppressed so subsequent log lines cannot overwrite
96/// the QR; the serial console keeps the full stream. Never released (the
97/// QR is the "photograph this" surface for hardware with no serial pipe).
98pub static QR_LOCKED: AtomicBool = AtomicBool::new(false);
99
100pub fn qr_lock() {
101 QR_LOCKED.store(true, Ordering::Relaxed);
102}
103pub fn qr_locked() -> bool {
104 QR_LOCKED.load(Ordering::Relaxed)
105}
106
94#[inline] 107#[inline]
95fn stall_display() { 108fn stall_display() {
96 let n = DISPLAY_STALL.load(Ordering::Relaxed); 109 let n = DISPLAY_STALL.load(Ordering::Relaxed);
@@ -308,7 +321,8 @@ pub fn shadow_late_init() {
308/// boot stage is written straight to the framebuffer — the last visible 321/// boot stage is written straight to the framebuffer — the last visible
309/// marker before a hang identifies where the kernel died. Uses the 322/// marker before a hang identifies where the kernel died. Uses the
310/// direct-display glyph path (the shadow may not exist yet in early 323/// direct-display glyph path (the shadow may not exist yet in early
311/// boot); the shell banner overwrites row 0 at first paint. 324/// boot). Row 0 stays a persistent status line: the shell starts its
325/// output at row 1 so the marker survives a post-boot freeze.
312pub fn boot_marker(msg: &str) { 326pub fn boot_marker(msg: &str) {
313 boot_marker_at(msg, 0); 327 boot_marker_at(msg, 0);
314} 328}