⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

Module pat

Module pat 

Source
Expand description

Page Attribute Table (PAT) initialization for write-combining memory.

Reprograms PAT entry 1 from WT (write-through) to WC (write-combining), then provides apply_write_combining() to set framebuffer page table entries to use the WC memory type. This yields 5-150x faster MMIO writes for the fbcon flush path.

§PAT index mapping after init()

IndexPWTPCDPATType
0000WB
1100WC (was WT)
2010UC-
3110UC
4-71(mirrors 0-3 by default)

Framebuffer PTEs use index 1 (PWT=1, PCD=0, PAT=0) for write-combining.

Functions§

apply_write_combining
Apply write-combining attributes to a virtual address range.
init
Reprogram PAT entry 1 from WT to WC.