Memory management

Julian Stecklina boelthorn at gmx.net
Wed Jun 29 19:32:24 CEST 2005


On Wed, 29 Jun 2005 18:42:57 +0200
Espen Skoglund <esk at ira.uka.de> wrote:

> A maps a 4MB page to B.  A can not later unmap a 4KB out of this page.
> Similarly, B can not unmap (self) a 4KB mapping out of this page.  B
> can however map a 4KB mapping to C and later unmap this mapping.  That
> is, the following situation is allowed:
> 
>         4MB      4KB
>      A -----> B -----> C
>          X        Y
> 
> The mapping X from A to B can not be partially unmapped.  B can map a
> smaller part Y of X to C, though.

Thanks for the explanation.
 
> > Is there any actual code to look at that does some interesting
> > things with fpages? What I am looking for is the way one would
> > implement a kind of mprotect(2).
> 
> Can't think of anything "interesting" to do with fpages, so I can't
> really point you at any particular code.

Ok, I found two garbage collectors that run on L4. Maybe they can
get me going.

> For revoking rights using mprotect() you can simply use Unmap().
> Extension of access rights would typically be handled lazily.  That
> is, when the thread performs an illegal access (e.g., write access on
> a read-only page) a page fault RPC is sent to the thread's pager who
> will reply with a mapping having the appropriate rights.

Yes, this is clear.

Regards,
-- 
Julian Stecklina

LISP has survived for 21 years because it is an approximate local
optimum in the space of programming languages. - John McCarthy (1980)






More information about the l4-hackers mailing list