Page 1 of 1
enum pci
Posted: Mon Oct 18, 2010 5:16 pm
by a5498828
i would like to write something to show what peripherals are installed.
i think the best start would be pci...
how can i read pci peripherals, like linux lspci does?
Re: enum pci
Posted: Mon Oct 18, 2010 11:55 pm
by Combuster
STFW (yes, you deserve to be told so)
Re: enum pci
Posted: Thu Oct 21, 2010 9:26 am
by a5498828
ok i understand how does it work, but i lack terms like whats pci device, what can i read about it, and why.
whats bus number/device number/enable bit/etc, they dont explain it. and i read that this will also read pcie and agp buses. not good source, really, at least not for beginners.
Re: enum pci
Posted: Thu Oct 21, 2010 4:20 pm
by gravaera
Gee...
Well you see, kernel development isn't meant for people who don't know what a bus is...
It's also not meant for someone who isn't intelligent enough to guess what an "enable" bit does either.
I don't think you understand what "beginner" is in the context of kernel development: "beginner" in general programming terms is someone who doesn't know programming at all. That's fine: go learn programming. "Beginner" in the context of kernel development is not someone who doesn't know about computer theory 101, and doesn't know about the basic components of a computer, motherboard, basic processor theory, data structures, etc.
When it comes to kernel development, "beginner" takes on a new meaning and requires a higher bar for basic skills and knowledge. Go and lift yourself to the prerequisite bar and then I guarantee, that article will make perfect sense.
Re: enum pci
Posted: Fri Oct 22, 2010 7:33 am
by a5498828
I prefer to be sure instead of guessing.
Documentation is not clear and ambiguous = it suck.
function number = device can support diffrent functionality on low level
bus number = i can have more than 1 pci bus? wtf.
device number = device on bus id
register number = this is actual pci (device ?) data
enable bit = wtf
I dont know what is a bus. so i ask questions and search for answers to change it.
For me bus is a device wich is used to comunicate with devices attached to it. it is given irq, pio/mmio mapping to interface with cpu. and that is all, i dont know any details yet.
Re: enum pci
Posted: Fri Oct 22, 2010 7:43 am
by Solar
Then please go back and read gravaera's post again.
Then check out
PCI, and go from there. (Hint: There are links at the bottom of that page.)
Re: enum pci
Posted: Fri Oct 22, 2010 9:29 am
by JamesM
a5498828 wrote:I prefer to be sure instead of guessing.
Always a good plan.
Documentation is not clear and ambiguous = it suck.
The documentation is perfectly clear. If you choose only to use the aggregated, tutorial-ised version on osdev.org, obviously it is not perfect. Instead, why not use the PCI spec on which the osdev.org wiki is based?
function number = device can support diffrent functionality on low level
Some devices are multi-function.
bus number = i can have more than 1 pci bus? wtf.
Yes, of course you can. Have you never heard of a PCI-PCI bridge?
device number = device on bus id
Bang on, here.
register number = this is actual pci (device ?) data
Each device exposes a number of registers that can be used to query both the device itself and its memory-mappings.
enable bit = wtf
What the hell do you *think* an "enable bit" does? It enabled the device, dumbass.
I dont know what is a bus. so i ask questions and search for answers to change it.
For me bus is a device wich is used to comunicate with devices attached to it. it is given irq, pio/mmio mapping to interface with cpu. and that is all, i dont know any details yet.
[/quote]
Google it. Why would you try and start writing a device driver for a bus when you don't know what a bus is?