SchOS/kernel/arch/x86_64
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Nexoniarz 60d06658f0 gfx: draw the console in RAM, and write it to the card write-combined
On the first real machine with a discrete card (an RTX 3060, 800x600 from
the UEFI GOP) the console was slow enough to photograph mid-scroll, and the
boot died on CPU 1's "cpu1: starting": CPU 0 spun 200M times on the console
lock while CPU 1 held it, scrolling, and called it a deadlock.

The framebuffer is device memory in the uncached 3-4 GB page of the direct
map. QEMU's stdvga is RAM underneath, so nothing showed there; on a card,
gfx_scroll_up's memmove read the whole screen back across the bus one byte
at a time, and every anti-aliased glyph read back each pixel it blended.

So the console now draws into a copy of the screen in RAM (vmap_alloc: kalloc
pages behind a page table of their own, since nothing needs it contiguous),
and gfx_flush() copies the changed rectangle onto the card through an
ioremap_wc() mapping -- PAT entry 4 set to write-combining on every CPU.
Flushes happen where drawing ends: a message, a terminal write, an echo, a
terminal switch. Scrolling moves eight bytes at a time instead of one.

/dev/fb0 reads and writes the card itself, as before. The early console's
fb_info now carries the physical address it always should have.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S1giNvrHTrPMPw7V6x1kQ4
2026-10-22 23:46:58 +02:00
..
acpi.c acpi: uACPI, for interrupt routing, the power button and power-off 2026-10-22 16:12:28 +02:00
e820.c mm: the loader jumped out from under itself, and 3 GB was never the limit 2026-09-25 15:23:55 +02:00
entry.S smp: every stack on every AP was misaligned by eight 2026-09-23 19:37:35 +02:00
entryother.S Initial commit: Schunix as it stands before the SchOS rename 2026-08-09 13:47:01 +02:00
ioapic.c acpi: uACPI, for interrupt routing, the power button and power-off 2026-10-22 16:12:28 +02:00
ioperm.c ldls: a second driver, and everything it found 2026-09-14 15:20:07 +02:00
lapic.c boot: stop assuming the machine is an emulator 2026-10-22 10:29:12 +02:00
mp.c boot: stop assuming the machine is an emulator 2026-10-22 10:29:12 +02:00
swtch.S Initial commit: Schunix as it stands before the SchOS rename 2026-08-09 13:47:01 +02:00
trap.c smp: every stack on every AP was misaligned by eight 2026-09-23 19:37:35 +02:00
trapasm.S syscall: three globals on the entry path, shared by every CPU 2026-09-21 22:56:45 +02:00
vectors.S Initial commit: Schunix as it stands before the SchOS rename 2026-08-09 13:47:01 +02:00
vm.c gfx: draw the console in RAM, and write it to the card write-combined 2026-10-22 23:46:58 +02:00
watch.c licence: SchOS is GPL-2.0-or-later, no longer Apache-2.0 2026-10-22 08:48:45 +02:00