Article View: comp.sys.acorn.tech
Article #60Re: RISCOS lib in ROM?
From: Edward Nevill
Date: Wed, 04 Nov 1992 13:16
Date: Wed, 04 Nov 1992 13:16
55 lines
3094 bytes
3094 bytes
There have been a number of questions about RISC_OSLib in ROM recently. Yes, there is a copy of RISC_OSLib in ROM, however it is not a complete copy, it is exactly those parts of RISC_OSLib needed by !Edit, !Paint, !Draw, !Configure and the Filer_Action module (the module responsible for multi-tasking filer operations). The RISC_OSLib functions are accessed directly by these applications. The applications call the functions in RISC_OSLib directly without going through a SWI veneer or a stubs veneers. The linker fixes up these addresses when building the ROM. This is why if you try to RMFaster one of the ROM applications (eg. *RMFaster !Paint), you get the message "ROM application !Paint cannot be RAM loaded". Note, if you do try this you will need to issue a "*RMReInit !Paint" command or do a reset to get !Paint back, this is because when you do an RMFaster the original module is first killed, then it is copied to RAM and initialised, in its initialisation code it realises that it is not running at the address at which it was linked and returns the error message. !Configure, although it is an absolute application also calls RISC_OSLib directly. This is possible because the absolute image for !Configure is contained in the ROM and is linked at the same time as the ROM. The RISC_OSLib routines are contained in the SharedCLibrary module. They are in the SharedCLibrary module so that they can access static data in the same manner as the SharedCLibrary (using the static data relocations on the base of the current stack chunk). However the routines are not exported from the SharedCLibrary as are the C library functions (via the SharedCLibrary SWIs which fill out an entry table passed to them by the stubs), so it is not possible to write a RISC_OSLib stubs. So, why were the RISC_OSLib routines not exported? 1) Because the RISC_OSLib in ROM is incomplete, only those parts of RISC_OSLib which are actually needed by the ROM applications are included. It was felt that it would be better not to export any of routines rather than export an incomplete set which would, in practice, only be of use if you were re-implementing !Edit, !Paint or !Draw. 2) Because some of the routines in the RISC_OSLib in ROM have been compiled without stack checking enabled to reduce the ROM space consumed by RISC_OSLib. This is OK in a well controlled system where we know the circumstances under which the routines are called. It would not be safe if the routines were exported. 3) To allow us maximum flexibility for continued development. Hope this clears up any confusion, Edward. Disclaimer: These are my comments and do not necessarily represent the view of Acorn.
Technical Details
Message-ID:
<19983@acorn.co.uk>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!acorn!enevillReferences:
<hv!qxtn@SantaFe.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!acorn!enevill From: enevill@acorn.co.uk (Edward Nevill) Newsgroups: comp.sys.acorn.tech Subject: Re: RISCOS lib in ROM? Message-ID: <19983@acorn.co.uk> Date: 4 Nov 92 13:16:27 GMT References: <hv!qxtn@SantaFe.edu> Sender: enevill@acorn.co.uk Organization: Acorn Computers Ltd, Cambridge, England Lines: 55