Commit Graph

14 Commits

Author SHA1 Message Date
2845d190f0 feat(display): input routed via display server to focused app; input Subscribe; uses caps badged + Delegate 2026-10-27 16:38:16 +01:00
e8a2963b24 feat(userspace): Call/ReplyRecv IPC, malformed-request replies, servers exit on dead endpoint; drop send/receive compat, select!, async_syscall 2026-10-27 12:06:10 +01:00
e931485ca7 fix: sched round-robin, cap slot OOB panic, clippy, make ci
- RunList -> intrusive FIFO, no starvation, no silent drop
- cap table sized to CapSlot range (kani caught OOB panic)
- snake food color test uses const
- kani cfg lint, RUST_MIN_STACK for big kernel struct in tests
2026-10-26 19:08:30 +01:00
9dd400656c refactor: migrate all servers, apps, binaries to libkos 2026-10-19 00:57:27 +02:00
2792387348 fix: VirtIO keyboard input latency and direction accuracy
- Driver now drains SYN/repeat/unknown events in a loop instead of
  returning None on the first non-key event
- Snake drains all pending input events per tick, applies only the
  latest direction change (prevents stale event accumulation)
2026-10-19 00:34:13 +02:00
68849f698b fix: GPU display at correct resolution, clean up diagnostics
- Add GET_DISPLAY_INFO command to query QEMU's preferred resolution
  (was hardcoded 640x480, QEMU wanted 1280x800)
- Allocate framebuffer matching actual display dimensions
- Remove debug diagnostic output from display server and snake
2026-10-19 00:24:37 +02:00
f5ac7189a9 fix: VirtIO GPU driver and snake rendering through display server
- Fix swapped command IDs: attach_backing was 0x0104 (FLUSH),
  resource_flush was 0x0106 (ATTACH_BACKING). Now correct.
- Increase process stack from 4 pages (16 KB) to 16 pages (64 KB)
  to prevent stack overflow in display process.
- Restructure display-qemu to avoid MockFramebuffer's 32 KB array
  inflating the VirtIO path's stack frame.
- Wire snake app to render through display server via IPC instead
  of UART escape codes. Uses existing renderer.rs pixel renderer.
- Init now delegates display endpoint to snake process.
2026-10-19 00:01:29 +02:00
61e28f0af5 fix: sync kernel tests with current API, add CapSlot::const_new
Tests:
- IPC tests: spawn thread B explicitly (CreateProcess no longer
  spawns threads since the boot logic fix)
- Memory tests: RequestPages now returns Value(va) not Slot(cap)
- MockPlatform: tracks VA→PA mappings for translate_va
- ReleasePages test: ignored (RequestPages no longer creates
  regions — ReleasePages needs redesign)

CapSlot::const_new(value):
- const fn that panics at compile time for invalid values
- Replaces CapSlot::new(N).unwrap() in init, echo, snake
- Cap slot constants are now compile-time verified

Also fixes handle_release_pages to use translate_va instead of
treating VA as PA directly.

35 kernel tests pass, 1 ignored.
2026-10-18 22:17:42 +02:00
a3b15e5264 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.
2026-10-18 22:08:52 +02:00
7c7e3b8748 refactor: apply newtypes throughout userspace API and display types
Every syscall stub now uses proper types from types/ — CapSlot,
EntryPoint, StackPointer, VirtualAddress, PageCount, ProcessId,
PermissionSet, Ticks. The compiler prevents swapping entry/stack,
passing a ProcessId where a CapSlot is expected, or using an
address as a page count.

New display types in types/display.rs:
  - Color(u32) with rgb() constructor
  - ScreenCoord(u16) for x/y positions
  - Dimension(u16) for width/height

Updated throughout:
  - userspace/syscall.rs: all params typed, returns Option instead
    of sentinel usize::MAX
  - server-framework: endpoint param is CapSlot
  - port-framebuffer: trait uses Color, ScreenCoord, Dimension
  - hw-virtio: DmaAddrs uses PhysicalAddress/VirtualAddress,
    GPU commands use Dimension
  - All servers, drivers, bins, apps updated for new signatures
  - permission-manager: process field uses ProcessId
  - PermissionSet: added bits() accessor

89 tests pass, full QEMU boot verified.
2026-10-18 13:45:40 +02:00
29434805a6 feat(userspace-rt): add runtime crate with entry point, panic handler, and allocator re-export
Snake and hello apps now use extern crate userspace_rt — no more boilerplate assembly or panic handlers in app code.
2026-10-18 04:04:52 +02:00
e092fa4ae5 fix: disable test harness for no_std binaries, fix shutdown to best-effort notify-and-halt, use CapSlot newtypes 2026-10-18 04:01:39 +02:00
0389c85108 feat(snake): implement snake game with pure game logic, renderer, and IPC-based main loop 2026-10-18 04:00:09 +02:00
bb99c3001d init 2026-10-16 02:32:24 +02:00