MEMORY MANAGEMENT MS-DOS Kermit, like any DOS or Windows program, is likely to misbehave if your PC memory is insufficient or is incorrectly configured. MS-DOS Kermit runs in conventional memory (the first 640K) of your PC. It occupies about 280K initially, and then allocates additional memory as needed for rollback screens, file-transfer packet buffers, etc. Kermit uses additional memory to execute certain commands such as TYPE and DIRECTORY, for which it invokes a second copy of COMMAND.COM (appoximately 30K) in conventional memory, as well as RUN, which can invoke not only COMMAND.COM, but an additional program to be run by COMMAND.COM, for example "run edit". If there is insufficient memory, these operations will not work; thus it is always best to have as much free conventional memory as possible. Memory for file-transfer packets is allocated at the time the transfer begins, based on the current sliding-window size (SET WINDOW) and packet-length (SET RECEIVE PACKET-LENGTH), and is deallocated when the transfer ends. So SHOW MEMORY won't reveal the effect of the packet buffers. If insufficient memory is available for the requested window size and packet length, MS-DOS Kermit automatically reduces its RECEIVE PACKET-LENGTH. Conventional memory is always used for packet buffers. Thus packet buffers and RUN/PUSH/TYPE/ DIRECTORY commands "time-share" the same conventional memory. Memory for graphics screens is taken from your video display adapter. Storage of graphics images in the video adapter's on-board memory allows rapid switching between text and graphics screens provided (a) your video has sufficient memory, (b) the memory is not "mapped away", and (c) you are not running Kermit under Windows. Memory for rollback screens is allocated when the CONNECT command is first given, i.e. when Kermit first displays its terminal emulation window, and remains allocated until you EXIT from Kermit. This can be demonstrated by starting Kermit, giving the command SHOW MEMORY, then giving the CONNECT command, then escaping back (Alt-x), and then giving the SHOW MEMORY command again -- see how available memory has shrunk. Approximately 4K is required per 24x80 rollback screen (more for bigger screens). The default number of rollback screens is 10, but the number can be set to practically any value at all (0 or greater) by giving the following command to DOS before you start Kermit (interactively, or in your AUTOEXEC.BAT file): SET KERMIT=ROLLBACK 40 The smaller the number, the less memory required; the bigger, the more memory. In version 3.13, you can also give the new command: SET ROLLBACK at the MS-Kermit prompt at any time, and the rollback memory will be adjusted when you next CONNECT. A large number of rollback screens can crowd out other possibilities, like the ability to use Kermit's RUN, PUSH, TYPE, DIRECTORY, and other commands that run inferior processes. Version 3.13 of MS-DOS Kermit lets you store your rollback screens in Expanded Memory (EMS) if you have more than 1MB of physical memory and you have an expanded memory manager for it like Quarterdeck QEMM or EMM386 and HIMEM that come with DOS 5.0 and Windows 3.1. Using expanded memory for rollback screens frees 40K of conventional memory if you are using the default number (10) of rollback screens, and it also allows you to have a much larger number of rollback screens. The following steps are required to keep your rollback screens in expanded memory: 1. Make sure the desired amount of expanded (EMS) (not "extended", or XMS) memory is available. The DOS MEM command will tell you this. 2. In your AUTOEXEC.BAT file, set the desired number of Kermit rollback screens. For example, for 250 screens (requiring about 1 megabyte): SET KERMIT=ROLLBACK 250 3. Give the following command to MS-DOS Kermit: SET TERMINAL EXPANDED-MEMORY ON If this command fails, Kermit prints an appropriate error message. Now start a Kermit session, scroll some text off the screen during CONNECT mode, and check the operation of the PageUp/PageDown keys. If they work, you're done. And as an added benefit, graphics screens will also be stored in expanded memory, allowing you to switch between graphics and text screens (Alt-minus), even under Windows, without losing the graphics screen. If it doesn't work, then welcome to the bewildering world of DOS memory management. The most common symptom of a bad memory configuration is that your PC will freeze the first time Kermit tries to scroll a line off the screen or the first time it tries to clear the screen. Now you should begin looking at your CONFIG.SYS file. First, here is a straightforward DOS 5.0 CONFIG.SYS configuration that sets up a PC with 8MB of memory to have 6MB of expanded memory: DEVICE=C:\DOS\HIMEM.SYS DEVICE=C:\DOS\EMM386.EXE 6144 RAM DOS=HIGH,UMB DEVICEHIGH=C:\DOS\ANSI.SYS HIMEM.SYS must be loaded first and then EMM386. With memory management now active, DOS is told to use "high memory" (don't ask) and "upper memory blocks" (UMB, the space between 640K and 1MB) and then ANSI.SYS is loaded into the upper memory area rather than conventional memory. EMM386 is asked to take care of 6144K of expanded (EMS) (not extended, XMS) memory, and the RAM switch means that it also should manage the upper memory blocks. This configuration works on a PC that has 8MB of memory (6144K = 6MB = 1024 x 6), leaving 1MB of extended memory for any process that might need it. If you have less memory than that, adjust as appropriate. If you are using RAMDRIVE.SYS, give it the /A switch to use expAnded memory, rather than the /E switch for extEnded memory, e.g.: DEVICEHIGH=C:\WINDOWS\RAMDRIVE.SYS 1024 512 64 /A After making these changes to CONFIG.SYS, reboot your PC and give a DOS MEM command to check that the needed amount of Expanded (EMS) memory is available. Now run Kermit and check the expanded-memory rollback feature. Also tell Kermit to SHOW MEMORY to see how much conventional memory remains after starting Kermit. If it's not enough for your purposes, look at your CONFIG.SYS and AUTOEXEC.BAT files to see if there are any other drivers or TSRs that can be removed or loaded high. Here's another hint: If you access a CD-ROM drive via Microsoft CD Extensions, include the /E switch (Expanded) when you start it up: C:\BIN\MSCDEX /E /D:MSCD000 /M:10 In a more complicated configuration, suppose you have a network interface board that uses a certain segment of memory (at, for example, segment address CC00) which conflicts with DOS's memory management (note: addresses are usually written in hexadecimal). In that case, you have to tell EMM386 to "exclude" this segment from its memory managing: DEVICE=C:\DOS\EMM386.EXE 6144 x=cc00-cc7f RAM These segment address numbers are obtained from the technical manual for your network interface board (or, perhaps more likely, from the board vendor's technical support phone number). Additional "exclude" clauses might be needed for other boards or adapters. For debugging, get additional information about your PC's memory layout using the DOS MEM/C and MEM/P commands, the MSD program that comes with Microsoft Windows, or the MFT (Manifest) program that comes with Quarterdeck QEMM. If all else fails, tell Kermit to SET TERMINAL EXPANDED-MEMORY OFF (this is the default anyway). NOTE: whenever you switch Kermit's expanded memory status from OFF to ON or vice versa, your previous rollback screens are lost. Use caution with QEMM v6 "Stealth (ST:M) optimization". This prevents Kermit from accessing your video board's BIOS memory and finding the video board's signature, and therefore from determining the appropriate method for switching between 80 and 132 columns. Most boards have a signature string within the first 200h bytes of the video BIOS and excluding that much from stealth mode should be sufficient to preserve the identification information. .