Finding the plug and play busses

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Finding the plug and play busses

Post 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.
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Post 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.
C8H10N4O2 | #446691 | Trust the nodes.
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Post 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 :)
User avatar
CmpXchg
Member
Member
Posts: 61
Joined: Mon Apr 28, 2008 12:14 pm
Location: Petrozavodsk, Russia during school months, Vänersborg Sweden in the summertime

Re: Finding the plug and play busses

Post 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
Every Man Must Learn David DeAngelo's Stuff, Period.
http://www.doubleyourdating.com/Catalog
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Re: Finding the plug and play busses

Post 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.
Korona
Member
Member
Posts: 1000
Joined: Thu May 17, 2007 1:27 pm
Contact:

Post 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.
User avatar
CmpXchg
Member
Member
Posts: 61
Joined: Mon Apr 28, 2008 12:14 pm
Location: Petrozavodsk, Russia during school months, Vänersborg Sweden in the summertime

Post 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.
Every Man Must Learn David DeAngelo's Stuff, Period.
http://www.doubleyourdating.com/Catalog
Post Reply