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