On Tue, 8 Jun 1999, Estabridis, Janet P wrote:
> Thanks, that worked. I think the paper on the web needs to be updated.
> That is pretty critical information.
> Janet
Right, I agree. As this topic has been on the mailing list for a
year or more it certainly would seem like a good time to update the
HOWTO.
In aid to this effort I'd like to contribute the following modified
and untested HTML:
____CUT HERE FOR CORRECTED SHARED MEMORY HOWTO_____
<html>
<body bgcolor="#FFFFFF" text="#000000" link="#000080" vlink="#800080"
ali\
nk="#F\
F0000" background="images/back6.jpg">
<!-- Content -->
<h2><font color="#2f4f2f"><a name="what">Shared memory
HOWTO.</a></font></h2>
<blockquote>
<h2> Kernels 2.0.xx :</h2>
<br>
<li> 1. To reserve the top 1M as a shared memory between the realtime-side
and
the user-side modify <em> /etc/lilo.conf </em>:
<pre> image=/rtlinux/zImage
append="mem=31m" /* for computer with 32M memory */
label=rtlinux
read-only </pre>
<li> 2. In a header that is common to the realtime module and the
user-side program define:
<pre> #define ADDRESS (31*0x100000) </pre>
<li> 3. In older 2.0.X kernel versions (or machines with <32MB RAM?) the
realtime module this defined memory can be accessed using a pointer:
<pre> char *rt_ptr = ADDRESS; </pre>
or, for more recent kernels (2.0.36/RTL 1.1 and later):
<pre> shmem = (SHMEM_ST *)vremap(ADDRESS,sizeof(SHMEM_ST)); </pre>
this should be followed in module_cleanup() by:
<pre> vfree(shmem); </pre>
<li> 4. In the user-side program:
<pre> char *user_ptr;
if ((fdm = open("/dev/mem", O_RDONLY)) < 0) {
fprintf(stderr, "Error opening /dev/mem \n");
exit(1);
}
user_ptr = (char * ) mmap ( 0, 0x100000, PROT_READ,
MAP_FILE |MAP_PRIVATE, fdm, ADDRESS);
/* Use uprt to read data from RT */
munmap ( user_ptr, 0x100000 ); </pre>
<br>
<h2> Kernels 2.1.xx </h2>
<br>
The only difference for 2.1.xx. kernels is:
<li> 3. In the realtime module the shared memory can be accessed as
follows using a pointer:
<pre> char *rt_ptr = __va(ADDRESS) /* Defined in asm/page.h */</pre>
<br>
<br>
<br>
Mail to <a href="mailto:[EMAIL PROTECTED]"> [EMAIL PROTECTED] </a>
</blockquote>
<font size=-2><br><pre> Page Last Modified: <!--#echo
var="LAST_MODIFIED"--></pre></font>
</body>
</html>
--- [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/