LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
LinkBack Search this Thread
Old 10-22-2009, 09:10 AM   #1
atif_shabir
LQ Newbie
 
Registered: Oct 2009
Posts: 7

Rep: Reputation: 0
Problem in writing to physical memory through a module


Hello

I want to write data to a physical address of my choice. For it I am writing a driver (just like parallel port driver). In my driver code I use check_region() function to check whether the address is free or not. Then I use request_region() to reserve that address for my driver. When the driver is loaded using insmod, it is loaded successfully (i-e the address is reserved for my driver). The corresponding /dev/<filename> opens successfully but when I write to the /dev/<filename>, I get segmentation fault.

Where can the problem be?

If an address has been reserved for me, I should be able to write on it. But I can not write.

Kindly give me some clue.

Regards

Atif Shabir
 
Old 11-19-2009, 03:06 AM   #2
Anisha Kaul
Senior Member
 
Registered: Dec 2008
Location: Gurgaon, India
Distribution: Slackware 13.37, OpenSuse 11.3
Posts: 4,359
Blog Entries: 21

Rep: Reputation: 705Reputation: 705Reputation: 705Reputation: 705Reputation: 705Reputation: 705Reputation: 705
Kindly post some code for us to look at !
 
Old 11-19-2009, 03:48 AM   #3
cladisch
Member
 
Registered: Oct 2008
Location: Earth
Distribution: Slackware
Posts: 227

Rep: Reputation: 54
The physical address space and the kernel's address space are not identical.
You did not mention that you mapped your physical address, so I guess you didn't.
 
  


Reply

Tags
driver


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PCIe dma-able memory location in physical memory for Intel Nehalem / Tylersburg arch robvoo Linux - Kernel 4 07-31-2009 06:21 AM
Physical Memory and Virtual Memory Murdock1979 Linux - General 1 01-28-2008 07:35 AM
Problem with writing module mohsena Programming 3 10-16-2005 09:51 AM
problem with new memory module favnix Linux - Hardware 1 05-23-2005 04:46 AM
USB Flash memory writing problem tajuton Linux - Hardware 8 02-18-2004 02:17 AM


All times are GMT -5. The time now is 10:58 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration