diff options
| author | salmonik <salmonik@tuta.io> | 2026-08-17 14:53:52 +0200 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-08-17 14:53:52 +0200 |
| commit | be868a43185826b02bf6d091019bb779678525bb (patch) | |
| tree | 586988c15f1d700b1621c7f0208584b30878a56c /rsnix/src/gop.rs | |
| parent | v0.5.10: change em-dashes to dashes (diff) | |
| download | rs-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.rs | 18 |
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; | |||
| 7 | use crate::uefi::{GopModeInfo, GraphicsOutputProtocol, EFI_SUCCESS, PIXEL_BGR, PIXEL_RGB}; | 7 | use crate::uefi::{GopModeInfo, GraphicsOutputProtocol, EFI_SUCCESS, PIXEL_BGR, PIXEL_RGB}; |
| 8 | use core::fmt; | 8 | use core::fmt; |
| 9 | use core::ptr; | 9 | use core::ptr; |
| 10 | use core::sync::atomic::{AtomicU32, AtomicU64, AtomicU8, Ordering}; | 10 | use core::sync::atomic::{AtomicBool, AtomicU32, AtomicU64, AtomicU8, Ordering}; |
| 11 | 11 | ||
| 12 | /// Framebuffer state captured before ExitBootServices. | 12 | /// Framebuffer state captured before ExitBootServices. |
| 13 | pub struct Framebuffer { | 13 | pub 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. |
| 92 | pub static DISPLAY_STALL: AtomicU32 = AtomicU32::new(0); | 92 | pub 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). | ||
| 98 | pub static QR_LOCKED: AtomicBool = AtomicBool::new(false); | ||
| 99 | |||
| 100 | pub fn qr_lock() { | ||
| 101 | QR_LOCKED.store(true, Ordering::Relaxed); | ||
| 102 | } | ||
| 103 | pub fn qr_locked() -> bool { | ||
| 104 | QR_LOCKED.load(Ordering::Relaxed) | ||
| 105 | } | ||
| 106 | |||
| 94 | #[inline] | 107 | #[inline] |
| 95 | fn stall_display() { | 108 | fn 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. | ||
| 312 | pub fn boot_marker(msg: &str) { | 326 | pub fn boot_marker(msg: &str) { |
| 313 | boot_marker_at(msg, 0); | 327 | boot_marker_at(msg, 0); |
| 314 | } | 328 | } |
