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