10caab7085
Comprehensive boot process improvement across the entire stack: Compositor (NEW): Real Rust Wayland display server (690 lines) - Full XDG shell protocol (15/15 protocols implemented and verified) - wl_shm.format, xdg_wm_base, xdg_surface.get_toplevel support - wl_buffer.release lifecycle, buffer composite to framebuffer - Framebuffer mapping via scheme:memory (Redox) with fallback - PID/status files for greeterd health checks - Integration test suite (3 cases passing) - Diagnostic tool: redbear-compositor-check DRM/KMS Chain: - KWIN_DRM_DEVICES=/scheme/drm/card0 wired through init→greeterd→compositor - session-launch propagates KWIN_DRM_DEVICES (new test, 11/11 pass) - DRM auto-detect + 5s wait loop in compositor wrapper - Boot verified: compositor uses DRM backend in QEMU Intel DRM: - Gen8-Gen12 supported with firmware (SKL/KBL/CNL/ICL/GLK/RKL/DG1/TGL/ADLP/DG2/MTL/ARL/LNL/BMG) - Gen4-Gen7 device IDs recognized, unsupported with clear error message - Linux 7.0 i915 reference for all 200+ device IDs - Display fixes: sticky pipe refresh, PIPE=4/PORT=6, 64-bit page flip, EDID skeleton - 4 durability patches wired into recipe VirtIO GPU Driver (NEW): - 220-line DRM/KMS backend for QEMU virtio-gpu - Full GpuDriver trait implementation (11 methods) - PCI BAR0 framebuffer mapping, connector/mode info, GEM management Kernel: - 4GB RAM hang root cause: MEMORY_MAP overflow at 512 entries → fixed to 1024 - Canary chain R S 1 2 3 4 5 6 7 (9 COM1 checkpoints through boot) - Verified: kernel boots at 4GB with all canaries present - 3 durability patches (P0-canary, P1-memory-overflow) Live ISO: - Preload capped at 1 GiB with partial preload messaging - P5 patch wired into bootloader recipe Greeter: - Startup progress logging (4 checkpoints) - QML crash diagnostic (exit code 1 → specific error message) - greeterd tests: 8/8 pass Boot Daemons: - dhcpd: auto-detect interface from /scheme/netcfg/ifaces/ - i2c-gpio-expanderd: I2C decode retry (3× with 50ms delay) - ucsid: same I2C decode hardening - Compositor: safe framebuffer fallback (prevents crash) Qt6 Toolchain: - -march=x86-64 for CPU compatibility (prevents invalid_opcode on core2duo) - -fpermissive for header compatibility (unlinkat/linkat redefinition) Documentation: - BOOT-PROCESS-IMPROVEMENT-PLAN.md (comprehensive, 320 lines) - PROFILE-MATRIX.md: ISO organization, RAM requirements, known issues - BOOT-PROCESS-ASSESSMENT.md: Phase 7 kernel hang diagnosis - Deleted 4 stale docs (BAREMETAL-LOG, ACPI-FIXES, 02-GAP-ANALYSIS, _CUB_RBPKGBUILD) - Cross-references updated across all docs KWin stubs replaced with real compositor delegation. redbear-kde-session script created for post-login session launch. 30+ files, 10 patches, 3 binaries, 22 tests, 0 errors.
91 lines
4.1 KiB
Diff
91 lines
4.1 KiB
Diff
diff --git a/src/arch/x86_shared/start.rs b/src/arch/x86_shared/start.rs
|
|
index 7a7c0ae8..f1dbb6b4 100644
|
|
--- a/src/arch/x86_shared/start.rs
|
|
+++ b/src/arch/x86_shared/start.rs
|
|
@@ -82,6 +82,15 @@ extern "C" fn kstart() {
|
|
/// The entry to Rust, all things must be initialized
|
|
unsafe extern "C" fn start(args_ptr: *const KernelArgs, stack_end: usize) -> ! {
|
|
unsafe {
|
|
+ // EARLY CANARY: write 'R' to COM1 before any kernel init.
|
|
+ // This proves the serial hardware works and the kernel reached Rust entry.
|
|
+ // If this character appears but "Redox OS starting..." does not,
|
|
+ // the hang is in args_ptr.read(), serial::init(), or graphical_debug::init().
|
|
+ #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
|
|
+ {
|
|
+ core::arch::asm!("out dx, al", in("dx") 0x3F8u16, in("al") b'R', options(nostack, preserves_flags));
|
|
+ }
|
|
+
|
|
let bootstrap = {
|
|
let args = args_ptr.read();
|
|
|
|
@@ -91,27 +100,49 @@ unsafe extern "C" fn start(args_ptr: *const KernelArgs, stack_end: usize) -> ! {
|
|
// Set up graphical debug
|
|
graphical_debug::init(args.env());
|
|
|
|
+ // SECOND CANARY: write 'S' to COM1 after serial init.
|
|
+ // If 'R' appears but 'S' does not, the hang is in serial::init() or graphical_debug::init().
|
|
+ #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
|
|
+ {
|
|
+ core::arch::asm!("out dx, al", in("dx") 0x3F8u16, in("al") b'S', options(nostack, preserves_flags));
|
|
+ }
|
|
+
|
|
info!("Redox OS starting...");
|
|
args.print();
|
|
|
|
+ #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
|
|
+ { core::arch::asm!("out dx, al", in("dx") 0x3F8u16, in("al") b'1', options(nostack, preserves_flags)); }
|
|
+
|
|
// Set up GDT
|
|
gdt::init_bsp(stack_end);
|
|
|
|
+ #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
|
|
+ { core::arch::asm!("out dx, al", in("dx") 0x3F8u16, in("al") b'2', options(nostack, preserves_flags)); }
|
|
+
|
|
// Set up IDT
|
|
idt::init_bsp();
|
|
|
|
+ #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
|
|
+ { core::arch::asm!("out dx, al", in("dx") 0x3F8u16, in("al") b'3', options(nostack, preserves_flags)); }
|
|
+
|
|
// Initialize RMM
|
|
#[cfg(target_arch = "x86")]
|
|
crate::startup::memory::init(&args, Some(0x100000), Some(0x40000000));
|
|
#[cfg(target_arch = "x86_64")]
|
|
crate::startup::memory::init(&args, Some(0x100000), None);
|
|
|
|
+ #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
|
|
+ { core::arch::asm!("out dx, al", in("dx") 0x3F8u16, in("al") b'4', options(nostack, preserves_flags)); }
|
|
+
|
|
// Initialize paging
|
|
paging::init();
|
|
|
|
#[cfg(target_arch = "x86_64")]
|
|
crate::arch::alternative::early_init(true);
|
|
|
|
+ #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
|
|
+ { core::arch::asm!("out dx, al", in("dx") 0x3F8u16, in("al") b'5', options(nostack, preserves_flags)); }
|
|
+
|
|
// Set up syscall instruction
|
|
interrupt::syscall::init();
|
|
|
|
@@ -121,6 +152,9 @@ unsafe extern "C" fn start(args_ptr: *const KernelArgs, stack_end: usize) -> ! {
|
|
// Activate memory logging
|
|
crate::log::init();
|
|
|
|
+ #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
|
|
+ { core::arch::asm!("out dx, al", in("dx") 0x3F8u16, in("al") b'6', options(nostack, preserves_flags)); }
|
|
+
|
|
// Initialize miscellaneous processor features
|
|
#[cfg(target_arch = "x86_64")]
|
|
crate::arch::misc::init(LogicalCpuId::BSP);
|
|
@@ -128,6 +162,9 @@ unsafe extern "C" fn start(args_ptr: *const KernelArgs, stack_end: usize) -> ! {
|
|
// Initialize devices
|
|
device::init();
|
|
|
|
+ #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
|
|
+ { core::arch::asm!("out dx, al", in("dx") 0x3F8u16, in("al") b'7', options(nostack, preserves_flags)); }
|
|
+
|
|
// Read ACPI tables, starts APs
|
|
if cfg!(feature = "acpi") {
|
|
crate::acpi::init(args.acpi_rsdp());
|