home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pipex!warwick!uknet!acorn!RMokady
- From: RMokady@acorn.co.uk (Ran Mokady)
- Newsgroups: comp.sys.acorn.tech
- Subject: Re: Getting 3rd Party Filing Systems To Use Showfree
- Message-ID: <20250@acorn.co.uk>
- Date: 19 Nov 92 16:55:21 GMT
- References: <ARM200-921118163118-7952E65F*@MHS>
- Sender: rmokady@acorn.co.uk
- Organization: Acorn Computers Ltd, Cambridge, England
- Lines: 47
-
- >
- >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).
- >
-
- This is not quite as bad as you try and present it ...
-
- By the same token, you are never guaranteed that there is any free space on
- the SVC stack, and so should check every time before you push a register.
-
- The routines are called in USR mode, WITH SUFFICIENT STACK SPACE !
-
- Sufficient stack space means that you should not go around allocating
- buffers out of the stack, or using deeply recursive algorithms, but you
- should have no problem if you are just pushing a few registers on the stack.
-
- In fact, I'd be surprised if you ever get called when there are less that
- 256 bytes free on the stack, but don't quote me on it :-)
-
-
- In fact, from having a second look at the code, for some of the reason
- codes you may be called in SVC mode, so don't go round allocating a stack
- and making R13 point to it, or you may end up corrupting the SVC stack
- pointer!
-
-
- >Owen.
-
- Ran.
-
-
- -----
- RMokady@acorn.co.uk |
- Ran Mokady | "We're children, Needing other children
- Senior Software Engineer | And yet letting our grown up pride
- Technical Support | Hide all the need inside
- Acorn Computers | Acting more like children than children"
- Cambridge, UK. |
-