Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 07-19-2005, 05:09 PM   #1
Registered: Jan 2005
Location: Fremont, CA
Distribution: Red Hat 9
Posts: 58

Rep: Reputation: 15
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...
Old 07-20-2005, 10:49 AM   #2
LQ Guru
Registered: Jan 2001
Posts: 24,147

Rep: Reputation: 229Reputation: 229Reputation: 229
Moved: More suitable in our Programming forum.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sockets. Writing while select()ing? daryl_tt Programming 4 11-11-2005 01:48 PM
Help needed in writing Awk Scripts.. TheDarktrooper Red Hat 1 05-04-2004 07:49 PM
kernel oops or nvidia driver problem ? SleepLess Linux - General 6 04-22-2004 09:32 PM
chmod ing - Help needed randelld Linux - General 5 04-09-2004 11:54 AM
Linxuant Riptide Driver on RH9 Causes Oops? otistdog Linux - Newbie 0 04-05-2004 09:38 AM

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration