[SOLVED] Questions on 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
HugeCode
Member
Member
Posts: 112
Joined: Mon Dec 17, 2012 9:12 am

[SOLVED] Questions on PCI

Post by HugeCode »

Hi all. I have few questions on PCI. The first one is practical:
  • - I can from the PCI configuration space by writing address of register I want to read to 0xCF8, and reading it from 0xCF8. On wiki page I found that I can write some configuration registers, but there's nothing about how what's the way to do it. Is it possible then? How can I do it?
    - Let's say I have graphic card connected to my computer via PCI. If I read BARs, can I get the memory or IO port for writing video memory? Or there's some special way and BARs are there only for some configurations?
Please help.
Last edited by HugeCode on Tue Apr 16, 2013 9:49 am, edited 1 time in total.
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: Questions on PCI

Post by bluemoon »

HugeCode wrote:Hi all. I have few questions on PCI. The first one is practical:
  • - I can from the PCI configuration space by writing address of register I want to read to 0xCF8, and reading it from 0xCF8. On wiki page I found that I can write some configuration registers, but there's nothing about how what's the way to do it. Is it possible then? How can I do it?
1. outl [register index] to address register
2. in/out [data register]
HugeCode wrote:- Let's say I have graphic card connected to my computer via PCI. If I read BARs, can I get the memory or IO port for writing video memory? Or there's some special way and BARs are there only for some configurations?[/list]
Please help.
In theory every graphic card may be different, and you should check the device identity from configuration and don't touch any device you don't know about. Next, check the device's manual for supported interface(s), which may involve multiple BARs, and there are types of BAR to tell about io port number, address, and IRQ.
HugeCode
Member
Member
Posts: 112
Joined: Mon Dec 17, 2012 9:12 am

Re: Questions on PCI

Post by HugeCode »

Thanks alot....
Post Reply