l4-hurd
[Top][All Lists]
Advanced

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

Re: Kernel Interface Page Dumping Server


From: Espen Skoglund
Subject: Re: Kernel Interface Page Dumping Server
Date: Wed, 7 May 2003 15:55:18 +0200

[Marcus Brinkmann]
> Why does the convenience interface require passing a pointer to the
> KIP around?  As the KIP location can not be changed during the
> lifespan of an address space, it should be sufficient to query it
> once and cache it in a global variable and just use that for all
> these functions.  The up-front initialization that is then required
> can be done in the dynamic linker as well.  I guess you might worry
> about synchronization, but then in any non-trivial program there is
> a large amount of startup initialization anyway.

We don't want to use a global variable since this variable must then
uniquely be defined either by using a linker script or by declaring it
in one (and exactly one) of the source files.  (Come to think of it,
one could also define it in libl4.)  The scheme also requires that we
invoke some initialization function since we can not always rely on
having a dynamic linker taking care of the initialization.

>> Your solution is also semantically incorrect.  It might very well
>> happen that an application supplies a pointer to a word at addres
>> zero (although I admit that this is pretty unlikely :-).

> Now, that is evil.  Point taken.  :)

A similar thing actually happend in my sigma0 code.  I allocated a
structure in dynamic memory which happened to be at address zero, but
some algorithm of sigma0 associated special semantics with the NULL
pointer.  Needless to say, the algorithm didn't behave as expected
when it received a structure located at address zero.

        eSk






reply via email to

[Prev in Thread] Current Thread [Next in Thread]