The console's one-time full-screen clear was millions of individual uncached word-writes to the GPU BAR: fine in QEMU, but on real hardware firmware MTRRs force that region uncacheable, so the clear crawls. Program PAT entry 4 to write-combining (setupPat, on the BSP and every AP) and map the framebuffer window with the PAT bit, so those writes batch into bursts. The clear ran on the *loader's* uncached mapping because console.init happened before enablePaging. Move it to just after paging, so it uses the kernel's write-combining mapping instead. The cost: on-screen output is absent before paging (an early panic still lands in the serial/RAM log). Verified: 11 QEMU cases (incl. SMP AP-PAT, USB/FAT/ACPI) plus a screendump showing the framebuffer cleared to black with the status text rendered correctly. |
||
|---|---|---|
| .. | ||
| apic.zig | ||
| cpu.zig | ||
| gdt.zig | ||
| idt.zig | ||
| io.zig | ||
| ioapic.zig | ||
| isr.s | ||
| linker.ld | ||
| paging.zig | ||
| per-cpu.zig | ||
| serial.zig | ||
| smp.zig | ||
| trampoline.s | ||
| tss.zig | ||