I'm trying to set up shared memory using the example at
http://www.isd.cme.nist.gov/projects/emc/shmem.html
in user-space but using the MAP_FIXED qualifier, I get a strange return from
mmap() as follows:
1. The value of the pointer returned is 0
2. No error is declared (errno = 0 on return)
The 0-pointer points to memory filled with 0's. If I use the original
address (as I should be able to with MAP_FIXED), I get a segmentation fault.
If I use the pointer mmap-ed without the MAP_FIXED qualifier, it accesses
the memory perfectly. It doesn't matter in which order I do the two mmap()
calls -- or if I only do the MAP_FIXED.
The setup is as follows:
1. IBM Personal Computer 350 with an Intel P133 processor
2. 64 MB RAM
3. Red Hat 5.2
4. RT-Linux 0.9J
5. lilo.conf contains: append="mem=60m"
6. #include-ing <asm/page.h> shows a page size of 4K
I really want to use the MAP_FIXED qualifier because I'm porting some legacy
code that has pointers in the data that will be kept in shared memory and
I'd like to be able to use the pointer values directly without modifying
either the user-space or the rt-module code.
Obviously I could modify the code so that only the offset from the start of
shared memory is stored in the data and the accessing code in both
user-space and kernel-space to add their respective base-pointer value to
the offset, but that greatly increases the chances for error in what is
already debugged and working code being ported from MS-DOS/AMX.
Any help would be appreciated.
Norm
--- [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/