www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/06/20/05:48:31

Xref: news2.mv.net comp.os.msdos.4dos:5338 comp.os.msdos.apps:8295 comp.os.msdos.desqview:3653 comp.os.msdos.djgpp:5186 comp.os.msdos.mail-news:2582 comp.os.msdos.misc:33525 comp.os.msdos.pcgeos:314 comp.os.msdos.programmer:25659 comp.os.msdos.pr ...
From: brucef AT central DOT co DOT nz (Bruce Foley)
Newsgroups: comp.os.msdos.4dos,comp.os.msdos.apps,comp.os.msdos.desqview,comp.os.msdos.djgpp,comp.os.msdos.mail-news,comp.os.msdos.misc,comp.os.msdos.pcgeos,comp.os.msdos.programmer,comp.os.msdos.programmer.turbovision
Subject: Re: abort/kill - TSR
Date: Thu, 20 Jun 1996 06:58:13 GMT
Organization: Internet Company of New Zealand
Lines: 48
Distribution: inet
Message-ID: <4qb07f$1oa@status.gen.nz>
References: <31C0734A DOT 4F20 AT msmail4 DOT hac DOT com> <4pshkf$155a AT msunews DOT cl DOT msu DOT edu>
NNTP-Posting-Host: brucef.central.co.nz
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

rubin AT msu DOT edu (Paul A. Rubin) wrote:

>In article <31C0734A DOT 4F20 AT msmail4 DOT hac DOT com>,
>   Michael B Williams <mwilliams1 AT msmail4 DOT hac DOT com> wrote:
>->hi,
>->
>-> is there away to kill/abort a TSR without rebooting?
>->
>->Michael B. Williams
>->mwilliams1 AT msmail4 DOT hac DOT com

>Some TSRs can be turned off by typing a partcular command (or using a 
>particular hot-key).  Some can even be unloaded, *if* they were the last 
>TSR to load.
etc...

I was just asked to develop a routine at work that disabled the
keyboard while we do sofware drops.  I implemented it using
3 programs, the first 2 being TSR's:
The first program added a new routine to the Multiplexer (2f)
interrupt.  I gave it the ability to store and return IVT entries, in
the form of segment:offset.
The second program implemented a new Int 9 handler (to
disable the keyboard), and stored the old address using using
my new Multiplexer function.
The third program -a standard exe, restored the old keyboard
handler and multiplexer IVT's by using calls to my Multiplexer
function to get the saved addresses.
This left me with one last problem:  Even though I had
restored the old interrupts in the IVT, Memory was still allocated
to my custom routines, which had served their purpose, and
didn't need to be there anymore.
I did some reading up, and discovered these things called MCB's
or Memory Control Blocks.  These blocks can be released via
a DOS call: 21h/49h.  All you have to do is figure out which ones
are not used anymore, calculate the segment address of the data
area that follows on directly from the corresponding MCB and
make your call.  Hey presto!  Clean memory!!!!
If anyone would like to see the code, give me a yell.  The only
thing I haven't quite got sussed is how you associate the MCB's
via the Process Id's.  I did it by using the File name instead, which
I admit is a little bit dodgy.

Regards,  Bruce.

 


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019