diff --git a/src/userland/loader/main.c b/src/userland/loader/main.c index 5e9062f..7a49026 100644 --- a/src/userland/loader/main.c +++ b/src/userland/loader/main.c @@ -7,6 +7,7 @@ loadFromInitrd("ioManager"); printf("HONEY-OS - made by Lukas Eisenhauer\n"); printf("finished loading all the essential modules\n"); + loadFromInitrd("lspci"); uint32_t id = loadFromInitrdUninitialized("shell"); requestName("ioManager", "setForeground", id, 0); request(id, getFunction(id, "main"), 0, 0); diff --git a/src/userland/loader/main.c b/src/userland/loader/main.c index 5e9062f..7a49026 100644 --- a/src/userland/loader/main.c +++ b/src/userland/loader/main.c @@ -7,6 +7,7 @@ loadFromInitrd("ioManager"); printf("HONEY-OS - made by Lukas Eisenhauer\n"); printf("finished loading all the essential modules\n"); + loadFromInitrd("lspci"); uint32_t id = loadFromInitrdUninitialized("shell"); requestName("ioManager", "setForeground", id, 0); request(id, getFunction(id, "main"), 0, 0); diff --git a/src/userland/lspci/main.c b/src/userland/lspci/main.c index 90f6be8..29ec790 100644 --- a/src/userland/lspci/main.c +++ b/src/userland/lspci/main.c @@ -132,14 +132,23 @@ } } +bool initialized = false; + int32_t main() { - printf("enumerating PCI devices . . .\n"); - if (!(getHeaderType(0, 0, 0) & 0x80)) { - checkBus(0); - } else { - for (uint8_t bus = 0; bus < 8; bus++) { - checkBus(bus); + if (!initialized) { + if (!(getHeaderType(0, 0, 0) & 0x80)) { + checkBus(0); + } else { + for (uint8_t bus = 0; bus < 8; bus++) { + checkBus(bus); + } } + initialized = true; + return 0; } - printf("enumerated %i pci devices\n", listCount(pciDevices)); + foreach (pciDevices, PciDevice *, device, { + printf("[%i:%i:%i]: %s\n", device->bus, device->device, + device->function, classNames[device->class]); + }) + ; }