Someone asked on the list last week "why" someone may want
shared memory using RTL. Here is our story.
We are doing real-time control at speeds from 10-70 kHz
(read sample, compute a bunch of things, output sample, all
within the current sample cycle).
Sometimes it is desireable for us to acquire data at the same
time (either measured values or internal state variables) and
log them to a file. The FIFO mechanism doesn't seem to like
the sizes we would need, and any disk I/O would unacceptably
compromise the control scheme.
So we have setup a 3Mb buffer in shared memory. The control loop,
when instructed (via a command FIFO), will start dumping data to the
shared memory. When it is full, it sends a FIFO command back
to the user process signaling its completion, and the user process
proceeds to dump the data to disk at its own leisurely rate.
We could use a FIFO for this, but they don't seem to appreciate being
that big! And at the rates we are running at, I am worried about
FIFO overruns, since the user processes don't run a large % of the
time (we estimate 25% max). So our "Store and dump" approach works
well, and gets us samples of data over the time periods we desire.
Which brings me to my question. "As implemented" in the Shared
Memory HOWTO, the limit for shared memory is 4Mb. Some people
have posted here of methods of accesing more memory -- can someone
provide a pointer/URL?
One final note regarding the RTL documentation on shared memory:
the HOWTO is not "always" correct. It has been my experience
(and several other posters whom I have emailed) on a Pentium Pro
the in kernel space, it is insufficient to just say:
#define BASE_ADDRESS base_address_of_shared_memory
void *shmem ;
...
shmem = BASE_ADDRESS ;
I find it necessary to use "vremap" to assigned shmem for the
runtime process. I have emailed others who have as well, and
others who have not found this necessary. Can anyone suggest
why the conflicting results?
Final note: many public thanks to Paolo Mantezagga for
some pointers on doing floating point in a hardware IRQ triggered
process. Things work great, and our experiments are going
much smoother than we ever imagined!
--
Rob Butera, Postdoctoral Fellow http://mrb.niddk.nih.gov/butera/
Laboratory for Neural Control, NINDS
National Institutes of Health, Bethesda, MD USA
--- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
----
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/