This project is read-only.

Can't find any devices on the PCI bus

Topics: Using Cosmos (Developing your own OS, projects, etc)
Jul 18, 2012 at 3:42 AM

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);
    break;
}
Console.WriteLine("");

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? 

Jul 18, 2012 at 3:44 AM
On 7/17/2012 10:42 PM, CMDOS wrote:
> 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 devin Cosmos.Hardware2.PCIBus.Devices)
> {
> Console.WriteLine("Found PCI device" + dev.Bus +":" + dev.Slot +":" + dev.Function);
> Console.WriteLine("PCI IRQ:" + dev.InterruptLine);
> break;
> }
> Console.WriteLine("");

There is an open bug in the bug system regarding PCI, but there are also
some compiler issues which we are getting close to resolving which were
causing a lot of issues in drivers.
Jul 18, 2012 at 3:58 AM

OK thanks. I appreciate the quick reply!