home *** CD-ROM | disk | FTP | other *** search
/ Emulator Universe CD / emulatoruniversecd1998.iso / MSX / OS / MSXDOS2.ZIP / MEMMAN24.LZH / MM24INTR.ENG < prev    next >
Encoding:
Text File  |  1996-04-15  |  20.3 KB  |  490 lines

  1. File : MM24INTR.ENG (c) MST
  2. Datum: 19 september 1992
  3. Door : Ries Vriend / Ramon van der Winkel / Robbert Wethmar
  4.  
  5. Unauthorized translation by Arnold Metselaar, 1 April 1996 
  6. ----------------------------------------------------------
  7.  
  8. This text contains an explanation about the functions and the use  of
  9. MemMan. For further information about the internals we point  you  to
  10. the file MM24SPEC.TXT that is also a part of the MemMan-package. That
  11. file is overfull with information that is valueable  to  programmers.
  12. For ordinary users it is not very usefull.
  13.  
  14. Contents
  15. --------
  16.  
  17. The files
  18.  
  19. Configurating MemMan
  20. Installing MemMan
  21. Installing MemMan automaticly
  22.  
  23. Terminate and Stay Resident programs
  24.  
  25. Loading TSR's
  26. Viewing TSR's
  27. Removing TSR's
  28.  
  29. MemMan BASIC-statements
  30.  
  31.  
  32. MST's MemMan 2, the MSX Memory Manager
  33. ======================================
  34.  
  35.   In the beginning of 1990 MSX Computer  Magazine  gathered  together
  36. the best MSX programmers of the Netherlands  with  the  intention  to
  37. revive the MSX world. De group  of  programmers  got  acquainted  and
  38. ideas were exchanged. It turned out that there was a need for an  MSX
  39. Memory Manager, a program that administers the memory of an MSX.
  40.  
  41. Two targets were aimed at with the Memory Manager:
  42.  
  43. 1) The searching  for  and  using  of  memory  becomes  simpler.  The
  44.    searching is done by MemMan while the using of the memory is  made
  45.    independent of  the  configuration  as  much  as  possible:  `Old'
  46.    expansions, one, two or more mappers, MemMan can handle it all.
  47. 2) It becomes possible to have more than one program  loaded  at  the
  48.    same time without conflicts. Think of RAMdisks, printerbuffers and
  49.    other background programs.
  50.  
  51.   The first target is reached with version 1 of MemMan  -  introduced
  52. on 9 september 1990. Now the second target is reached as well.
  53.   MemMan version 2 can load more  than  program  `somewhere'  in  the
  54. memory and have them working without the problem of interference.  On
  55. other computers this technique was already known. Such  programs  are
  56. called TSR's overthere, and here as well: Terminate and Stay Resident
  57. programs.
  58.  
  59.   Hopefully even more programs will  start  using  MemMan  and  other
  60. programs will be adapted for MemMan. A direct advantage is  that  the
  61. program will be able to work to work with  64  kB  modules  and  even
  62. multiple mappers directly, something most existing programs do not do
  63. or do not right.
  64.  
  65.   MemMan version 2 will be sent into the world as Public Domain, just
  66. like the first verion. That  means  that  everybody  may  use  MemMan
  67. freely. It is even permitted to sell MemMan as a part of a commercial
  68. package. Only in this way the program can become an extension of  the
  69. MSX-standard. Two packages will be released. The  first  one  is  for
  70. users of of MemMan. This package will contain MemMan and  some  tools
  71. for the TSR's. The second package contains development tools for  and
  72. technical documentation about programming TSR's. This last package is
  73. not Public Domain.
  74.  
  75. The following people worked on and thougth about MemMan:
  76.  
  77.   Ramon van der Winkel
  78.   Ries Vriend
  79.   Robbert Wethmar
  80.   Paul te Bokkel
  81.   Markus The
  82.   en some others who helped MemMan to become what it  is  with  their
  83. constructive criticism.
  84.  
  85. The files
  86. ---------
  87.  
  88. MEMMAN.COM   This file contains MemMan itself, one  can  load  it  by
  89.              typing MEMMAN at the DOS prompt. Internally this file is
  90.              the same as MEMMAN.BIN,  only  the  way  of  loading  is
  91.              different.
  92. MEMMAN.BIN   This file contains MemMan itself, one can load it by
  93.              typing BLOAD"MEMMAN.BIN",R  in  BASIC.  Internally  this
  94.              file is the same as MEMMAN.COM, only the way of  loading
  95.              is different.
  96. TL.COM       The TSR Loader. With TL TSR's can be loaded into  memory
  97.              from DOS. From BASIC they can be loaded with CMD TL.
  98. TV.COM       The TSR Viewer. With TV one can get a list of the  TSR's
  99.              that are present in the memory  with  their  full  names
  100.              (TSR ID's) on screen. From BASIC, this can be done  with
  101.              CMD TV. The TSR ID's are neccessary, amongst  others  to
  102.              remove a TSR using TK.
  103. TK.COM       The TSR Killer. With TK TSR's can be  removed  from  the
  104.              memory from DOS. From BASIC, TSR's can be  removed  with
  105.              CMD TK. One can find the name needed  to  kill  the  TSR
  106.              using TV. 
  107. CFGMMAN.COM  The configurating program for MemMan. With  CFGMMAN  one
  108.              can configurate MEMMAN.COM and MEMMAN.BIN from DOS. E.g.
  109.              it is possible to have command  executed  after  loading
  110.              automaticly.
  111.  
  112. MM24SPEC.TXT The  specifications  of  MemMan  2.4,  information   for
  113.              programmers. Only the  part  with  the  changes  in  the
  114.              latest version may be interesting to users.
  115. MM24INTR.TXT An introduction to MemMan 2.4, for those who use  MemMan
  116.              or want to use MemMan applications. This  file  contains
  117.              all neccessary information, but nothing about how MemMan
  118.              works internally. 
  119.  
  120. TV.BAS       An example of the use of the  built-in  TSR-commands  in
  121.              BASIC. Not an essential part of MemMan.
  122.  
  123. BK.COM       The filecopier that uses MemMan, not an  essential  part
  124.              of MemMan.
  125. BK-MAN.TXT   The Manual of BK.COM, not an essential part of MemMan.
  126.  
  127. others       Furthermore some example TSR's (CAPS.TSR and  COLOR.TSR)
  128.              are  delivered  with  MemMan.  They  are   intended   as
  129.              illustration and example and do not  form  an  essential
  130.              part of MemMan.
  131.  
  132. Configurating MemMan
  133. --------------------
  134.  
  135.   MemMan comes in two version: a .BIN and  a.COM  file.  It  will  be
  136. clear  that  the  .BIN  version  is  loaded   from   BASIC   with   a
  137. BLOAD"MEMMAN.BIN",R intruction, while the .COM can  be  started  from
  138. DOS by simply typing MEMMAN. Both version return to BASIC - by  a  so
  139. called `warm boot'- after loading. If the  .COM  version  is  started
  140. from DOS a command line can be given as an argument. Such  a  command
  141. line contains commands that are executed as if  they  were  typed.  A
  142. Return can be represented with the @ sign. There  can  be  several  @
  143. signs in the command line causing several commands to be executed  in
  144. sequence. 
  145.  
  146.   Example:
  147.  
  148. A>MEMMAN _SYSTEM@TL CAPS@
  149.  
  150. After starting MemMan there will be a return to MSXDOS  and  the  TSR
  151. CAPS will be loaded
  152.  
  153.   Using CFGMMAN it is possible to give some installation options  and
  154. a default command line. CFGMMAN can configure both the .COM  and  the
  155. .BIN version. Regarding TSR's the following installation options  can
  156. be changed:
  157.  
  158.   - Default command line
  159.   This is where the default command line can be entered. This command
  160. line is executed after MemMan is installed. The default command  line
  161. is allways executed after  loading  the  .BIN  version.  The  default
  162. command line is not executed if MemMan is  loaded  from  DOS  with  a
  163. command line as an argument. After  error  messages  from  MemMan  no
  164. command line is executed.
  165.  
  166.   - Heap size
  167.   Some TSR's need additional memory in page 3, which they normally do
  168. not have access to. The heap is a piece of memory in page 3  that  is
  169. accessible to TSR's. When a TSR reports that the heap size  available
  170. is too small this value should be increased. In most cases adding 100
  171. bytes to the heap will fix the problem. If  a  TSR  needs  more  heap
  172. space the manual should state this.
  173.   Each change of the heap size is only effective after loading MemMan
  174. again.
  175.  
  176.   - Maximum number of TSR's 
  177.   The number of TSR's that can be loaded by MemMan is limited. If the
  178. TSR Loader (TL) gives the message `TSR Table Full' this value  should
  179. be increased.
  180.  
  181.   - Recursion depth
  182.   When TSR's call eachother or themselves too often the  system  will
  183. hang at some point  in  time.  One  can  prevent  these  problems  by
  184. increasing the recursion depth. TSR's  that  call  themselves  should
  185. mention this - with the required recursion depth - in the manual.
  186.  
  187. Intalling MemMan
  188. ----------------
  189.  
  190.   To load MemMan from MSX-DOS it is sufficient to  type  `MEMMAN'  at
  191. the the `>'-prompt. From BASIC  the  BLOAD"MEMMAN.BIN",R  instruction
  192. should be executed. After installing MemMan BASIC is started in  both
  193. cases and the default command line is executed , as  given  with  the
  194. configuration  program  CFGMMAN.  De  default  command  line  is  not
  195. executed if MemMan is started from DOS with with another command line
  196. as its argument.
  197.  
  198.   Version 2 of MemMan occupies not only a piece of  the  BASIC-memory
  199. but also a 16 kB segment. this keeps the memory  available  in  BASIC
  200. and MSXDOS as big as possible. The space that is left over in the  16
  201. kB segment is used for TSR's if possible. The amount of BASIC  memory
  202. that MemMan uses can be influenced by using the CFGMMAN configuration
  203. program.
  204.  
  205.   When MemMan is installed under DOS2, all segments - except the  one
  206. that MemMan needs itself - remain available for DOS2. Therefore it is
  207. just possible to install MemMan firtst and than a DOS2 RAMdisk. 
  208.  
  209.   Before installing itself in the memory MemMan will check whether  a
  210. version of MemMan is already present. In  that  case  the  info-lines
  211. appear, completed with a messages that MemMan is  already  installed.
  212. Nothing else happens. The command line is executed normally. 
  213.  
  214. Installing MemMan automaticly
  215. -----------------------------
  216.  
  217.   Like any other program MemMan can be put in AUTOEXEC.BAS  or  .BAT.
  218. There is just one `problem': Installing MemMan causes a  `warm  boot'
  219. that puts  the  computer  in  BASIC.  This  stops  the  execution  of
  220. AUTOEXEC. Fortunately there is an easy  and  sufficient  solution  to
  221. this problem.
  222.  
  223.   The trick is that CFGMMAN  makes  it  possible  to  give  MemMan  a
  224. command line. This command line is executed immediately after  MemMan
  225. is installed. The first command in the command must therefore  be  an
  226. MSX BASIC commmand.
  227.  
  228.   Those who work under DOS,  will  in  general  install  MemMan  from
  229. AUTOEXEC.BAT by executing MEMMAN.COM. When other programs need to  be
  230. installed - like a series of TSR's - , The  command  line  must  look
  231. like:
  232.  
  233. CALL SYSTEM@GOON@
  234.  
  235. In this line the @-signs represent Return, and GOON is the name of  a
  236. batch file that will be executed after MemMan is installed.  GOON.BAT
  237. can than contain the following commands to be executed. When e.g. the
  238. intention is the start TED with a printerbuffer of 48 kB:
  239.  
  240. TL PB
  241. PRINT /i48
  242. TED
  243.  
  244. Of course this does require the files TL.COM, PB.TSR,  PRINT.COM  and
  245. TED.COM to be present on the disk.
  246.  
  247.   Those who work under Basic, will often want to install  some  TSR's
  248. after the installation of MemMan. In this case this can  be  done  by
  249. having a  second  BASIC  program  executed  after  MemMan  using  the
  250. following command line:
  251.  
  252. RUN "GOON.BAS"@
  253.  
  254. While GOON.BAS can look like:
  255.  
  256. 10 CMD TL ("TRACER",t)
  257. 20 CMD TL ("PB",t)
  258. 30 NEW
  259.  
  260.   To load e.g. the TSR's  TRACER.TSR  and  PB.TSR  automaticly  after
  261. which BASIC programs can be written. Of course it is also possible to
  262. load some other TSR's in line 30 and following, to start a program or
  263. to ask the user which TSR's should be loaded and not...
  264.  
  265.   Those who are only interested in few TSR's can of course do without
  266. a GOON.BAT or a GOON.BAS. Loading TSR's from command line  of  MemMan
  267. is no problem at all.
  268.  
  269. _SYSTEM@TL PB@TED@
  270.  
  271. The command line above returns to DOS after loading MemMan, loads the
  272. printerbuffer and starts the word processor TED. This  needs  TL.COM,
  273. but it can easily be done without:
  274.  
  275. CMD TL("PB",T)@_SYSTEM@TED@
  276.  
  277. Now Pb is loaded from BASIC using MemMan's CMD commands.  That  is  a
  278. little bit faster because TL.COM need not be loaded first.
  279.  
  280. Terminate and Stay Resident programs
  281. ------------------------------------
  282.  
  283.   Normally a program will not stay in  the  memory  after  execution.
  284. Programs that do stay are  referred  to  with  the  abbrevation  TSR:
  285. Terminate  and  Stay  Resident.  Examples  of   such   programs   are
  286. printerbuffers and RAMdisks. But one can think other applications  as
  287. well, like a calculator or a calendar that can be  activated  with  a
  288. single keypress.
  289.   In the past TSR's for MSX have been quite  rare.  The  problem  was
  290. that the memory the TSR uses can be used by other programs  as  well.
  291. There are no possibilities in a standard  MSX  machine  to  reseve  a
  292. piece of memory for a TSR. This  problam  is  eliminated  by  MemMan.
  293. MemMan administers the memory and prevents memory conflicts.
  294.   Thanks to MemMan it is possible to have more than one  TSR  in  the
  295. memory at the same time, where each TSR can be up to 16 kB  in  size.
  296. On a standard MSX loading more than one TSR is  cumbersome  and  only
  297. possible if the TSR is not too big. With the introduction  of  MemMan
  298. the MSX gets better TSR  features  than  the  commonly  esteemed  PC.
  299. Moreover they are not inferior to the `Desktop Accesoires'  that  are
  300. used on the Macintosh and the Atari ST.
  301.   Two simple example TSR's are delivered with MemMan. They  don't  do
  302. anything usefull by they demonstrate the potentials of Terminate  and
  303. Stay Resident programs. The examples are CAPS.TSR and COLOR.TSR.  The
  304. first makes the Caps indicator blink, while  the  latter  causes  the
  305. Basic command CMD COLOR to swap the fore- and  background  color.  In
  306. the future more and more TSR's will  appear  with  possibilities  MSX
  307. users could only dream of untill recently.
  308.  
  309.  
  310. Loading TSR's
  311. -------------
  312.  
  313.   TSR programs can be recognized by the extension  of  the  filename;
  314. they end on .TSR. These files contain not only program code but  also
  315. all the information neccessary to install the TSR in the memory.
  316.   To load e.g. the demonstration TSR `CAPS' - that does  nothing  but
  317. making the Caps indicator blink - , one must type the following under
  318. MSX-DOS:
  319.  
  320. TL CAPS
  321.  
  322. Several TSR-filespecifications can be given sequentially. If MSX-DOS2
  323. is used, the subdirectory from where the TSR must be  loaded  can  be
  324. given as well. For instance using the following command one can  load
  325. the TSR `CAPS' and all TSR's with a name starting with `DEMO'.
  326.  
  327. TL CAPS DEMO*
  328.  
  329. `TL' means `TSR-Load', it is the program that load TSR's  and  places
  330. them in the memory. Under BASIC there is also a version  of  TSR-Load
  331. available, see the chapter on `MemMan BASIC-statements'.
  332.  
  333.   As soon TL has installed the TSR in the memory, the  program  shall
  334. become active.  In  the  example  above  that  means  that  the  Caps
  335. indicator will start to blink and that each keypress will switch  the
  336. casseterelais.
  337.   TL is a smart program. As long as there is space left in the MemMan
  338. segment TSR's will be placed there. Only if it is really  neccessary,
  339. a new segment will be  used.  E.g.  when  an  exceptionally  big  TSR
  340. program must be loaded. When after that a smaller one  is  loaded  TL
  341. will first check all existing MemMan segments  to  see  if  there  is
  342. space somewhere.  The  order  in  which  the  TSR  are  loaded,  will
  343. therefore have no influence on the amount of memory used.
  344.  
  345.   Under MSX-DOS2 TL will use the environment item `TL'  to  find  out
  346. where the TSR's are. Harddisk owner only need to put `SET TL=A:\TSRS'
  347. in their AUTOEXEC.BAT and all TSR's in de  subdirectory  A:\TSRS  are
  348. allways reachable for TL.  Supplying  the  path  is  than  no  longer
  349. neccessary.
  350.  
  351. Viewing TSR's
  352. -------------
  353.  
  354.   At all times it is possible to look which TSR's are active  in  the
  355. memory. That is why the  MemMan  package  contains  the  utility  TV,
  356. TSR-View. Using it is the simpicity itself; just type  the  following
  357. at the DOS prompt:
  358.  
  359. TV
  360.  
  361.   There will appear an overview of the active  TSR's,  complete  with
  362. their full names. These names must be unique for each  TSR,  en  will
  363. almost allways contain the initials of the programmer. This  name  is
  364. thus different from the filename! It is this full name - the TSR ID -
  365. that is necessary if a TSR must be removed from the memory.  Programs
  366. that cooperate with TSR's directly can use this name to check whether
  367. a TSR is in the memory.
  368.  
  369.   Behind the names of the TSR's TV mentions the segment in where they
  370. reside and which hooks are linked. The  last  is  only  important  to
  371. programmers. Knowing the segment where a TSR resides is also handsome
  372. in other cases. If all TSR's are removed from a segment, that segment
  373. will be released and can be used by other programs  again.  The  only
  374. exception is segment 0, that contains not only TSR's but also  a  big
  375. part of MemMan itself.
  376.  
  377.  
  378. Removing TSR's
  379. -------------
  380.  
  381.   As mentioned before it also possible to remove  TSR  programs  from
  382. the memory. The program needed is named TK, TSR-Kill. TK  takes  care
  383. of removing a TSR neatly. All  other  other  TSR  remain  working  as
  384. normal, if the TSR was the only one in a segment, that  segment  will
  385. be released for use by other applications
  386.   For instance to make the Caps indicator behave  normally  and  stop
  387. the blinking, one only needs to remove the TSR involved. You type the
  388. following to do this:
  389.  
  390. TK "MJVcapsblink"
  391.  
  392.   The full name of the TSR must be given between quotation marks. One
  393. can remove several TSR's with  one  command  by  entering  the  names
  394. sequentially. E.g:
  395.  
  396. TK "TSR name 1" "TSR name 2" "TSR name 3"
  397.  
  398. TSR-Kill can not only be used to release memory, but also  to  remove
  399. crashed TSR's from the memory. A TSR that, for any reason whatsoever,
  400. no longer functions well can often still be removed using  TK.  After
  401. that the TSR can be loaded again. Restarting  can  be  beneficial  to
  402. both normal programs and to TSR's.
  403.  
  404.  
  405. MemMan BASIC-statements
  406. -----------------------
  407.  
  408.   Starting from version  2.3  MemMan  contains  some  statements  and
  409. functions that can be used from MSX-BASIC. MemMan has  a  system  TSR
  410. for this, named "MST TsrUtils". This TSR has number 0 and can not  be
  411. removed by TSR-Kill. Below is a description of  the  available  BASIC
  412. instructions. The meaning of the used symbols is as follows:
  413.  
  414. []     Anything between square brackets may be left out.
  415. <>     Descriptions of arguments are between angular brackets.
  416. ()",   Round brackets must be typed, as well as punctuation and 
  417.        commas.
  418.  
  419.  
  420. Command:     TSR-Load
  421. Syntax:      CMD TL("<filename>",[T],[<N$>],[<F>])
  422. Type:        Statement
  423. Example:     CMD TL("PB")
  424.              CMD TL("ALARM",T,,A)
  425. Purpose:     Load a TSR-file into the memory.
  426.              <filename>   =Name of the TSR-file. Under MSX-DOS2
  427.                           a subdirectory may be given as well.
  428.              T            = Show the intro-text of the TSR.
  429.              <N$>         = Name of a string-variable in which the
  430.                             TSR ID-name wil be stored.
  431.              <F>          = Variable in which an error code  will  be
  432.                             stored.  If  this  variable  is   omitted
  433.                             standard basic  error  messages  will  be
  434.                             given in  case  of  loading  errors.  The
  435.                             error codes are as follows:
  436.  
  437.                             0 = TSR loaded succesfully
  438.                             1 = Installation aborted by the TSR
  439.                             2 = Structural error in TSR-file
  440.                             3 = TSR-table full
  441.                             4 = Hook-table full
  442.                             5 = No free MemMan segment
  443.                             6 = Not enough BASIC memory free
  444.  
  445.  
  446. Command:     TSR-Kill
  447. Syntax:      CMD TK("<TSR ID-name>")
  448. Type:        Statement
  449. Example:     CMD TK("MJV printbuf")
  450. Purpose:     Remove a TSR from the memory.
  451.              <TSR ID-Naam>. = Identification name of the  TSR  to  be
  452.                               removed. One can get this name by using
  453.                               TSR-View or Find TSR.
  454.  
  455.  
  456. Command:     TSR-View
  457. Syntax:      CMD TV
  458. Type:        Statement
  459. Purpose:     Show an overview with the ID-names of all active TSR's.
  460.  
  461.  
  462. Command:     Find-TSR name
  463. Syntax:      ATTR$ FT("<TSR ID-name>")
  464. Type:        Function
  465. Example:     IF ATTR$ FT("CAPS") THEN CMD TK("CAPS")
  466. Purpose:     Return -1 if the given TSR is installed and 0 otherwise. 
  467.              <TSR ID-Name>  =Identification name of the TSR.
  468.  
  469.  
  470. Command:     Find-TSR number
  471. Syntax:      ATTR$ FT(<TSR number>)
  472. Type:        Function
  473. Example:     N$ = ATTR$ FT(0)
  474. Purpose:     Give the ID-Name of the TSR with the  given  number.  If
  475.              the number is greater than the number of  active  TSR's,
  476.              an empty string with length 0 is returned. 
  477.  
  478.  
  479. Command:     Help
  480. Syntax:      CMD HELP
  481. Type:        Statement
  482. Example:     CMD HELP
  483. Purpose:     Give information on screen about all the  present  TSR's
  484.              that support CMD HELP. This includes  in  any  case  the
  485.              allways present TSR `MST TsrUtils' and e.g. the  Tracer.
  486.              (For  programmers:  See  `hints   and   directions   for
  487.              programmers' in MM24SPEC.ENG.)
  488.  
  489. ** End **
  490.