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?
enum pci
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: enum pci
STFW (yes, you deserve to be told so)
Re: enum pci
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.
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.
- gravaera
- Member
- Posts: 737
- Joined: Tue Jun 02, 2009 4:35 pm
- Location: Supporting the cause: Use \tabs to indent code. NOT \x20 spaces.
Re: enum pci
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.
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.
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.
Re: enum pci
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.
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
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.)
Then check out PCI, and go from there. (Hint: There are links at the bottom of that page.)
Every good solution is obvious once you've found it.
Re: enum pci
Always a good plan.a5498828 wrote:I prefer to be sure instead of guessing.
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?Documentation is not clear and ambiguous = it suck.
Some devices are multi-function.function number = device can support diffrent functionality on low level
Yes, of course you can. Have you never heard of a PCI-PCI bridge?bus number = i can have more than 1 pci bus? wtf.
Bang on, here.device number = device on bus id
Each device exposes a number of registers that can be used to query both the device itself and its memory-mappings.register number = this is actual pci (device ?) data
What the hell do you *think* an "enable bit" does? It enabled the device, dumbass.enable bit = wtf
[/quote]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.
Google it. Why would you try and start writing a device driver for a bus when you don't know what a bus is?