home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / acorn / tech / 705 < prev    next >
Encoding:
Text File  |  1992-11-20  |  2.6 KB  |  57 lines

  1. Newsgroups: comp.sys.acorn.tech
  2. Path: sparky!uunet!pipex!warwick!pavo.csi.cam.ac.uk!bdb
  3. From: bdb@cl.cam.ac.uk (Brian Brunswick)
  4. Subject: Re: Getting 3rd Party Filing Systems To Use Showfree
  5. Message-ID: <1992Nov20.231423.21354@infodev.cam.ac.uk>
  6. Sender: news@infodev.cam.ac.uk (USENET news)
  7. Nntp-Posting-Host: ely.cl.cam.ac.uk
  8. Reply-To: Brian.Brunswick@cl.cam.ac.uk (Brian Brunswick)
  9. Organization: U of Cambridge Comp Lab, UK
  10. References: <ARM200-921118163118-7952E65F*@MHS> <20250@acorn.co.uk>
  11. Date: Fri, 20 Nov 1992 23:14:23 GMT
  12. Lines: 43
  13.  
  14. In article <20250@acorn.co.uk> RMokady@acorn.co.uk (Ran Mokady) writes:
  15. ( Quoting Owen smith at start0
  16. >>
  17. >>Actually using this is a bit tricky. Brian Brunswick has working code which
  18. >>uses this in Memphis (possibly not the released version). The biggest
  19. >>problem is that when the FreeSpace module calls your handler routine, you
  20. >>are in User mode and R13 points to the FreeSpace module's private stack in
  21. >>it's workspace. This is of zero gauranteed depth ie. you can't use it, so
  22. >>you have no stack (unless you want to over-write random bits of RMA). So you
  23. >>need to supply your own stack, or not use any stack, or call SWI OS_EnterOS
  24. >>to get the SVC stack. You can ease the problem by doing as little work
  25. >>yourself as possible eg. call SWI OS_FSControl 49 (get free space) to do all
  26. >>the work for you for free space reason code 2 (the other option for IDEFS
  27. >>is to call IDEFS_DescribeDisc).
  28. >>
  29. >
  30. > This is not quite as bad as you try and present it ...
  31. >
  32. > By the same token, you are never guaranteed that there is any free space on
  33. >the SVC stack, and so should check every time before you push a register.
  34. >
  35. > The routines are called in USR mode, WITH SUFFICIENT STACK SPACE !
  36. >
  37. ...
  38. > In fact, from having a second look at the code, for some of the reason
  39. >codes you may be called in SVC mode, so don't go round allocating a stack
  40. >and making R13 point to it, or you may end up corrupting the SVC stack
  41. >pointer!
  42.  
  43.  
  44. It wouldn't have been so bad if I hadn't been writing in C with cmhg
  45. style headers on the entrance, that fix up the stack chunks for you.
  46. I was mystified as to why my routines kept reporting out of memory
  47. errors for allocating from the rma... until I found out the the stack
  48. pointer that I was being passed was in the RMA, so that the stub
  49. routine ahppily put the C relocation offsets over the beginning of the
  50. RMA area, corrupting its heap, so allocation failed. Of course, when I
  51. returned an error the exit routine UNcorrupted them again...
  52. Eventually I wrote some m/c stubs that used FSControl freespace,
  53. and settled for implementing the fscontrol properly in call my fses.
  54.  
  55. --
  56. Brian.Brunswick@cl.cam.ac.uk  Disclaimer.  Short sig rules!
  57.