ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ XMS Control Center ³ ³ Version 1.0 ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ Developed by Tanescu A. Horatiu (C) 1997 XMS Control Center may be freely copied and/or distributed for private use as long as it remains a complete unaltered package and is not sold for profit. Inclusion in any other software or hardware packages must first be authorized by Tanescu A. Horatiu. If you find XMS Control Center a useful tool in your work, a money contribution would be appreciated. Your contribution helps me continue the development of freeware programs like XMS Control Center. Contact me at my e-mail address ( alpha@lego.soroscj.ro ) for more information. TABLE OF CONTENTS 1. INTRODUCTION 2. SYSTEM REQUIREMENTS 3. USING XMS CONTROL CENTER INTERACTIVE MODE COMMAND-LINE MODE 4. HYMEM.SYS v XMS CALLS 5. MODIFYING EXTENDED MEMORY BLOCKS 6. TECHNICAL INFORMATION 7. CONTACTING THE AUTHOR 8. FUTURE PLANS 1. INTRODUCTION Extended memory is RAM above the 1-Megabyte boundary, and is available only on machines that have a 286 or greater CPU. In order for most applications to be able to use extended memory, an XMS driver must be installed to manage it. The most popular XMS driver is HIMEM.SYS from Microsoft. A DOS application can access extended memory even when running in a DOS shell under Windows 3.x or under Windows 95. XMS Control Center displays the current setup of your eXtended Memory Manager (XMM) and allows you to change the layout of extended memory by modifying the currently allocated Extended Memory Blocks (EMBs). When a program allocates a block of extended memory it receives a handle to that block and the handle is used in all operations with the block. XMS Control Center is able to display information about each block currently allocated: its handle, size, linear address and lock count. More important, XMS Control Center allows you to free, lock, unlock and reallocate any allocated extended memory block or to allocate a new one. 2. SYSTEM REQUIREMENTS In order to run XMS Control Center you will need a 286 or later CPU with extended memory and an XMS driver that implements the Extended Memory Specification version 2.0 or above installed in your system. 3. USING XMS CONTROL CENTER INTERACTIVE MODE XMS Control Center enters interactive mode if you call it without any parameter in the command-line or only with the /XMS switch. (See HIMEM.SYS v XMS CALLS for information about the /XMS switch) The XMS Control Center interactive interface was designed to be as self-explanatory as possible. On the main screen there are two opened windows: one that contains the list of the currently allocated extended memory blocks (EMBs) and one that displays information about the XMS driver and extended memory statistics. The status line located at the bottom of the EMBs window lists the function key commands. F2 Free - Frees the highlighted EMB from the EMB list box. F3 Lock - Locks the highlighted EMB from the EMB list box. F4 Unlock - Unlocks the highlighted EMB from the EMB list box. F5 Reallocate - Reallocates the highlighted EMB from the EMB list box. F6 Allocate new block - Allocates a new EMB. Press F10 to end the program. COMMAND-LINE MODE Use XMSCC/? for help. To print an XMS summary to the standard output call XMS Control Center with the following syntax: XMSCC /P [/XMS]. The summary is made up of information about the XMS driver and extended memory statistics and the list of all currently allocated extended memory blocks. You can redirect the output to a file or printer. (See HIMEM.SYS v XMS CALLS for information about the /XMS switch) To modify the currently allocated extended memory blocks use the following syntax: XMSCC [/F] [/L] [/U] [/R,] [/A] /F Free the extended memory block (EMB) addressed by handle. /L Lock the EMB addressed by handle. /U Unlock the EMB addressed by handle. /R, Reallocate the EMB addressed by handle. Ksize is the new size of the block in K-bytes. /A Allocate a new EMB of Ksize K-bytes. You can do more than one change with only one command-line. Example: XMSCC /F43202 /R43212,77, /L43242, /A0 This will free the EMB addressed by handle 43202, reallocate the EMB addressed by handle 43212 to 77 K-bytes, lock the EMB addressed by handle 43242 and allocate a new EMB of 0 K-bytes (use this to reserve a handle). 4. HIMEM.SYS v XMS CALLS By default, if HIMEM.SYS version 3.09 or above is detected XMS Control Center will retrieve information about extended memory blocks directly from HIMEM.SYS. When using HIMEM.SYS XMS Control Center will list not only the currently allocated extended memory blocks but also the free ones (the ones that are currently not used). As HIMEM.SYS is an XMS driver that has a fixed number of extended memory handles, the free handles in the system will also be displayed. If a previous version of HIMEM.SYS or other XMS driver is detected the information will be retrieved using XMS calls. This method is slower and will list only the currently allocated extended memory blocks. Use the /XMS switch to force XMS Control Center to use the second method (XMS calls) even if HIMEM.SYS version 3.09 or above is detected. Note: HIMEM.SYS version 3.09 is a part of MS-DOS 6.00. 5. MODIFYING EXTENDED MEMORY BLOCKS Modifying extended memory blocks used by other applications is generally NOT a very good idea. Modifying (freeing, reallocating) the wrong block may lead the system into an unstable state and may even damage files on your disk! Remember, many disk cache utilities use extended memory. Other programs could do a lot of damage as well if you mess with their allocated blocks. The main purpose of the free function of XMS Control Center is to help you free EMBs that were not freed by their owner program when it ended (programs that crashed and did not clean after themselves or programs that you are developing). Also use the reallocation function with care. If you reallocate an extended memory block to a smaller size than the old block's size, all data at the upper end of the old block WILL BE LOST. With XMS drivers that have a fixed number of extended memory handles (like HIMEM.SYS) you can reserve a handle by allocating a block of 0 K-bytes. 6. TECHNICAL INFORMATION EXIT CODES XMS Control Center will return the following result codes after execution: 0. Normal 1. No XMS driver was found 2. A VDISK device was detected. VDISK devices are incompatible with XMS drivers. 3. Out of memory (if the information about extended memory blocks is larger than the available memory - a very extreme case, unlikely to appear) XMS Control Center was written using the XMS Interface for Borland C/C++ and Borland Pascal (XMSBCP) Version 1.1 (freeware) developed by Tanescu A. Horatiu. This library is available by anonymous ftp from simtel (msdos/pgmutl/xmsbcp11.zip). XMS Control Center has been tested under MS-DOS 5.0, 6.00, 6.2, 6.22, Microsoft Windows 3.1, Microsoft Windows 95 with HIMEM.SYS. 7. CONTACTING THE AUTHOR You can contact me at my e-mail address (alpha@lego.soroscj.ro). Feel free to send comments, suggest enhancements, report problems or incompatibilities. If you are using other eXtended Memory Manager than HIMEM.SYS and you'd like XMS Control Center to support it directly, contact me. 8. FUTURE PLANS An advanced feature of viewing/editing extended memory. The possibility of customizing XMS Control Center (colors, confirmations, etc.) DISCLAIMER All software and documentation associated with XMS Control Center is provided "as is": ie., it is provided without warranty of any kind, not even an implied warranty of merchantability or fitness for any purpose. I will in no way be held liable for any loss of profit or any other commercial damage including but not limited to special, incidental, consequential or other damages from use of this software.