RISC OS Shared LibrariesBy Peter Naulls. Published: 29th Sep 2003, 12:41:42 | Permalink | Printable
One for everybodyNot exactly breaking news, but we've been meaning to cover this for sometime, and it remains relatively new to RISC OS.
Ask for the list of things people would like to see in RISC OS - Preemptive Multi-Tasking, improved memory protection, better browsing, etc, and possibly high on the list will appear shared libraries.
Shared libraries are just that - they are chunks of code that contain library functions that can be shared by many programs running at once. One of the important features of shared libraries is that they can be upgraded independently of the programs that use them, avoiding relinking.
Currently on RISC OS, if you want to use a newer version of a library with a program, you need to create a new binary, which will be statically linked with it, meaning that all the library code is included in your program's RunImage. This is particularly unfortunate for programs using things like UnixLib, which can be frequently changed.
There is an existing shared library system on RISC OS, but it's never been extensively used outside of the SharedCLibrary (I only know of one other example). It works via a stubs plus module system - whilst ok as far as it goes for the SharedCLibrary, isn't really ideal in general use. The code needs to exist in a module, which isn't the best, and you need a new SWI base for every module. It's all a bit fiddly and inflexible. Perhaps more importantly, it precludes automated generation of shared libraries from existing Unix build systems.
Of course, Linux, Windows and just about every other non-trival OS has a shared library system - in the form of .dll or .so files, but RISC OS has missed out, perhaps for historical reasons, and the minimal memory requirements of most RISC OS programs (memory saving being another advantage of shared libraries).
To the Rescue
Steven Simpson has started on a shared library system for RISC OS, and you can see his efforts on his RISC OS Shared Libraries page.
It's somewhat experimental, and certainly in its early stages, but you are of course encouraged to try it out. Steven tells drobe.co.uk he based his efforts on the requirements of the One True Dynamic Linker, in a document drawn up by ex-RISC OS user, Mark Wooding. Dynamic linking is a subset of the behaviour required by shared libraries, and essentially means code is loaded upon demand.
Steven's developments were done using GCCSDK under Unix, which shows you don't need to develop natively. Unfortunately, GCC itself can't yet create suitable code for dynamic linking in RISC OS (the problems being essentially those required to allow modules with GCC).
Hopefully in future we'll see practical use of this. In particular, UnixLib would greatly benefit from being a shared library.
RISC OS Shared Libraries
Previous: Porting free for all as UPP releases tools
Next: Midlands 2003 event cancelled - official
DiscussionViewing threaded comments | View comments unthreaded, listed by date | Skip to the end
Please login before posting a comment. Use the form on the right to do so or create a free account.
Search the archives
Today's featured article
RISC OS Gaming in Focus
Neil my-one-game-a-week-addiction White shows how easy it is.
10 comments, latest by nice and sweet on 29/4/03 6:45PM. Published: 21 Apr 2003
Castle publish 100MBit details
Yes, that's right. 100MBit is a typo, innit?
9 comments, latest by cjashley on 15/4/02 11:39PM. Published: 30 Jan 2002
News and media:
RISCOS Ltd •
RISC OS Open •
MW Software •
Advantage Six •
CJE Micros •
Liquid Silicon •
Chris Why's Acorn/RISC OS collection •
The Register •
The Inquirer •
Apple Insider •
BBC News •
Sky News •
Google News •