home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / utilities / utilst / virtual / !Virtual / !Help < prev    next >
Text File  |  1993-07-06  |  11KB  |  231 lines

  1. !Virtual 0.27
  2. =============
  3.  
  4. !Virtual supplies virtual memory under RiscOS 2/3, allowing a task to believe
  5. it 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 a wide range of machines (ARM2/3, RISC OS 2/3, MEMC 1/1a,
  12. 1/2/4/8MB RAM) so should run on pretty much anything. It will only work on 
  13. machines with 8, 16 or 32Kb page sizes currently (which covers all Acorn RISC
  14. computers at the moment).
  15.  
  16. All RiscOS swi calls run in supervisor mode. On the ARM2/ARM3 a prefetch or
  17. data abort corrupts svc_R14, and RiscOS isn't written to support this. So it
  18. is pretty much of a dead loss to let any swis access virtual memory. Also,
  19. the Wimp is very grungy with its memory mapping, and basically dies if it
  20. sees even the slightest change to the memory map.
  21.  
  22. So !Virtual acts as a replacement for taskwindow, and uses the same
  23. interface to !(Src)Edit for i/o. The task under !virtual runs with a
  24. virtualised memory map, strictly in user mode. It is preempted from time to
  25. time, to allow the Wimp to continue, but everytime this is done the memory
  26. map has to be put back exactly as the Wimp expects to find it. (Can you say
  27. inefficient?) Any swis that the task tries to issue are intercepted and
  28. "vetted" by !Virtual. Many are treated specially in that certain areas of
  29. memory are forced to be paged in, or large file loads are broken up into
  30. chunks and done page by page with the memory arranged as the Wimp thinks it
  31. should be, in case the filing system expands the RMA. Only swis that
  32. !Virtual understands can be sure of being treated correctly, so any unknown
  33. ones return an error to the application - this means that the task is cut
  34. off from the greater part of RiscOS, and should really be thought of as
  35. running under a different operating system, that just happens to be hosted
  36. on RiscOS.
  37.  
  38. At the moment, I have implemented only the swis I have found necessary to
  39. run things. See the file 'Bits.SWIs_list'.
  40.  
  41. How to use:
  42. ===========
  43.  
  44. The module supplies one * command, "*virtual" that is designed as a
  45. replacement for *taskwindow, and accepts a similar set of parameters. Try
  46. "virtual basic -ctrl -wimpslot 24M" from an obey file, for instance. This
  47. will run basic, which will believe it has 24M at its disposal. (Though if
  48. you don't have that much disk space you had better not use it.) Really, it
  49. only has a WimpSlot the size given by the "Next" Slot, and this can be
  50. dragged up or down in the taskmanager. Notice that the command to be
  51. executed is one parameter, so will have to be quoted if its more than one
  52. word.
  53.  
  54. NOTE! You need a task window 'provider' application loaded to use Virtual.
  55. For instance, !Edit or !SrcEdit. Some other programs provide task window
  56. facilities. eg, Brian's !VMode which gives the user a graphical task window.
  57.  
  58. Virtual runs code in one of three states. "Virtual" mode is when the memory
  59. map is changed, special abort handlers are installed, and all user mode swis
  60. with a flat svc stack are redirected. (The flat restriction is because
  61. nfs/econet sometimes drop back into user mode to do work.) "Ext" mode is
  62. used to execute some swis - the memory map is still changed, but no abort
  63. handlers are in place, as they shouldn't happen. Any that do will be caught
  64. by an error handler. OS_WriteC is trapped, so that any output produced can
  65. be redirected to the taskwindow. "Normal" mode is when the memory map is put
  66. back as the Wimp expects, so we can call Wimp_Poll and other things that may
  67. want to rearrange it. OS_WriteC is still trapped, except for the very moment
  68. of Wimp_Poll, and after being in normal mode, I always rescan the memory map
  69. to see if anything has changed.
  70.  
  71. All filing system operations, and most OS_CLIs run in normal mode. If a new
  72. application is started as a result of a command, it is trapped by an upcall
  73. handler, which enters virtual mode with the virtual memory map exactly
  74. matching the application one, and installs lots of vectors. This means that
  75. the WimpSlot must be large enough to *load* the (squeezed) executable of
  76. something that is run.
  77.  
  78. Future: OS_CLIS that start with the character "/", are specially treated, to
  79. allow the running of executable files that are bigger than the real WimpSlot
  80. that virtual posesses
  81.  
  82. Things to note about the source code:
  83. =====================================
  84.  
  85. Virtual is mostly written in C, with a minimal amount of assembler. It uses
  86. no linked libraries at all. It runs mostly in supervisor mode, but there is
  87. some nefarious switching needed for Wimp_Poll to work.
  88.  
  89. To avoid messing with the supervisor stack, I use R12 as stack pointer in
  90. the C code, and R13 can remain untouched as there's no stack limit. This is
  91. effectively the obsolete APCS_A register allocation. The C compiler is made
  92. to generate assembler source, and the register definitions are then changed
  93. by a sed script.
  94.  
  95. printf is a module written solely to provide a print_f swi so that I can
  96. avoid messing with the C library in the main module, yet produce debug
  97. output easily.
  98.  
  99. Programs running under !Virtual should not be thought of as running under
  100. RISCOS. They have access to a very limited subset of particular swis that
  101. I've implemented properly. Further swi routines accepted with enthusiasm - I
  102. don't really have the time or energy to do them myself.
  103.  
  104. Contributors:
  105. ============
  106.  
  107. Many thanks to Ferdinand Oeinck (ferdinan@oeinck.waterland.wlink.nl) for his
  108. continuing work to !Virtual.
  109.  
  110. Reporting problems:
  111. ==================
  112.  
  113. Please read this BEFORE sending me any reports of problems! With a complex
  114. (and buggy!) program like !Virtual, I get a fair few email messages of the
  115. form "I ran your !Virtual, and it didn't work - can you help?"
  116.  
  117. PLEASE don't send me such unhelpful comments! Really, I need to know as much
  118. of the following as you can provide in the initial email;
  119.  
  120. * Your machine - model, memory, harddisc (interface), version of RISCOS,
  121.   other hardware or software that may be interfering with !Virtual.
  122. * The application you are running to provide task windows (eg, !edit or
  123.   !srcedit) and which version
  124. * Version number of !Virtual
  125. * Exactly what you did from machine switch on until virtual failed to work
  126.   as expected
  127. * Exactly what happened - eg, did the machine crash completely with the
  128.   mouse pointer stopping ?
  129. * And ideally, the source file and changes required to fix the problem ;-) 
  130.   Obviously if you are not an experienced programmer you can't do this.
  131.  
  132. Distribution:
  133. ============
  134.  
  135. This software may be freely redistributed, so long as only a reasonable
  136. copying or media charge is made, and all files I distribute are included. I
  137. retain copyright to the code. Commercial (including magazine) distribution,
  138. or distributing modified versions of this please contact me - I am normally
  139. happy for it to be reused in other free software, but like to avoid deviant
  140. versions of mine causing trouble.
  141.  
  142. I am not asking for money, but if you like and use it I would be surprised
  143. and amazed by any contributions, and you will receive a disc with latest
  144. versions on. (>£10, say)
  145.  
  146. Brian Brunswick                              brian@aleph1.co.uk (Internet)
  147. Fairview                                  OR Brian.Brunswick@cl.cam.ac.uk          
  148. Avenue des Hirondelles
  149. Pool-in-WharfeDale
  150. Leeds
  151. LS21 1EY
  152. UK
  153. 0532 843737
  154.  
  155. Versions later than 0.20:
  156. ========================
  157.  
  158. Because Brian is now out 'in the real world' I (Nick Smith) am acting as a
  159. first line of support for !Virtual. I have tidied it up for the first public
  160. release, and will improve the program as I get feed back from users, etc.
  161. Currently, Brian wrote 99.5% of the actual software - so send him all that
  162. money in gratitude !
  163.  
  164. Please email or snail-mail me comments, bug reports, requests for new 
  165. features, etc. and I will hopefully have the time to deal with them. If you
  166. make any modifications to the code, please send them to me rather than 
  167. giving out copies - I would like to coordinate new rel