LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Could someone confirm my understanding of Linux Drivers? (https://www.linuxquestions.org/questions/programming-9/could-someone-confirm-my-understanding-of-linux-drivers-887350/)

scarypajamas 06-20-2011 10:46 AM

Could someone confirm my understanding of Linux Drivers?
 
2 Questions:

1) Is there a dedicated forum on the net for people writing Linux drivers?

2) I've been reading over how Linux drivers are put together and even made my own dummy driver. However, before I begin writing the "real" driver I set out to write, I would like someone with some driver writing experience to verify that my knowledge is correct.

The driver I intend to write is for a PCI card.

The very first thing I need is to know is the vendor ID and device ID of the card. After having that information, I can then use the pci_register_driver command to open a connection to the card.

At this point, I need to use the pci_*_config_* commands (an example of a pci_*_config_* command is pci_read_config_byte) to figure out where the device is mapped in memory and what I/O ports I need. Now, the pci_* breed of commands take a parameter integer (which is an address) as there second argument. The address(es) which I will use and what they accomplish is device dependent.

At this point, after having otained the I/O ports I need, I can then begin writing to them via the inb, outb, etc commands. Writing to X port will have Y result but this is vendor specific.

I hope this all sounds correct. Let me know if something is incorrect or not clear.

gazzatav 06-20-2011 03:03 PM

You could start here:

http://www.linuxdriverproject.org/foswiki/bin/view

Also search for Greg Kroah-Hartman to find lots of other links.

Hope that helps.

scarypajamas 06-21-2011 05:51 PM

Thanks for the link gazzatav.

I also have one other question and I think I'll just stick it in this thread:

Does anyone know of any tools (for windows) that can "sniff" bytes/data being sent between a PCI card and the driver? The PCI card I intend to write a driver for doesn't have it's hardware protocol published. I was hoping it might be possible to "listen in" on how the hardware is communicating with the driver so I could adapt it for Linux.


All times are GMT -5. The time now is 02:24 AM.