LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 07-19-2005, 04:09 PM   #1
Alotau
Member
 
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, 09:49 AM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

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


Reply



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 12:48 PM
Help needed in writing Awk Scripts.. TheDarktrooper Red Hat 1 05-04-2004 06:49 PM
kernel oops or nvidia driver problem ? SleepLess Linux - General 6 04-22-2004 08:32 PM
chmod ing - Help needed randelld Linux - General 5 04-09-2004 10:54 AM
Linxuant Riptide Driver on RH9 Causes Oops? otistdog Linux - Newbie 0 04-05-2004 08:38 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:29 PM.

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