feat: playable snake game via UART terminal rendering

Snake renders using ANSI escape codes via debug_putchar syscall,
bypassing the VirtIO GPU (which has a QEMU 11.x legacy MMIO bug
where transfer_to_host_2d succeeds but doesn't transfer data).

Full microkernel stack running end-to-end:
  adapter → init → storage-server IPC → load snake from disk →
  input-server IPC (UART keyboard) → snake game logic →
  debug_putchar syscall → UART → terminal display

Controls: WASD to steer, runs at 0.2s tick rate.
Green O=head, o=body, red @=food, #=border.
This commit is contained in:
2026-10-18 22:08:52 +02:00
parent 27be73f42d
commit a3b15e5264
6 changed files with 117 additions and 191 deletions

View File

@@ -8,20 +8,7 @@ use types::bounded::CapSlot;
#[unsafe(no_mangle)]
extern "C" fn main() {
let mut fb = VirtioFramebuffer::new();
use port_framebuffer::Framebuffer;
use types::display::{Color, Dimension, ScreenCoord};
// Initial clear to dark blue so we know the GPU works
fb.clear(Color::rgb(0, 0, 40));
fb.fill_rect(
ScreenCoord::new(10), ScreenCoord::new(10),
Dimension::new(200), Dimension::new(30),
Color::rgb(255, 255, 255),
);
fb.flush();
let fb = VirtioFramebuffer::new();
let mut srv = display_server::server::DisplayServer::new(fb);
let ep = CapSlot::new(0).unwrap();
server_framework::serve(&mut srv, ep);