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

  1. Newsgroups: comp.sys.acorn.tech
  2. Path: sparky!uunet!gumby!yale!cs.yale.edu!news-mail-gateway!daemon
  3. From: /G=Owen/S=Smith/O=SJ-Research/ADMD=INTERSPAN/C=GB/@mhs-relay.ac.uk
  4. Subject: Re: Getting 3rd Party Filing Systems To Use Showfree
  5. Message-ID: <ARM200-921118163118-7952E65F*@MHS>
  6. Sender: /G=Owen/S=Smith/O=SJ-Research/ADMD=INTERSPAN/C=GB/@mhs-relay.ac.uk
  7. Organization: Yale CS Mail/News Gateway
  8. Date: Wed, 18 Nov 1992 16:31:18 GMT
  9. Lines: 54
  10.  
  11. crj10@phx.cam.ac.uk (Clive Jones) wrote:
  12.  
  13. >The FreeSpace module knows, initially, how to deal with ADFS, RAMFS, NETFS,
  14. >NFS and SCSIFS. Other filing systems have to register by calling:
  15.  
  16. (...details of SWIs and handlers deleted...)
  17.  
  18. Actually using this is a bit tricky. Brian Brunswick has working code which
  19. uses this in Memphis (possibly not the released version). The biggest
  20. problem is that when the FreeSpace module calls your handler routine, you
  21. are in User mode and R13 points to the FreeSpace module's private stack in
  22. it's workspace. This is of zero gauranteed depth ie. you can't use it, so
  23. you have no stack (unless you want to over-write random bits of RMA). So you
  24. need to supply your own stack, or not use any stack, or call SWI OS_EnterOS
  25. to get the SVC stack. You can ease the problem by doing as little work
  26. yourself as possible eg. call SWI OS_FSControl 49 (get free space) to do all
  27. the work for you for free space reason code 2 (the other option for IDEFS
  28. is to call IDEFS_DescribeDisc).
  29.  
  30. Next problem, FreeSpace calls you with the return address on the stack (the
  31. one you can't use for anything) rather than in LR.
  32.  
  33. OS_FSControl 49 - reads free space on the disc or image file that holds a
  34. specified object.
  35.  
  36. Entry:  r0 = 49
  37.         r1 = pinter to name of object (null terminated)
  38. Exit:   r0 = free space
  39.         r1 = largest creatable object
  40.         r2 = disc size
  41.  
  42. If you pass adfs::4.$.PC.Drive_C.DRDOS.TMP in r1, the information returned
  43. in r0-r2 will be for the PC hard disk image Drive_C and not ADFS drive 4.
  44.  
  45. All of the above information is in the grey cover photocopied PRMs that were
  46. available at the the Acorn User show.
  47.  
  48. It's a shame you can't do *ShowFree on a per directory basis, because if you
  49. could then you could get a free space display for your PC partition. Also
  50. since RISC OS 3 can get the free space of any image/disk on any filing
  51. system, it's a shame the FreeSpace module doesn't just use this. Then filing
  52. systems wouldn't have to bother with all this registering lark. These sound
  53. like things for Nick and Andrew's filer improvements package to me.
  54.  
  55. You can intercept the *Free call made by IDEFSFiler with:
  56.  
  57. *SetMacro Alias$Free If "<Wimp$State>"="desktop" then ShowFree -FS
  58. <FileSwitch$TemporaryFilingSystem> %0 else %Free %0
  59.  
  60. This should be enough for you to bolt interactive free space display on top
  61. of any RISC OS 2 filing system you may have, unless IDEFSFiler does a *%Free
  62. rather than *Free in which case you'd have to sit on OS_CLI in some way :-(.
  63.  
  64. Owen.
  65.