home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / acorn / tech / 695 < prev    next >
Encoding:
Internet Message Format  |  1992-11-19  |  2.4 KB

  1. Path: sparky!uunet!pipex!warwick!uknet!acorn!RMokady
  2. From: RMokady@acorn.co.uk (Ran Mokady)
  3. Newsgroups: comp.sys.acorn.tech
  4. Subject: Re: Getting 3rd Party Filing Systems To Use Showfree
  5. Message-ID: <20250@acorn.co.uk>
  6. Date: 19 Nov 92 16:55:21 GMT
  7. References: <ARM200-921118163118-7952E65F*@MHS>
  8. Sender: rmokady@acorn.co.uk
  9. Organization: Acorn Computers Ltd, Cambridge, England
  10. Lines: 47
  11.  
  12. >
  13. >Actually using this is a bit tricky. Brian Brunswick has working code which
  14. >uses this in Memphis (possibly not the released version). The biggest
  15. >problem is that when the FreeSpace module calls your handler routine, you
  16. >are in User mode and R13 points to the FreeSpace module's private stack in
  17. >it's workspace. This is of zero gauranteed depth ie. you can't use it, so
  18. >you have no stack (unless you want to over-write random bits of RMA). So you
  19. >need to supply your own stack, or not use any stack, or call SWI OS_EnterOS
  20. >to get the SVC stack. You can ease the problem by doing as little work
  21. >yourself as possible eg. call SWI OS_FSControl 49 (get free space) to do all
  22. >the work for you for free space reason code 2 (the other option for IDEFS
  23. >is to call IDEFS_DescribeDisc).
  24. >
  25.  
  26.  This is not quite as bad as you try and present it ...
  27.  
  28.  By the same token, you are never guaranteed that there is any free space on
  29. the SVC stack, and so should check every time before you push a register.
  30.  
  31.  The routines are called in USR mode, WITH SUFFICIENT STACK SPACE !
  32.  
  33.  Sufficient stack space means that you should not go around allocating
  34. buffers out of the stack, or using deeply recursive algorithms, but you
  35. should have no problem if you are just pushing a few registers on the stack.
  36.  
  37.  In fact, I'd be surprised if you ever get called when there are less that
  38. 256 bytes free on the stack, but don't quote me on it :-)
  39.  
  40.  
  41.  In fact, from having a second look at the code, for some of the reason
  42. codes you may be called in SVC mode, so don't go round allocating a stack
  43. and making R13 point to it, or you may end up corrupting the SVC stack
  44. pointer!
  45.  
  46.  
  47. >Owen.
  48.  
  49.         Ran.
  50.  
  51.  
  52. -----                    
  53. RMokady@acorn.co.uk          |
  54. Ran Mokady                   |  "We're children, Needing other children
  55. Senior Software Engineer     |   And yet letting our grown up pride
  56. Technical Support            |   Hide all the need inside
  57. Acorn Computers              |   Acting more like children than children"
  58. Cambridge, UK.               |
  59.