reorg: relocate device/service clients (C3/C4)
- device.zig + device-manager.zig -> library/device/driver/driver.zig (module
"driver"): the driver author's whole interface — device access (claim/mmioMap/
irqBind/...) plus the device-manager hello() handshake, folded into one import.
- block.zig -> library/device/block/block.zig (a device type).
- display.zig/input.zig -> library/client/{display,input}/ (userspace-service
clients — they talk to services, not the kernel).
build.zig module graph updated; the runtime shim now maps runtime.device and
runtime.device_manager onto "driver", so consumers stay untouched (migrated in C2).
zig build green; driver-restart, usb-storage, display-native, input pass.
This commit is contained in:
@@ -481,32 +481,31 @@ pub fn build(b: *std.Build) void {
|
||||
.root_source_file = b.path("library/kernel/start.zig"),
|
||||
.imports = &.{ .{ .name = "process", .module = process_module }, .{ .name = "logging", .module = logging_module } },
|
||||
});
|
||||
const device_module = b.addModule("device", .{
|
||||
.root_source_file = b.path("library/kernel/device.zig"),
|
||||
// The driver author's interface (library/device/driver): device access + the
|
||||
// device-manager hello handshake, folded together.
|
||||
const driver_module = b.addModule("driver", .{
|
||||
.root_source_file = b.path("library/device/driver/driver.zig"),
|
||||
.imports = &.{
|
||||
.{ .name = "abi", .module = abi_module },
|
||||
.{ .name = "device-abi", .module = device_abi_module },
|
||||
.{ .name = "system-call", .module = system_call_module },
|
||||
},
|
||||
});
|
||||
const device_manager_client_module = b.addModule("device-manager", .{
|
||||
.root_source_file = b.path("library/kernel/device-manager.zig"),
|
||||
.imports = &.{
|
||||
.{ .name = "ipc", .module = ipc_module },
|
||||
.{ .name = "time", .module = time_module },
|
||||
.{ .name = "device-manager-protocol", .module = device_manager_protocol_module },
|
||||
},
|
||||
});
|
||||
// The block-device client — a device type, so library/device/block.
|
||||
const block_client_module = b.addModule("block", .{
|
||||
.root_source_file = b.path("library/kernel/block.zig"),
|
||||
.root_source_file = b.path("library/device/block/block.zig"),
|
||||
.imports = &.{
|
||||
.{ .name = "ipc", .module = ipc_module },
|
||||
.{ .name = "time", .module = time_module },
|
||||
.{ .name = "block-protocol", .module = block_protocol_module },
|
||||
},
|
||||
});
|
||||
// Userspace-service clients live in library/client (they talk to services, not the kernel).
|
||||
const display_client_module = b.addModule("display", .{
|
||||
.root_source_file = b.path("library/kernel/display.zig"),
|
||||
.root_source_file = b.path("library/client/display/display.zig"),
|
||||
.imports = &.{
|
||||
.{ .name = "ipc", .module = ipc_module },
|
||||
.{ .name = "time", .module = time_module },
|
||||
@@ -514,7 +513,7 @@ pub fn build(b: *std.Build) void {
|
||||
},
|
||||
});
|
||||
const input_client_module = b.addModule("input", .{
|
||||
.root_source_file = b.path("library/kernel/input.zig"),
|
||||
.root_source_file = b.path("library/client/input/input.zig"),
|
||||
.imports = &.{
|
||||
.{ .name = "ipc", .module = ipc_module },
|
||||
.{ .name = "time", .module = time_module },
|
||||
@@ -546,8 +545,7 @@ pub fn build(b: *std.Build) void {
|
||||
.{ .name = "logging", .module = logging_module },
|
||||
.{ .name = "file-system", .module = file_system_module },
|
||||
.{ .name = "start", .module = start_module },
|
||||
.{ .name = "device", .module = device_module },
|
||||
.{ .name = "device-manager", .module = device_manager_client_module },
|
||||
.{ .name = "driver", .module = driver_module },
|
||||
.{ .name = "input", .module = input_client_module },
|
||||
.{ .name = "block", .module = block_client_module },
|
||||
.{ .name = "display", .module = display_client_module },
|
||||
|
||||
Reference in New Issue
Block a user