I am writing an operating system with COSMOS User Kit 87612. I have referenced the Cosmos.Hardware and Cosmos.Hardware2 DLLs in the 87612 devkit as well. Everything is working fine except device detection. Here is my code:
Console.WriteLine(Cosmos.Hardware2.PCIBus.Devices.Length.ToString() + " devices found... ");
foreach (Cosmos.Hardware2.PCIDevice dev in Cosmos.Hardware2.PCIBus.Devices)
Console.WriteLine("Found PCI device " + dev.Bus + ":" + dev.Slot + ":" + dev.Function);
Console.WriteLine("PCI IRQ: " + dev.InterruptLine);
However, the length of the devices array always comes back as -268370093, so the
foreach loop is never executed. It is especially weird that the length is
negative. Any suggestions?