[comp.sys.ibm.pc] Question 3 of 3 for assembly language programmers.

alanr@tekigm2.MEN.TEK.COM (Alan Rovner) (04/17/89)

Suppose I have a TSR already installed and working ok, and I want to disable
it and return its memory back to DOS.  Can this be done without rebooting?
I was thinking of passing a command line argument like -u to uninstall
the TSR.  But I don't know the assembly language details.  Thanks in advance
for any info.

Al Rovner
Tektronix Inc.
Vancouver, Wash.

jmv@sppy00.UUCP (Jim Vickroy) (04/18/89)

In article <4498@tekigm2.MEN.TEK.COM> alanr@tekigm2.MEN.TEK.COM (Alan Rovner) writes:
=>
=>Suppose I have a TSR already installed and working ok, and I want to disable
=>it and return its memory back to DOS.  Can this be done without rebooting?
=>I was thinking of passing a command line argument like -u to uninstall
=>the TSR.  But I don't know the assembly language details.  Thanks in advance
=>for any info.

Interrupt handlers get their information through the registers (see, for
example, INT 21H). What many interrupt handlers, therefore, do is define a 
"deinstall" function along with all of the other functions of the particular 
interrupt. Somthing like passing a FFH in AH (usually the register to pass
function numbers) would deinstall (actually disable unless your handler is
smart enough to physically deinstall itself and return it's memory back to
DOS). The problem with the -u is that there is no "reliable" (of course this
is debatable) way to check if your handler has already been installed.

jim
--
==============================================================================
:::: ::: ::  ::   :    :   Jim Vickroy
|OC| ||| ||  ||   |    |   Technical Services Department
|LC| ||| ||  ||   |    |   Online Computer Library Center, Inc.
:::: ::: ::  ::   :    :   Dublin, Ohio
------------------------------------------------------------------------------
UUCP:    {att|pyramid|killer}!osu-cis!sppy00!jmv  
domain:	 jmv@sppy00.uucp
USSNAIL: 6565 Frantz Rd., Dublin, Ohio 43017-0702
------------------------------------------------------------------------------
"Hey, wow man ... pooby shooby"                                            -cm
==============================================================================

u-dmfloy%ug.utah.edu@wasatch.utah.edu (Daniel M Floyd) (04/19/89)

In article <4498@tekigm2.MEN.TEK.COM> alanr@tekigm2.MEN.TEK.COM (Alan Rovner) writes:
>Suppose I have a TSR already installed and working ok, and I want to disable
>it and return its memory back to DOS.  Can this be done without rebooting?
>I was thinking of passing a command line argument like -u to uninstall
>the TSR.  But I don't know the assembly language details.  Thanks in advance
>for any info.

It is no problem to disable the program, but completely unloading and
returning memory is a tougher problem. With disable, you just keep
track of which mode your program is in and simply pass through
without processing when in disabled mode. Enabled you do the processing.
Simple.

To completely unload *only* your TSR, you have to restore all the interupts to
what they would have been if you didn't load your program. That is
you can't just put them back original because some other TSR may
be loaded after yours. You would also have to tell the other TSRs that
the interupt they got is no longer viable. Yes, this can be done, but
the problem is so complex that no one wants to attempt it. Plus processing
would be slowed in doing so.

There is a PD program with mark and release that marks a TSR and then
will release it along with any other TSRs loaded after that one. I would
post it, but I've already got a back log. Someone probably already posted
it anyway. If you want it, your making a few local calls to BBSs might
get it quickly.
Dan Floyd
8<D=