home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Lion Share
/
lionsharecd.iso
/
utils_mz
/
unhang.zip
/
UNHANG.DOC
< prev
Wrap
Text File
|
1992-01-01
|
6KB
|
119 lines
░▒▓█░▒▓█░▒▓█░▒▓█░▒▓█░▒▓█░▒▓█░▒▓█░▒▓█░▒▓█░▒▓█░▒▓█░▒▓█░▒▓█░
█ UNHANG Version 1.00. (C)Copyright Oleg Kibirev, 1991. ▒
░ Documentation file ▓
█▓▒░█▓▒░█▓▒░█▓▒░█▓▒░█▓▒░█▓▒░█▓▒░█▓▒░█▓▒░█▓▒░█▓▒░█▓▒░█▓▒░█
UNHANG is a tiny (416 byte) TSR that lets you get out of misbehaved programs.
Once it's loaded, Alt/Enter will terminate current process & reset screen to
text mode (the last is important when "breaking" from games). This is similar to
Ctrl/C but helps in infinitely more cases. It will work weather or not a DOS
function is being executed. It will also work with programs that hook interrupt
vectors or change EGA data areas.
UNHANG also handles two more cases. One is divide overflow. The default DOS
strategy for this interrupt is displaying message & terminating the program.
However, interrupt vectors are not restored & if program hooks any of them, you
are out of luck. UNHANG handles this situation like Alt+Enter. (Of course, a
more sophisticated program can install it's own handler - UNHANG will not
prevent it from doing this).
Another is non-maskable interrupt. It occurs on memory parity or 80X87 math
error. Most BIOSes handle this interrupt by locking PC. This is the worst
strategy possible - you effectively loose ALL memory rather than just one bit -
even not considering a possibility that an error has occurred in parity bit
itself! UNHANG will terminate a program, notify you about NMI & disable it -
because if the problem is with memory, it's likely to repeat.
░░░░░░░░░░░░░░░░░░░░
░░ UNHANG options ░░
░░░░░░░░░░░░░░░░░░░░
Each time a program is executed, UNHANG allocates an additional block of memory
to save interrupt vectors 1-3fh. When a program exits, the block is freed.
However, since this block is usually lower in memory than a program itself, a
TSR that loads while UNHANG is active, will leave 208-byte "hole". To solve a
problem, you can put UNHANG to "TSR" mode. In this case interrupts are not
saved. Alt/Enter still functions but it's not a good idea to use it - it will
hang in more situations than in normal mode.
All UNHANG options can be abbreviated to one letter - either upper or lowercase:
T(SR) - start TSR mode
N(OTSR) - resume saving vectors. Use when you are finished with loading TSRs
P(ARITY) - re-enable NMI. Use for diagnostics.
T & N options will load UNHANG to memory if it's not already resident.
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒ Low level comments ▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
1) UNHANG uses locations of PSP that are not used by DOS. When a program
executes a child, the following information is stored in it's (not child's) PSP:
PSP:56h - address of the memory block with saved interrupts. The block is 192
bytes long (without MCB) & contains a copy of interrupt vectors 1-3fh
PSP:58h - saved SS of the program calling exec function
PSP:5Ah - saves SP of the program calling exec function
2) TSR/NOTSR modes can be switched from a program:
AH = 18H ; Nonexistant DOS function
CX = 'OF' to enter TSR mode
CX = 'ON' (or anything else) to resume vector saving
Return : DX='OK' if UNHANG is installed
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
▓▓ Limitations ▓▓
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
1) UNHANG tries many ways to rescue the system. When you press Alt/Enter it
clears registers of interrupt controller, calls EGA+ BIOS initialization routine
at C000:0003 to repair EGA data area, resets floppy & hard drives & restores
vectors 1 - 3fh to the values before the start of the program. I guess not all
of this will work on ALL PCs. In particular, NOHANG requires EGA or VGA video
board.
2) UNHANG will be unable to operate if the offending program has blocked
keyboard interrupt (so that it just can't get this Alt/Enter). Another "sure"
ways to crash the system are filling low memory with junk or issuing an
instruction like "POP CS" or "MOV AX,[FFFF]".
3) It's easy to make a mess with UNHANG. For example, terminating a program
during a disk operation will cause data to be lost & leave FAT in distorted state
(try CHKDSK /F if this happens). Use Alt/Enter at your own risk.
4) Memory mapping utilities like MEM or MAPMEM will not display the name
"UNHANG" in the list of programs. Instead, you'll see a 400-byte "data area" of
COMMAND.COM. The reason is that resident code contains no PSP: instead of just
using DOS "Stay Resident" function, UNHANG moves it's resident portion 256 bytes
lower in memory, sets current PSP to PSP of a parent program, shrinks program
segment to the size of resident code & makes a far jmp to INT 22H vector. This
reduces the size of the program in memory by 256 bytes - a good value for tiny
TSRs like UNHANG. See Ralf Brown's interrupt listing for details about doing
this.
█████████████████████████
██ Distributing UNHANG ██
█████████████████████████
This program is freeware. You are encouraged to distribute it either separately
or as a part of your own programs providing that you include both UNHANG.COM &
UNHANG.DOC.
██████████████
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒█Oleg Kibirev█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒ ██████████████ ▒
▒ Current address : ▒ E-MAIL : Try both: ▒
▒ 277 Babcock Street P.O. Box 1869 ▒ kibirev@BUCSF.BU.EDU & ▒
▒ Boston MA 02215 USA ▒ kibirev@CSA.BU.EDU ▒
▒ Phone: (617)352-5563 ▒ ▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒ Home address : Flat 42 Ilycha street 7, Novosibirsk 630090, USSR ▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒