P2 of docs/establishment-planes-plan.md. usb-storage serves nameless — one process per stick cannot share an exclusive bind, and a second stick used to die silently on -EBUSY before ever helloing. Its one hello now moves both directions at once: the block-serving endpoint up, its controller channel down. fat finds its volume through the manager — a new `.consumer` role asks for the channel of the driver BOUND TO a device (distinct from the device's reporter), found by enumerating the tree for the mass-storage identity. fat stays single-volume; the boot-volume-by-content choice is M21. The conversion immediately caught a live truncation of exactly the audit's shape: ChildEntry grew to 32 bytes, one enumerate reply holds ~7, and a real tree carries a dozen ACPI nodes before the first USB child — the storage entry silently never fit (the protocol comment already said "paging joins the protocol if a tree ever outgrows one packet"). enumerate is now paged: Header.target is the start cursor, a short page is the end; device-list's page-0 read is unchanged. Grant rows move with the code: the block bind and fat's block open die, fat gains open device-manager. Gate: 18 cases green including the registry trio, device-list, and both IOMMU storage variants.
36 lines
1.4 KiB
Zig
36 lines
1.4 KiB
Zig
//! The fat service as a binary package (docs/build-packages-plan.md):
|
|
//! this file names the binary and EXACTLY the modules its source imports —
|
|
//! build-support resolves each name from the domains this zon declares.
|
|
|
|
const std = @import("std");
|
|
const build_support = @import("build-support");
|
|
|
|
pub fn build(b: *std.Build) void {
|
|
const exe = build_support.userBinary(b, .{
|
|
.name = "fat",
|
|
.root_source_file = b.path("fat.zig"),
|
|
.imports = &.{
|
|
"block", "channel", "device-manager-protocol", "driver",
|
|
"envelope", "file-system", "ipc", "logging",
|
|
"memory", "process", "service", "time",
|
|
"vfs-protocol",
|
|
},
|
|
});
|
|
b.installArtifact(exe);
|
|
|
|
// Standalone `zig build test`; the root aggregate depends on this step.
|
|
const test_step = b.step("test", "Run the fat unit tests");
|
|
for ([_][]const u8{
|
|
"on-disk.zig", // FAT on-disk struct sizes + type detection
|
|
"engine.zig", // FAT read/write over a RAM-backed image
|
|
}) |test_root| {
|
|
const unit_tests = b.addTest(.{
|
|
.root_module = b.createModule(.{
|
|
.root_source_file = b.path(test_root),
|
|
.target = b.resolveTargetQuery(.{}),
|
|
}),
|
|
});
|
|
test_step.dependOn(&b.addRunArtifact(unit_tests).step);
|
|
}
|
|
}
|