access the address outside the process space!

Hi!

In Linux, is it possible for a process to access a buffer whose starting address is out of the process's space? The process will obtain the address from IPC. Will such memory access be prohibited by Linux OS or the processor? BRs, // Charlie

Reply to
Charlie
Loading thread data ...

No, not in normal Linux. The whole reason of an OS with memory protection is that this is not possible.

In ucLinux however, which does not use MMU (Memory Management Unit) of the processor, you can overwrite/read every memory location in the entire memory space.

Wumpus

Reply to
Wumpus

Yes. Have a look at mmap() function.

HTH,

Vadim

Reply to
Vadim Borshchev

Only if that other memory was acquired with the express option of being shareable among processes. Which, of course, is just another variant of IPC in its own right, obliviating the need for passing addresses around --- they would be different in separate processes, so posting an address would be useless, anyway.

By both working together: the processor offers the option to forbid this, and the Linux kernel uses that option.

--
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
Reply to
Hans-Bernhard Broeker

Thank all of you!

What I would like to do is to share some data ( of large size ) between multiple processes. One process will allocate the buffer and fill it with the data. All the other processes access the buffer to retrieve the data they need.

In embeded Linux, besides accessing the buffer by its address, is there any better solution to share the data ( of large size ) in different processes at run-time?

BRs, // Charlie

Reply to
Charlie

The canonical solution to that is either mmap() or shm_get(), and has been pointed out to you before. Care telling what's wrong with those suggestions, for your application?

Depending on what kind of "embedded Linux" you're talking about, access by address may very well be strictly impossible to begin with. It could also be the only option you have. You really didn't give enough information for others to help you on that one.

--
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
Reply to
Hans-Bernhard Broeker

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.