Page 1 of 1

Getting IO Base ports using PCI

Posted: Thu Jun 09, 2005 11:47 am
by Lon
Hi,

While I was trying to get the base IO port for the ne2000 in qemu (I found it later to be 0xc100 using Solar OS) in Ralf Browns interrupt list http://www.delorie.com/djgpp/doc/rbinter/it/82/8.html
I noticed it says
"bits 31-2 of base I/O port"
now this might sound like a stupid question but...
What about bits 0 and 1?? where does it say what value they should be?

thanks

Lon

Re:Getting IO Base ports using PCI

Posted: Thu Jun 09, 2005 2:52 pm
by smiddy
Check out the document here: [Link Deleted!]

Chapter 6 explains it pretty well.

Re:Getting IO Base ports using PCI

Posted: Thu Jun 09, 2005 3:12 pm
by Lon
wow thats got loads more info in it than the spec I've been working off, thanks! :)

Lon

Re:Getting IO Base ports using PCI

Posted: Fri Jun 10, 2005 3:37 am
by Pype.Clicker
we have an entry in the FAQ aswel ;)

Re:Getting IO Base ports using PCI

Posted: Fri Jun 10, 2005 6:31 am
by smiddy
After reading the Wiki, I have since deleted the link. I had no idea that the document isn't freely available.

Re:Getting IO Base ports using PCI

Posted: Fri Jun 10, 2005 8:09 am
by Pype.Clicker
np. btw, i updated the wiki with informations about decoding BARs (based on clicker's code and SIGOPS documents)

Re:Getting IO Base ports using PCI

Posted: Fri Jun 10, 2005 11:28 am
by smiddy
SolarOS has pretty explanatory code, albeit, not so well documented, on PCI enumeration. Combine Bogdan's code with chapter 6 and you will get the gest of what is going on. Look in the PCI directory of SolarOS...

Re:Getting IO Base ports using PCI

Posted: Fri Jun 10, 2005 6:46 pm
by Lon
Erm yer SolarOS , thats made in pure ASM isnt it.. bit scary for a C hacker like myself ;)

The wiki has definately proved helpful although tis certainly quite a bit of work just to get a port address! but oh well :)

Re:Getting IO Base ports using PCI

Posted: Sat Jun 11, 2005 3:05 am
by smiddy
You know what they say, "...nothings for free." ;D Seriously though, if you have the time, it is worth studying his code to understand it as it is pretty straight forward. You'll want to know ASM if you intend on OS programming too as somethings are coded in ASM for the sheer speed. The more proficient you are the less time it will take. It is that leanring curve which takes time.

Re:Getting IO Base ports using PCI

Posted: Sun Jun 12, 2005 2:27 am
by Pype.Clicker
geezer has PCI code in C. You can find some in Clicker (src/mod/io/pci) and The Mobius aswell.