On Apr 28, 12:09 am, CW <[email protected]> wrote:
> In windows, it has the concept of data segment and code segment in
> memory, an application can't access the code segment in the X86 CPU.
> Do you know if the android have the same feature support?
Not quite sure what you mean by can't access the code segment - maybe
can't write to it?
But android's underlying linux kernel, and the hardware on which it
typically runs, provides memory protection which can prevent
inadvertent overwriting of program code, and keep processes belonging
to different apps (treated as distinct unix user ID's) from accessing
each other's memory or that containing/belonging to the kernel.
With in an application, look at the linux manual page for mprotect()
and related functions. Some of the options are:
PROT_NONE The memory cannot be accessed at all.
PROT_READ The memory can be read.
PROT_WRITE The memory can be modified.
PROT_EXEC The memory can be executed.
On some CPUs/operating modes there's no distinction between the
execute bit and the read bit. On your typical ARM smartphone cpu,
execute is distinct from read.
--
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting