home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / utilities / virtual / !Virtual / !Help < prev    next >
Encoding:
Text File  |  1993-03-14  |  7.6 KB  |  168 lines

  1. !Virtual 0.22
  2. =============
  3.  
  4. !Virtual supplies virtual memory under RiscOS, allowing a task to believe it
  5. has upto 24M of memory, yet have a draggable WimpSlot that can be set as
  6. desired. However, it is very restrictive in what can be done - basically
  7. only simple line based programs can be used. This is quite sufficient to run
  8. C compilers, though, which is what I wanted it for. If you want to do
  9. anything more than that with it, you will need to get pretty technical.
  10.  
  11. It has been tested on an ARM3 A440, and an A5000, though should run on any
  12. ARM2/ARM3 MEMC 1/1a machine. CV4.00 and Basic run under it, and I haven't
  13. tested much else.
  14.  
  15. All RiscOS swi calls run in supervisor mode. On the ARM2/ARM3 a prefetch or
  16. data abort corrupts svc_R14, and RiscOS isn't written to support this. So it
  17. is pretty much of a dead loss to let any swis access virtual memory. Also,
  18. the Wimp is very grungy with its memory mapping, and basically dies if it
  19. sees even the slightest change to the memory map.
  20.  
  21. So !Virtual acts as a replacement for taskwindow, and uses the same
  22. interface to !(Src)Edit for i/o. The task under !virtual runs with a
  23. virtualised memory map, strictly in user mode. It is preempted from time to
  24. time, to allow the Wimp to continue, but everytime this is done the memory
  25. map has to be put back exactly as the Wimp expects to find it. (Can you say
  26. inefficient?) Any swis that the task tries to issue are intercepted and
  27. "vetted" by !Virtual. Many are treated specially in that certain areas of
  28. memory are forced to be paged in, or large file loads are broken up into
  29. chunks and done page by page with the memory arranged as the Wimp thinks it
  30. should be, in case the filing system expands the RMA. Only swis that
  31. !Virtual understands can be sure of being treated correctly, so any unknown
  32. ones return an error to the application - this means that the task is cut
  33. off from the greater part of RiscOS, and should really be thought of as
  34. running under a different operating system, that just happens to be hosted
  35. on RiscOS.
  36.  
  37. At the moment, I have implemented only the swis I have found necessary to
  38. run things. This includes:
  39.  
  40. Input/output swis
  41. Most filing system swis
  42. DDE swis for throwback and extended command lines.
  43. Some RO3 Territory swis
  44. OS_Bytes for esc handling.
  45. OS_Words for time/date reading.
  46. Some environment changing swis - mostly not obsolete ones.
  47. SharedCLibrary entry swis
  48.  
  49. How to use:
  50. ===========
  51.  
  52. The module supplies one * command, "*virtual" that is designed as a
  53. replacement for *taskwindow, and accepts a similar set of parameters. Try
  54. "virtual basic -ctrl -wimpslot 24M" from an obey file, for instance. This
  55. will run basic, which will believe it has 24M at its disposal. (Though if
  56. you don't have that much disk space you had better not use it.) Really, it
  57. only has a WimpSlot the size given by the "Next" Slot, and this can be
  58. dragged up or down in the taskmanager. Notice that the command to be
  59. executed is one parameter, so will have to be quoted if its more than one
  60. word.
  61.  
  62. Virtual runs code in one of three states. "Virtual" mode is when the memory
  63. map is changed, special abort handlers are installed, and all user mode swis
  64. with a flat svc stack are redirected. (The flat restriction is because
  65. nfs/econet sometimes drop back into user mode to do work.) "Ext" mode is
  66. used to execute some swis - the memory map is still changed, but no abort
  67. handlers are in place, as they shouldn't happen. Any that do will be caught
  68. by an error handler. OS_WriteC is trapped, so that any output produced can
  69. be redirected to the taskwindow. "Normal" mode is when the memory map is put
  70. back as the Wimp expects, so we can call Wimp_Poll and other things that may
  71. want to rearrange it. OS_WriteC is still trapped, except for the very moment
  72. of Wimp_Poll, and after being in normal mode, I always rescan the memory map
  73. to see if anything has changed.
  74.  
  75. All filing system operations, and most OS_CLIs run in normal mode. If a new
  76. application is started as a result of a command, it is trapped by an upcall
  77. handler, which enters virtual mode with the virtual memory map exactly
  78. matching the application one, and installs lots of vectors. This means that
  79. the WimpSlot must be large enough to *load* the (squeezed) executable of
  80. something that is run.
  81.  
  82. Future: OS_CLIS that start with the character "/", are specially treated, to
  83. allow the running of executable files that are bigger than the real WimpSlot
  84. that virtual posesses
  85.  
  86. Things to note about the source code:
  87. =====================================
  88.  
  89. Virtual is mostly written in C, with a minimal amount of assembler. It uses
  90. no linked libraries at all. It runs mostly in supervisor mode, but there is
  91. some nefarious switching needed for Wimp_Poll to work.
  92.  
  93. To avoid messing with the supervisor stack, I use R12 as stack pointer in
  94. the C code, and R13 can remain untouched as there's no stack limit. This is
  95. effectively the obsolete APCS_A register allocation. The C compiler is made
  96. to generate assembler source, and the register definitions are then changed
  97. by a sed script.
  98.  
  99. printf is a module written solely to provide a print_f swi so that I can
  100. avoid messing with the C library in the main module, yet produce debug
  101. output easily.
  102.  
  103. Programs running under !Virtual should not be thought of as running under
  104. RISCOS. They have access to a very limited subset of particular swis that
  105. I've implemented properly. Further swi routines accepted with enthusiasm - I
  106. don't really have the time or energy to do them myself.
  107.  
  108. Distribution:
  109. ============
  110.  
  111. This software may be freely redistributed, so long as only a reasonable
  112. copying or media charge is made, and all files I distribute are included. I
  113. retain copyright to the code. Commercial (including magazine) distribution,
  114. or distributing modified versions of this please contact me - I am normally
  115. happy for it to be reused in other free software, but like to avoid deviant
  116. versions of mine causing trouble.
  117.  
  118. I am not asking for money, but if you like and use it I would be surprised
  119. and amazed by any contributions, and you will receive a disc with latest
  120. versions on. (>£10, say)
  121.  
  122. Brian Brunswick                              brian@aleph1.co.uk (Internet)
  123. Fairview                                 
  124. Avenue des Hirondelles
  125. Pool-in-WharfeDale
  126. Leeds
  127. LS21 1EY
  128. UK
  129. 0532 843737
  130.  
  131. Versions later than 0.20:
  132. ========================
  133.  
  134. Because Brian is now out 'in the real world' I (Nick Smith) am acting as a
  135. first line of support for !Virtual. I have tidied it up for the first public
  136. release, and will improve the program as I get feed back from users, etc.
  137. Currently, Brian wrote 99.5% of the actual software - so send him all that
  138. money in gratitude !
  139.  
  140. Please email or snail-mail me comments, bug reports, requests for new 
  141. features, etc. and I will hopefully have the time to deal with them. If you
  142. make any modifications to the code, please send them to me rather than 
  143. giving out copies - I would like to coordinate new releases. Thanks.
  144.  
  145. I can be contacted at the following address, at least until Jul '94 ;
  146.  
  147. Nick Smith                                  nas20@cus.cam.ac.uk (Internet)
  148. Churchill College
  149. Cambridge
  150. CB3 0DS                 
  151.  
  152. Revision history:
  153. ================
  154.  
  155. Modifications to v0.21 (13-Mar-93) [Beta-release]
  156.   - !SwapDir resources application
  157.   - Improved documention; added installation instructions, updated info,
  158.     added revision history, etc
  159.   - removed compilation dependency on having brian's harddrive 8-)
  160.   - did some slightly better (but still awful) !Sprites, with !Sprites22
  161.   - detailed *Help command provided
  162.   - cleaned up code & file structure generally
  163.   - cleaned up test/example software
  164.  
  165. Modifications to v0.22 (14-Mar-93) [release]
  166.   - Made small number of changes that Brian asked for
  167.  
  168.