From 55bcdf37342d782c723166de54ff031d09b1281f Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Wed, 15 Oct 2025 19:32:21 -0700 Subject: Clear framebuffer to pink --- src/kernel.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'src/kernel.c') diff --git a/src/kernel.c b/src/kernel.c index 151028d..2a4005a 100644 --- a/src/kernel.c +++ b/src/kernel.c @@ -2,8 +2,11 @@ #include #include #include +#include #include +#include + static void halt() { while (1) { asm volatile("wfi"); // Wait for interrupt. Core enters low-power state. @@ -13,6 +16,7 @@ static void halt() { void main() { bool success = true; uint32_t error = -1; + char buf[32]; const int raspi = raspi_init(); mmio_init(raspi); // Must be initialized before other peripherals. @@ -31,7 +35,24 @@ void main() { goto end; } - uart_print("Hello world!\n"); + const Framebuffer* fb = framebuffer_get(); + uart_print("Framebuffer:"); + uart_print("\n width: "); + uart_print(utoa(fb->width, buf, sizeof(buf))); + uart_print("\n height: "); + uart_print(utoa(fb->height, buf, sizeof(buf))); + uart_print("\n depth: "); + uart_print(utoa(fb->depth, buf, sizeof(buf))); + uart_print("\n addr: "); + uart_print(ptoa(fb->pixels, buf, sizeof(buf))); + uart_print("\n size: "); + uart_print(utoa(fb->size, buf, sizeof(buf))); + uart_print("\n"); + + uart_print("Clearing framebuffer\n"); + framebuffer_clear((Pixel){255, 0, 255}); + + uart_print("All done\n"); end: halt(); -- cgit v1.2.3