add multi-sink diagnostic log; make framebuffer optional

This commit is contained in:
Daniel Samson
2026-07-08 10:40:22 +01:00
parent 7d3417fe86
commit cb63d2e31b
6 changed files with 279 additions and 106 deletions
+10 -1
View File
@@ -24,12 +24,21 @@ pub const PixelFormat = enum(u32) {
/// A linear framebuffer: `width`x`height` pixels, each a 32-bit value, with
/// `pitch` bytes between the start of one row and the next (which may be larger
/// than `width * 4` due to hardware padding).
///
/// A `base` of 0 means **no framebuffer** — the firmware exposed no Graphics
/// Output Protocol (a headless server, say). The kernel must treat on-screen
/// output as optional and never assume a framebuffer exists.
pub const Framebuffer = extern struct {
base: usize, // the memory address where pixel data starts
base: usize, // the memory address where pixel data starts (0 = none)
width: u32, // visible pixels per row (e.g. 1920)
height: u32, // visible rows (e.g. 1080)
pitch: u32, // bytes from the start of one row to the start of the next
format: PixelFormat,
/// Whether a usable framebuffer was handed over.
pub fn present(self: Framebuffer) bool {
return self.base != 0 and self.width != 0 and self.height != 0;
}
};
/// Page size the memory map is measured in. 4 KiB on every architecture danos