diff --git a/build.zig b/build.zig index 562938a..e609877 100644 --- a/build.zig +++ b/build.zig @@ -314,12 +314,12 @@ pub fn build(b: *std.Build) void { // driver to drive its device (open / control / interrupt / bulk). A protocol // module like vfs-protocol, shared by the bus driver and every class driver. const usb_transfer_protocol_module = b.addModule("usb-transfer-protocol", .{ - .root_source_file = b.path("system/drivers/usb-xhci-bus/usb-transfer-protocol.zig"), + .root_source_file = b.path("library/protocol/usb-transfer/usb-transfer-protocol.zig"), }); // The block-device protocol: read/write of fixed-size blocks, spoken between a // filesystem and a block driver (usb-storage). A protocol module like the rest. const block_protocol_module = b.addModule("block-protocol", .{ - .root_source_file = b.path("system/services/block/protocol.zig"), + .root_source_file = b.path("library/protocol/block/block-protocol.zig"), }); // Kernel tunables (maximum_cpus, stack sizes, tick rate). A dependency-free module of diff --git a/system/services/block/protocol.zig b/library/protocol/block/block-protocol.zig similarity index 100% rename from system/services/block/protocol.zig rename to library/protocol/block/block-protocol.zig diff --git a/system/drivers/usb-xhci-bus/usb-transfer-protocol.zig b/library/protocol/usb-transfer/usb-transfer-protocol.zig similarity index 100% rename from system/drivers/usb-xhci-bus/usb-transfer-protocol.zig rename to library/protocol/usb-transfer/usb-transfer-protocol.zig diff --git a/system/services/device-manager/device-manager.zig b/system/services/device-manager/device-manager.zig index 0623b99..fd4c000 100644 --- a/system/services/device-manager/device-manager.zig +++ b/system/services/device-manager/device-manager.zig @@ -42,6 +42,13 @@ const virtio_gpu_pci_class: u64 = pci_class.ClassCode.pack(.{ .prog_if = 0, }); + +const vga_compatible_gpu_pci_class: u64 = pci_class.ClassCode.pack(.{ + .base = @intFromEnum(pci_class.BaseClass.display), + .subclass = @intFromEnum(pci_class.display.SubClass.vga_compatible), + .prog_if = 0, +}); + /// The driver that serves a *reported* PCI function (M19.3: matching moved /// from the boot snapshot to the bus reports), or null. A machine can carry /// several identical controllers — one driver instance per reported device, @@ -49,6 +56,7 @@ const virtio_gpu_pci_class: u64 = pci_class.ClassCode.pack(.{ fn pciDriverForIdentity(identity: u64) ?[]const u8 { return switch (identity) { xhci_pci_class => "/system/drivers/usb-xhci-bus", + vga_compatible_gpu_pci_class => "/system/drivers/display", virtio_gpu_pci_class => "/system/drivers/virtio-gpu", else => null, };