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.
This commit is contained in:
2026-10-18 13:45:40 +02:00
parent 3a0395453b
commit 7c7e3b8748
42 changed files with 416 additions and 307 deletions

11
Cargo.lock generated
View File

@@ -57,6 +57,7 @@ dependencies = [
"display-server",
"driver-framebuffer-virtio",
"server-framework",
"types",
"userspace",
"userspace-rt",
]
@@ -84,6 +85,7 @@ version = "0.1.0"
dependencies = [
"hw-virtio",
"port-block-device",
"types",
]
[[package]]
@@ -91,6 +93,7 @@ name = "driver-framebuffer-mock"
version = "0.1.0"
dependencies = [
"port-framebuffer",
"types",
]
[[package]]
@@ -99,12 +102,14 @@ version = "0.1.0"
dependencies = [
"hw-virtio",
"port-framebuffer",
"types",
]
[[package]]
name = "echo"
version = "0.1.0"
dependencies = [
"types",
"userspace",
"userspace-rt",
]
@@ -131,6 +136,9 @@ dependencies = [
[[package]]
name = "hw-virtio"
version = "0.1.0"
dependencies = [
"types",
]
[[package]]
name = "init"
@@ -217,6 +225,9 @@ version = "0.1.0"
[[package]]
name = "port-framebuffer"
version = "0.1.0"
dependencies = [
"types",
]
[[package]]
name = "port-input-device"