Page 1 of 1

Finding the plug and play busses

Posted: Fri Jun 13, 2008 4:10 pm
by Owen
OK. After quite a bit of work, my memory managers seem solid, my exception handlers are useful, and I now have the base foundations of my kernel laid :)

Now, from here I would like to find all of the plug and play busses that my kernel could support out, like PCI, PCIE, AGP, and maybe even MCA (Like that's ever gonna happen :P)

The problem here is how do I find them. From my understanding, there are two ways to do this. If there are more, then please point me at them, since I was unable to find them on the OSDevWiki!

The first, and easiest, would be to use the MP tables. These are really simply laid out, provide the information you need, and Intel even have a very nice document on them. The problem here is most Uniprocessor machines don't have them... obviously...

And so the only remaining option is ACPI. Urgh. I have briefly looked into the ACPI specifications, and from my understanding, to do what MP would make so easy involves writing my own AML interpreter. Or, more likely, shoehorning Intel's ACPI implementation in since writing your own seems to be an inhuman task.

Now, please, someone tell me that doing something as simple as identifying the system's connected busses is easier than this. Please tell me that either there is a third method of which I have heard nothing or that ACPI is not the horrible complicated monstrosity that I hear it is.

Posted: Fri Jun 13, 2008 5:41 pm
by Alboin
AFAIK, AML is only needed when you are using the ACPI runtime. For the hardware detection part of it, all you need to to do is read the tables.

Check out RSDP In the wiki.

Posted: Fri Jun 13, 2008 5:51 pm
by Owen
Aah, excelent. While it's far too late for me to read through it now, I'll most definitely do so in the morning :)

And, once I have done that, I'll start working on the ACPI articles on the wiki :)

Re: Finding the plug and play busses

Posted: Sat Jun 14, 2008 9:11 am
by CmpXchg
Owen wrote:The first, and easiest, would be to use the MP tables. These are really simply laid out, provide the information you need, and Intel even have a very nice document on them. The problem here is most Uniprocessor machines don't have them... obviously...
Obviuosly? Well, I have a Uniprocessor system and it seems that some SMP table is present.

Well, actually only the Base Table is present (there are also OEM and Extended tables, which I don't have). But the Base table seems to contain the information about buses!

There is a program called PC Doctor, which showed me my tables.

It really shows something like

Code: Select all

Installed buses:
  Bus number 1:
    Bus ID:               00H
    Bus type:             PCI
  Bus number 2:
    Bus ID:               01H
    Bus type:             PCI
  Bus number 3:
    Bus ID:               02H
    Bus type:             ISA
Hope this helps,
CmpXchg

Re: Finding the plug and play busses

Posted: Sat Jun 14, 2008 10:44 am
by JamesM
CmpXchg wrote:
Owen wrote:The first, and easiest, would be to use the MP tables. These are really simply laid out, provide the information you need, and Intel even have a very nice document on them. The problem here is most Uniprocessor machines don't have them... obviously...
Obviuosly? Well, I have a Uniprocessor system and it seems that some SMP table is present.

Well, actually only the Base Table is present (there are also OEM and Extended tables, which I don't have). But the Base table seems to contain the information about buses!

There is a program called PC Doctor, which showed me my tables.

It really shows something like

Code: Select all

Installed buses:
  Bus number 1:
    Bus ID:               00H
    Bus type:             PCI
  Bus number 2:
    Bus ID:               01H
    Bus type:             PCI
  Bus number 3:
    Bus ID:               02H
    Bus type:             ISA
Hope this helps,
CmpXchg
You'll get SMP information too if you've got a uniprocessor with hyperthreading.

Posted: Sat Jun 14, 2008 1:26 pm
by Korona
I have an AMD 64 processor (no hyperthreading) and my mainboard also provides MP tables. They seem to be present on many modern chipsets.

Posted: Sat Jun 14, 2008 1:52 pm
by CmpXchg
Yes, I thought so too. Most modern motherboards will provide SMP tables, so it's not a problem.

Even if there're no tables, we can still be sure PCI bus is present (if it hadn't been, the OS wouldn't've been able to run on such a machine). USB and Firewire (IEEE1384) can be detected from PCI, so it ain't going to be a problem.

I'm not sure about MCA, but you'll probably find a way to handle it if you really need to.