home *** CD-ROM | disk | FTP | other *** search
/ Explore the World of Soft…e: Engineering & Science / Explore_the_World_of_Software_Engineering_and_Science_HRS_Software_1998.iso / programs / dies / tsa_a.exe / TSA_4.EXE / TSR.DOC < prev    next >
Text File  |  1994-11-01  |  16KB  |  383 lines

  1. ****************************************************************
  2. *                TSR Utilities Version 2.5                     *
  3. *   The TSR Utilities include programs useful in managing      *
  4. *   DOS memory, and in particular managing memory-resident     *
  5. *  utilities. TSR stands for "Terminate and Stay Resident".    *
  6. *                                                              *
  7. ****************************************************************
  8.  
  9. A. Introduction
  10. ================================================================
  11.  
  12. The TSR Utilities have grown to include 8 programs. Here's a
  13. quick overview of each one:
  14.  
  15.   MARK - marks a position above which TSRs can be released.
  16.   RELEASE - removes TSRs from memory.
  17.   MAPMEM - shows what memory resident programs are loaded.
  18.  
  19. The programs are described in more detail in the following
  20. sections.
  21.  
  22.  
  23. B. MARK and RELEASE
  24. ================================================================
  25.  
  26. MARK.COM and RELEASE.COM are used to remove memory-resident
  27. programs from memory, without requiring a system reboot, and
  28. without the usual problems of creating holes or leaving
  29. interrupts dangling. The two programs are used simply as follows:
  30.  
  31. 1) Run the program MARK.COM before installing any memory-
  32.    resident program that you may wish to deinstall later.
  33.    This marks the current position in memory and stores the
  34.    DOS interrupt vector table (all interrupts from 0 to FFH).
  35.  
  36. 2) Install whatever TSRs that you want to use, in the normal
  37.    way that you install them.
  38.  
  39. 3) When you want to deinstall all TSRs above the last MARK,
  40.    run the program RELEASE.COM. This will release all of the
  41.    memory above (and including) the last MARK, and restore
  42.    all interrupt vectors taken over by the memory resident
  43.    programs.
  44.  
  45. MARK and RELEASE can be "stacked" as many times as desired.
  46. RELEASE releases the memory above the last MARK call. MARK uses
  47. about 1600 bytes of memory each time it is called. This 1600
  48. byte region is also released when a RELEASE is done. MARK memory
  49. usage is dominated by the copies of the DOS interrupt vector
  50. table (interrupts 0..FFh) and the copy of the EMS page map
  51. (blocks 0..31 only) which MARK keeps when it goes resident.
  52.  
  53. ----------------------------------------------------------------
  54.  
  55. MARK and RELEASE can optionally be called with a single command
  56. line parameter:
  57.  
  58.   MARK MarkName
  59.   RELEASE MarkName
  60.  
  61. In this way a particular mark is given a name. Calling RELEASE
  62. with the same name will release all memory above and including
  63. the mark of that name, also releasing any intermediate marks in
  64. the process. If no mark of the proper name is found, RELEASE
  65. will halt with a warning. A RELEASE call with no MarkName
  66. specified will release the last MARK, whether or not that MARK
  67. was named.
  68.  
  69. The MarkName can be any text string up to 126 characters in
  70. length. It may not contain embedded blanks or tabs. Case (upper
  71. or lower) is not important when matching MarkNames.
  72.  
  73. MarkName supports an additional feature. If the MarkName begins
  74. with ! (exclamation point), then the mark is called a "protected
  75. mark". That mark can be released *only* by an exact match to its
  76. name (including the exclamation point). A protected mark will
  77. NOT be released with an "unnamed" RELEASE. Any named or unnamed
  78. RELEASE will stop without releasing any memory if it encounters
  79. a protected mark that it does not match exactly.
  80.  
  81. ----------------------------------------------------------------
  82.  
  83. As of version 1.4, MARK and RELEASE also control Expanded memory
  84. (Lotus/Intel/Microsoft EMS). They have been tested with READY!
  85. and with the TurboPower Software expanded memory disk cache, as
  86. well as with the device drivers used by the STB Expanded Memory
  87. Card.
  88.  
  89. WARNING: if a resident application allocates expanded memory at
  90. some time *after* going resident and after the last MARK made,
  91. that expanded memory will be released by a call to RELEASE. The
  92. current expanded memory manager (EMM) does not give us enough
  93. information to avoid this possibility. Fortunately, there are no
  94. known memory resident programs which perform this dynamic
  95. allocation of expanded memory. We hope that the EMM will be
  96. upgraded before such applications are designed.
  97.  
  98. ----------------------------------------------------------------
  99.  
  100. As of version 1.6, RELEASE takes special precautions to allow it
  101. to release extra invocations of the DOS command processor. In
  102. the simplest form, an extra command processor is obtained by
  103. typing COMMAND at the DOS level. Many multitasking or switching
  104. utilities also utilize this feature of DOS, and these utilities
  105. can now be managed via MARK and RELEASE.
  106.  
  107. ----------------------------------------------------------------
  108.  
  109. Due to the way DOS handles batch files, there are certain
  110. limitations on using RELEASE within batch. You *cannot* perform
  111. the following sequence of events successfully:
  112.  
  113. First, from the DOS command line:
  114.  
  115.   MARK
  116.   mce      {MicroStation, or any other resident program or programs}
  117.  
  118. Then, within a batch file:
  119.  
  120.   RELEASE {get rid of mce and MARK}
  121.   LOTUS   {run Lotus using the additional memory}
  122.   MARK    {put mce back in place}
  123.   mce
  124.  
  125. DOS allocates a small memory block prior to running any batch
  126. file. It does not allow that block to be deallocated from within
  127. the batch file without various errors occurring. As a result, in
  128. this case the MARK and mce memory blocks are effectively trapped
  129. until the batch file is completed, after which the memory will
  130. be reusable. Indeed, if you run the batch file presented above,
  131. you will get MARK and mce installed above a big hole in memory
  132. left by the previous images of MARK and mce.
  133.  
  134. As of version 1.9, RELEASE guards against this possibility. If
  135. it senses that you are attempting to release memory trapped by a
  136. "batch control block", it writes a warning message to that
  137. effect. It still releases the memory, but when it exits it
  138. passes back a return code of 1 rather than the usual value of 0.
  139.  
  140. You *can* obtain the desired effect in at least two other ways.
  141. First, you could make two batch files and call them one after the
  142. other:
  143.  
  144. Batch file #1:
  145.   RELEASE
  146.  
  147. Batch file #2:
  148.   LOTUS
  149.   MARK
  150.   mce
  151.  
  152. In this case, running RELEASE in batch file #1 has the same
  153. effect as running RELEASE from the DOS command line. However,
  154. directly calling the second batch file from the first doesn't
  155. always seem to work either. The only sure bet appears to be the
  156. use of a keypoker like STACKEY, KEY-FAKE or PCED's KEYIN,
  157. modifying Batch #1 as follows:
  158.  
  159.   RELEASE
  160.   KEY-FAKE "batch2" 13
  161.  
  162. A better way to make these things happen is to use the public
  163. domain program CED, or its commercial upgrade PCED. These
  164. programs allow you to define "synonyms" for groups of commands.
  165. The commands execute one after the other just like a batch file.
  166. However, the synonyms do not create an extra batch control
  167. memory block which causes the problems just described.
  168.  
  169. Thus you could make two CED synonyms as follows. (We assume that
  170. the CED "chain character" is ^).
  171.  
  172. SYN LOADSK 'mark !mce^mce'
  173.   {create a protected mce marker and load mce}
  174.  
  175. SYN RUNLOT 'release !mce^lotus^mark !mce^mce'
  176.   {release mce if it's there, run lotus, then reload mce}
  177.  
  178. Note: you can obtain PCED by calling Cove Software at
  179. 301-992-9371.
  180.  
  181. ----------------------------------------------------------------
  182.  
  183. Regarding PCED, please note the following: PCED supports
  184. "user-installed commands" such as KEYIN, HS, RAW and others. MARK
  185. and RELEASE are unable to release these user-installed commands
  186. individually. That is, if your AUTOEXEC.BAT looked like the
  187. following:
  188.  
  189.   CED
  190.   MARK
  191.   KEYINST
  192.  
  193. then typing RELEASE would sooner or later cause your system to
  194. crash. RELEASE cannot inform PCED that its installed command is
  195. gone, and PCED will continue to try to use code which is no
  196. longer in memory.
  197.  
  198. PCED itself provides a "KILL" command which removes
  199. specified user-installed programs from memory. Use the KILL
  200. command if you want to remove PCED's user-installed commands from
  201. memory.
  202.  
  203. MARK and RELEASE can safely be used with PCED's commands as long
  204. as PCED itself is removed from memory when the commands are.
  205.  
  206. ----------------------------------------------------------------
  207.  
  208. Version 2.1 of RELEASE fixes a stupid bug in 2.0. This bug lead
  209. to reports of RELEASE printing its status message on the
  210. printer, and to some system crashes. The bug was caused by
  211. writing over the first two bytes of the DOS file handle table at
  212. offset 0018H in the PSP.
  213.  
  214. ----------------------------------------------------------------
  215.  
  216. Version 2.2 of RELEASE adds a few new features. These features
  217. are activated by command line switches. The valid switches are
  218. as follows:
  219.  
  220.   /K    release memory above the specified MARK, but Keep the
  221.         MARK itself in memory. This switch is useful if you plan
  222.         to reinstall the released TSRs later.
  223.  
  224.   /R    Revector the 8259 interrupt controller(s) to powerup
  225.         state. This option is useful for TSRs that patch in to
  226.         the system at a very low level. Examples include network
  227.         operating system shells, multitaskers, etc. Use this
  228.         option with caution; that is, test it at a time when
  229.         no useful work is loaded into memory.
  230.  
  231.   /?    Show a brief help screen and halt.
  232.  
  233. Any of these options are acceptable when preceded by a '-', for
  234. example, -K instead of /K.
  235.  
  236. The /R option now allows the release of DesqView, Windows, and
  237. TaskView from memory. We hope that it will allow the release of
  238. network shells, but have not been able to test it. DoubleDOS
  239. unfortunately cannot be released even with the /R option. (It
  240. apparently patches DOS itself when it is installed.)
  241.  
  242. Version 2.2 of RELEASE also restores a few additional memory
  243. locations from the MARK. It restores 8 bytes at 40:A8
  244. (associated with the EGA) and 16 bytes at 40:F0 (the
  245. interapplications communications area).
  246.  
  247. ----------------------------------------------------------------
  248.  
  249. Version 2.3 of RELEASE adds support for the new WATCH feature of
  250. the TSR Utilities. There will be no apparent difference in
  251. RELEASE's behavior, but behind the scenes, it is updating the
  252. WATCH data area whenever you release TSRs from memory.
  253.  
  254. ----------------------------------------------------------------
  255.  
  256. Version 2.4 of RELEASE slightly changes the way that EMS expanded
  257. memory is managed. We have had a number of reports of EMS clones
  258. in which one of the EMS library functions that we use is not
  259. correctly implemented. Since there is an alternate means of
  260. getting the same information, and apparently the alternate means
  261. is more reliably implemented, we have changed RELEASE (and
  262. MAPMEM). See the source code if you care about the details.
  263.  
  264. We have also added a new RELEASE command line switch, /N, which
  265. causes RELEASE to avoid touching EMS memory at all. Since so few
  266. memory resident programs use expanded memory, this switch will
  267. allow RELEASE to be used for the majority of programs even if a
  268. conflict with the EMS driver occurs.
  269.  
  270.  
  271. C. MAPMEM
  272. ================================================================
  273.  
  274. MAPMEM.COM is used to display the current DOS memory map. It shows
  275. the resident programs, how much memory they use, and what interrupt
  276. vectors each currently controls. MAPMEM also shows information
  277. about expanded memory when such a driver is installed. MAPMEM
  278. writes to the standard output -- thus the output can be printed
  279. or stored to a file by using DOS redirection.
  280.  
  281. MAPMEM shows MARKs so that you can examine them prior
  282. to a RELEASE. A MARK will show the owner name "MARK", and the
  283. mark name (if any) in the command line area.
  284.  
  285. MAPMEM supports the following command line options:
  286.  
  287.      /V     Verbose report.
  288.      /?     Write a brief help screen.
  289.  
  290. MAPMEM accepts either "/" or "-" to delimit the command line
  291. options.
  292.  
  293. On the Verbose report, the "Files" column shows the number of
  294. file handles that each resident block has kept open. Each block
  295. of memory reported by DOS is listed individually in verbose
  296. mode. This is useful in debugging problems, either with the TSR
  297. Utilities themselves, or perhaps with the resident programs that
  298. you are using.
  299.  
  300. By default, each "hooked vector" that MAPMEM reports shows only
  301. the current owner of the vector. Any previous owners now chained
  302. onto the list are not shown. Because of the technique used,
  303. MAPMEM may report some bogus hooked vectors (generally high
  304. numbered ones).
  305.  
  306. ----------------------------------------------------------------
  307.  
  308. D. The Story Behind the TSR Utilities
  309. ================================================================
  310.  
  311. These programs should work on any system running PC-DOS or MS-DOS
  312. 2.0 or later. They were developed on a Compaq Deskpro 286 running
  313. Compaq DOS 3.0 and have subsequently been tested on a number of
  314. different systems.
  315.  
  316. Complete source code for the TSR Utilities is available in the
  317. file TSRSRC.ARC. MARK, FMARK, WATCH, RAMFREE and EATMEM are
  318. written in assembly language (MASM), while DISABLE, MAPMEM and
  319. RELEASE are written in Turbo Pascal. TSRSRC requires that you
  320. have Turbo Pascal version 3. On CompuServe, TSRSRC is found in
  321. the Borland SIG (Go BOR-100) in data library 3 (DL3).
  322.  
  323. These programs are copyrighted, but may be freely distributed for
  324. personal, non-commercial use. You may use them yourself, give
  325. them to your friends or co-workers, or distribute them for a
  326. cost-based fee as part of a user's group or bulletin board
  327. service. If you wish to distribute these programs as part of a
  328. commercial package, please contact us for a license agreement.
  329.  
  330. These programs were originally developed as an exercise in
  331. understanding DOS memory management. We request no donation.
  332. However, we will request $10 to cover our cost and time if you
  333. ask us to ship a disk to you.
  334.  
  335. TurboPower Software is in the business of Turbo Pascal
  336. programming tools for serious developers. Our first product, the
  337. TurboPower Utilities, contains 9 programs including an
  338. intelligent cross-referencer, a pretty printer, an execution
  339. profiler and several DOS file and text management tools.
  340.  
  341. Our second product, Turbo EXTENDER, lets Turbo Pascal programs
  342. grow beyond 64K bytes in size via modular compilation and
  343. linking. It also provides a toolbox of routines for virtual array
  344. management, as well as analytical tools for overlayed programs.
  345.  
  346. Our third product, T-DebugPLUS, is an expanded and fully
  347. supported version of the popular public domain program TDEBUG. It
  348. includes both a fully symbolic debugger integrated with the Turbo
  349. Pascal development environment, and also the ability to generate
  350. DOS standard MAP files for use with other external symbolic
  351. debuggers such as Periscope, Symdeb, and Atron.
  352.  
  353. If you have seen prior versions of the TSR Utilities, you may
  354. note that the COM files in version 2.5 are significantly smaller
  355. than before. The assembler programs are smaller due to a
  356. conversion to the MicroSoft assembler, which allowed us to keep
  357. static data structures out of the COM files. The Pascal programs
  358. are smaller due to the application of TurboPower Software's new
  359. product, Turbo Optimizer. Optimizer automatically removes the
  360. unused portions of Turbo Pascal's runtime library, and also
  361. optimizes the compiler generated code, making it smaller and
  362. faster.
  363.  
  364. The TSR Utilities were written by Kim Kokkonen, with thanks to
  365. Neil Rubenking for the original idea behind MARK and RELEASE.
  366. Also my thanks to Richard Wilson and Barry Simon at CalTech for
  367. the idea that lead to FMARK, and for much useful correspondence
  368. about the TSR Utilities.
  369.  
  370. We can be reached at:
  371.  
  372.      TurboPower Software
  373.      3109 Scotts Valley Drive #122
  374.      Scotts Valley, CA 95066
  375.      408-438-8608 (voice only, Monday-Friday 9AM-5PM)
  376.      Compuserve: 72457,2131
  377.  
  378. Version 2.5 - 6/2/87 - fixes some minor bugs, and adds
  379.   version checking between MARK and RELEASE.
  380.  
  381. The TSR Utilities are Copyright (c) 1986,1987 by Kim Kokkonen.
  382. All Rights Reserved.
  383.