I already know that mprotect() syscall has 4 protection mode in BSD, but my problem is that how this protection is implemented ( Hardware or Software Implemention ) ?
let's say if we set protection of specific pages to PROT_NONE ,is it really depend on the hardware I'm using or it's kind of some software tricks by setting some flags on that specified page in page table.
it seems that this protection on hardware deponds on MMU we have, but I'm not sure about it.
you can find more information about mprotect and paging on :
Page protection is implemented in hardware with software assistance. Basically, you want to achieve the following:
mprotect
guarantee (this happens in software invoked from hardware trap handler triggered in p.1).And yes, without the MMU p.1 would not work, so on ucLinux (a version of Linux designed to support processors without MMU) mprotect
is not implemented (as it will be impossible to invoke the code from p.2 transparently).