LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Driver writing help needed: oops-ing on r/w (https://www.linuxquestions.org/questions/programming-9/driver-writing-help-needed-oops-ing-on-r-w-344756/)

Alotau 07-19-2005 04:09 PM

Driver writing help needed: oops-ing on r/w
 
Wasn't sure which forum to ask this, if there is a more appropriate one, please let me know...

I am trying to write a driver. My target system is running MontaVista Linux 3.1 (2.4.20) and my host system is running RedHat 7.1. The driver is supposed to be the simplest driver possible: open, release, read and write are only implemented functions. The hardware is just a register on-chip (it is a "custom" peripheral for a Xilinx FPGA, essentially hangs off the PLB bus of a PPC405 system). I need this driver to work before I try and write one for our real peripheral that is considerably more complex than a register.

I am getting an oops message on the first read or write that I try. I am fairly certain that the open and release methods work fine since when I don't try and read or write, I can use a test program to open and close the device (using out printf statements in the app as I go and printk statements in the driver as I go).

Since the hardware I am targeting is just a register, I figured if I had it's address in the system (which is hardcoded into the hardware at design time) it would only need a simple in_32()/out_32() statement in the read/write functions of the driver, but these oops on me. Tried using copy_to_user()/copy_from_user() instead, but these oopsed as well.

Been referencing the o'reilly book, Linux Device Drivers, but to no avail. I can put up code if helpful or describe my system in more detail, but hopefully I am missing something obvious to an experienced driver writer who can point me in the right direction...

Any advice? Thanks in advance...

trickykid 07-20-2005 09:49 AM

Moved: More suitable in our Programming forum.


All times are GMT -5. The time now is 07:23 PM.