LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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, 10: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, 04:06 AM   #2
Anisha Kaul
Senior Member
 
Registered: Dec 2008
Location: Gurgaon, India
Distribution: Slackware 13.1, OpenSuse 11.2
Posts: 4,202
Blog Entries: 14

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

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 07:21 AM
Physical Memory and Virtual Memory Murdock1979 Linux - General 1 01-28-2008 08:35 AM
Problem with writing module mohsena Programming 3 10-16-2005 10:51 AM
problem with new memory module favnix Linux - Hardware 1 05-23-2005 05:46 AM
USB Flash memory writing problem tajuton Linux - Hardware 8 02-18-2004 03:17 AM


All times are GMT -5. The time now is 05:22 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