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

Re: [MiNT] Re: fatal error handling

Guido Flohr <gufl0000@stud.uni-sb.de> writes:

|> On Wed, Dec 09, 1998 at 11:25:51AM +0100, Andreas Schwab wrote:
|> > Thomas Binder <gryf@hrzpub.tu-darmstadt.de> writes:
|> > 
|> > |> Anyone took a look at how Linux handles its loadable modules (which
|> > |> useually replace/enhance kernel calls) and whether the principle could
|> > |> be used somehow?
|> > 
|> > The way Linux does it is quite simple.  When a module is loaded some piece
|> > of kernel memory is allocated, the module code is put there and and
|> > relocated while resolving symbol references against the list of exported
|> > kernel symbols.  Then the module init function is called which registers
|> > itself with the kernel.  This is very much similar to the way dynamic
|> > linking was done on old BSD systems.  The modules are just ordinary object
|> > files, except that they must contain some special symbols for maintaining
|> > the necessary information that is needed by insmod.
|> Doesn't this require position independent code?

No, it just requires *relocatable* code, ie., object files (insmod does
all the relocation that a linker would do).

Andreas Schwab                                      "And now for something
schwab@issan.cs.uni-dortmund.de                      completely different"