LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 10-31-2006, 04:11 PM   #1
tsik
LQ Newbie
 
Registered: Oct 2006
Posts: 4

Rep: Reputation: 0
Memory mapped device access in Linux


I am trying to access (read/write) a memory mapped device in Linux using a C program.

Currently I am using the following piece of code in order to write data to the device.

tsuAddress[0]=0xb0000; //The address of the device is 0xb0000
tsuFileDescriptor[0] = open("/dev/mem", O_RDWR) ;

lseek(tsuFileDescriptor[0],tsuAddress[0], SEEK_SET);
write(tsuFileDescriptor[0],&dataToWrite,4);

Although data are finally sent to the device, they are NOT sent IMMEDIATELY after the write() function has completed (as I understand, the Operating System makes some buffering prior to sending the data to the device).

To be more specific, what I want is for the data to be sent to the memory mapped device IMMEDIATELY after the write() function executes.


Thanking you in advance, TSIK
www.tsik.eu
 
Old 10-31-2006, 09:26 PM   #2
studioj
Member
 
Registered: Oct 2006
Posts: 460

Rep: Reputation: 31
make some realtime FIFO files in the dev directory
they get a much higher scheduling priority
rtf_create()
rtf_put()
rtf_get()
 
  


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
Linux As Extra Memory Device virtualy Linux - General 2 07-24-2006 05:23 PM
which device in /dev is mapped to an USB device malo_umoran Slackware 4 07-31-2005 01:12 PM
How to access USB falsh memory on linux ziox Linux - Hardware 4 07-19-2004 01:39 PM
Memory Mapped file IO problems legogt Programming 0 08-01-2003 01:52 PM
device to simulate physical memory with PCI device kevinsung Linux - Software 1 12-14-2002 10:11 AM

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

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