LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-22-2009, 04:06 AM   #1
einstern
LQ Newbie
 
Registered: Nov 2009
Posts: 2

Rep: Reputation: 0
accessing memory address outside standard mem


Hello,

I am writing an application that wants to access periphals registers outside the standard (allowed) memory area.

Doing so gets me "segmentation fault".
I know, this is natural behaviour.

One way of getting around this is writing the module which has to be loaded by linux. I will consider this some time later.

For now, I want to come to some quick result and allow linux or gcc compiler to write to those memory areas of periphals. Is there a direct way to do so?

Thanks indeed for your contribution.

best regards
einstern
 
Old 11-22-2009, 11:03 PM   #2
lonelygoat
LQ Newbie
 
Registered: Nov 2009
Posts: 13

Rep: Reputation: 2
Try ioperm() if you want to access io ports...

for memory access, try /dev/mem with mmap()..

Last edited by lonelygoat; 11-23-2009 at 02:34 AM.
 
Old 11-23-2009, 06:52 AM   #3
einstern
LQ Newbie
 
Registered: Nov 2009
Posts: 2

Original Poster
Rep: Reputation: 0
[QUOTE=lonelygoat;3766297]Try ioperm() if you want to access io ports QUOTE]
Thanks for the swift reply!
Is this x86 specific?
I am using arm9 cpu.

Still getting "segmentaion fault".

Kind regards
 
Old 11-23-2009, 07:19 PM   #4
lonelygoat
LQ Newbie
 
Registered: Nov 2009
Posts: 13

Rep: Reputation: 2
Oh yeah, it ipperm() and iopl() are both X86 specific..

I am not familiar with arm, try /dev/mem ? map your memory segment of /dev/mem into user space with mmap(), then access it via returned pointer, you will need root privilege...
 
  


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
c++ - how to find memory footprint of a GL display list (or mem usage on a GPU)? BrianK Programming 3 03-17-2008 01:14 PM
Safely accessing /dev/mem anothershura Programming 5 04-20-2006 03:43 AM
Accessing non Standard URL protocols in Linux carl0ski Programming 2 01-26-2006 06:25 PM
is high mem support in a 2.6 kernel advised against for 1GB of memory? hedpe Linux - General 2 09-06-2005 09:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:14 AM.

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