home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.atari.st.tech
- Path: sparky!uunet!sun-barr!cs.utexas.edu!torn!newshost.uwo.ca!uwovax.uwo.ca!7103_2622
- From: 7103_2622@uwovax.uwo.ca (Eric Smith)
- Subject: Re: Can a TSR Malloc()?
- Organization: University of Western Ont, London
- Date: Thu, 13 Aug 1992 00:16:05 GMT
- Message-ID: <1992Aug12.201605.1@uwovax.uwo.ca>
- References: <sourada.713595993@vincent1.iastate.edu> <1992Aug12.095216.1@uwovax.uwo.ca> <1992Aug12.181935.11706@mnemosyne.cs.du.edu>
- Sender: news@julian.uwo.ca (USENET News System)
- Nntp-Posting-Host: hydra.uwo.ca
- Lines: 33
-
- In article <1992Aug12.181935.11706@mnemosyne.cs.du.edu>, ilepore@nyx.cs.du.edu (Ian Lepore) writes:
- > I've always thought it should be possible to temporarily change TOS's _run
- > variable temporarily so that it points to the TSR's basepage during the
- > Malloc() then gets set back to the proper value.
-
- Aack! No, don't do this (it's precisely this "trick" that I warned you
- would break!). I think this is exactly why Atari warned people not
- to change _run. (If you're interested: MiNT doesn't use _run at all for
- memory management, because MiNT doesn't care about basepages, only
- about process id's -- this allows for funky things like fork() and
- vfork().)
-
- > Seriously, though...it would be nice to have an alternate form of Malloc()
- > usable by TSRs and desk accessories...something where you could pass a
- > pointer to the basepage of the process that should own the memory.
-
- There's a much better solution -- don't TSR! If your program is
- running under MultiTOS or MiNT, it doesn't have to terminate in order
- to stay resident; it can just run in the background. It can then do
- Malloc or file calls with no problems. If it wants to install some
- code in a vector that other processes can use, that code should use
- one of the (many) inter-process communication methods to send the
- Malloc request over to the "main" application which is hanging around
- in the background.
-
- The Ptermres() call was a rather ugly hack that Microsoft invented to
- make up for the lack of multitasking in MS-DOS. I think it's outlived
- its usefulness.
- --
- Eric R. Smith email:
- Dept. of Mathematics eric.smith@uwo.ca
- University of Western Ontario
-
-