[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Patch for MMAP?



As for shared libraries, I'd still prefer the method that Howard Chu mentioned
about re-linkable static libs instead of dynamic libs.  We have the disk space
to continue to keep the libraries in the executable - its updating them that
everyone wants, although sharing the code might be nice as well, although the
existing plugin system for shared modules may be enough.

For more information on how uCLinux supports mmap() and shared libraries and
other such things, you can read here ...
http://www.cadenux.com/xflat/index.html

Its XFLAT!

And my previous message ... in case it wasn't clear ...

Version 1 - no sharing.  This mmap() would have to use Fopen() to open
the file.
If an address is given, we could possibly use it, but it may be best to just pretend a given start address is 0. If the start address is 0, call Mxalloc()
to allocate a chunk of memory equal to the size of the file with the proper
protection as specified, load the entire file into the block, close the file,
and return the pointer.  munmap just frees the pointer.

Oh .. and munmap, if the mapping was writable, can re-open the file on munmap()
and save it over the original file, and THEN free the pointer.

I don't currently trust my system since when I tried to compile my own
MiNT and
XaAES for aranym, it just crashed, and I have no idea what is at fault.

If it wasn't clear - this is why I'm not testing the above mmap()
implementation.  I'd have no idea where the bug is - when things are stable,
I'll look into it if no one else has.

Comments on the implementation plan are welcome.

-- Evan