Getting IO Base ports using PCI

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
Lon

Getting IO Base ports using PCI

Post 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
smiddy

Re:Getting IO Base ports using PCI

Post by smiddy »

Check out the document here: [Link Deleted!]

Chapter 6 explains it pretty well.
Lon

Re:Getting IO Base ports using PCI

Post by Lon »

wow thats got loads more info in it than the spec I've been working off, thanks! :)

Lon
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Getting IO Base ports using PCI

Post by Pype.Clicker »

we have an entry in the FAQ aswel ;)
smiddy

Re:Getting IO Base ports using PCI

Post by smiddy »

After reading the Wiki, I have since deleted the link. I had no idea that the document isn't freely available.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Getting IO Base ports using PCI

Post by Pype.Clicker »

np. btw, i updated the wiki with informations about decoding BARs (based on clicker's code and SIGOPS documents)
smiddy

Re:Getting IO Base ports using PCI

Post 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...
Lon

Re:Getting IO Base ports using PCI

Post 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 :)
smiddy

Re:Getting IO Base ports using PCI

Post 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.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Getting IO Base ports using PCI

Post by Pype.Clicker »

geezer has PCI code in C. You can find some in Clicker (src/mod/io/pci) and The Mobius aswell.
Post Reply