lua-users home
lua-l archive

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


 Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote

>My intention is exactly to try to establish that it is easy to
>write a low level dynamic loader for todays OSs. It seems that most unixes
>now support dlfcn. I'd like to hear about this, that is, about unixes that
>do and that don't support dlfcn, and also about other OSs (Windows, Palm,
>Macintosh, Mac OS X, Acorn RISC OS, EPOC, BeOS, OS/2, ...).

I am afraid Risc OS was not designed with dynamic linking in mind.
What it does have are things called "modules", of which the OS is
composed, which have relocatable code areas and multiple data areas
one for each instantiation. I tried rewriting Lua as a module, but
failed. Not, I think, through any inadequacy of Lua, but because
I do not have the necessary experience. Modules are the standard way of
sharing resources. The standard C library is provided as a module,
for example. The OS provides commands for applications
to interrogate the system to ensure that the modules it needs
exist and are the correct versions. However, code written for
modules has to call OS routines in a different processor mode
from ordinary user mode, and there are other complications.

There was a dynamic linking system called SDLS devised by a third party
in 1995. For it to work it had a module, DLLManager, but it gets
fooled by C code with longjumps which cause DLLManager's stack pointer
to get out of synch. Also, its only way of keeping track of which task
is currently calling DLL routines is by making use of the time when
the task started. There are system calls to alter the time ... !
As far as I know hardly anybody took up the SDLS system, and the
latest updates to the OS have not concerned themselves
with the provision of a standard dynamic linking mechanism
in the sense you understand it.

Better forget loadlib as far as Risc OS is concerned.

-- 
Gavin Wraith (gavin@wraith.u-net.com)
Home page: http://www.wraith.u-net.com/