From: "Matthias Paul" Organization: Rechenzentrum RWTH Aachen To: opendos AT delorie DOT com Date: Wed, 22 Nov 2000 17:08:41 +0100 Subject: Optimizing CONFIG.SYS... X-mailer: Pegasus Mail v3.22 Message-ID: <819A5186A6F@reze-1.rz.rwth-aachen.de> Reply-To: opendos AT delorie DOT com > This was sent several times since 25 Aug 2000, but has always > been rejected by the list server until DJ Delorie informed me > why this happened... Thanks, DJ! ;-) > Well, I know it's completely out of context now, but hopefully > it may still be useful for some of you. Hi, Since Florian has sent an example CONFIG.SYS file and it has been quite a while since the last time we studied a CONFIG.SYS example, I'll take the opportunity to optimize it a little. I only apply general purpose optimization, nothing special for use with LFN or MP3. Not everything may apply to all systems. Hope this is still useful to some of you (especially those who might be new to DR-DOS and this list) - if not, just skip this posting... Matthias > [common] I would move this directive down to the end of the CONFIG.SYS file. > DEVICE=C:\DRDOS\EMM386.EXE MULTI DPMI=ON FRAME=NONE VIDEO Some of you may try FRAME=E800 USE=E800-F7FF to enable a 64 Kb EMS-page frame by loosing only 32 Kb of UMB address space for it. This works on the majority of 386 - Pentiums clones, however, brand name machines and more recent machines may use the address space F000-F7FF for other purposes than the machine's CMOS SETUP program, so it may not work any more on these machines. At a slight performance hit NWCDEX, SDRES (Novell DOS 7 only), (and sometimes NWCACHE) are good candidates for using EMS to reduce the real-mode memory footprint even below the footprint needed in conjunction with DPMS. For example, NWCDEX just takes ca. 900 bytes conventional memory when using EMS. > DEVICE=C:\DRDOS\DPMS.EXE > DOS=HIGH,UMB, HIGH ??? DOS=HIGH,UMB > TIMEOUT=5,Y,2 > YESCHAR=Y YESCHAR=Y REM YESCHAR=J might be preferable in German speaking countries TIMEOUT=5,YESCHAR,2 Syntax: TIMEOUT=, , Since DR-DOS 7.02+ you can omit some of the parameters, e.g. TIMEOUT=,,3 would only change the [DR]SWITCH= answer. While they all supported these three arguments (which is undocumented), this enhanced syntax was not supported with earlier issues. Using the special tokens YESCHAR or NOCHAR instead of an actual Y/N character will take the currently defined Yes or No characters as set up by the YESCHAR= or NOCHAR= directives, so that they don't get out of sync so easily. Once they are synchronized, changing the YESCHAR= or NOCHAR= values will implicitly change the TIMEOUT= answers as well. This helps multi-language menu systems and CONFIG.SYS file tracing. (These additions are available since DR-DOS 7.02+.) > rem DEVICEHIGH=D:\MTM\MTMCDAI.SYS /D:MTMIDE01 > DEVICEHIGH=D:\cdromdrv\atapicd.sys /D:MTMIDE02 > FILES=160 This is a very high value seldomly needed! I usually use FILES=60 even when using the multitasker (FILES=60 is also sufficient for all the issues of NewDeal since a few years). To load all but 8 handles into UMBs, use FILESHIGH=60 instead. Of course, HIFILES works, too. > FASTOPEN=2024 I usually use FASTOPEN=0, but in some cases Florian's setting may increase performance. > LASTDRIVE=30 Probably OK for networked systems (the maximum is 32, BTW.), but the commonly used maximum is LASTDRIVE=Z (26). Mind that each extra slot in the Current Directory Structure (CDS) takes up memory. > DEVICE=C:\DRDOS\SETVER.EXE To save memory, it might be useful to delete all the pre-defined SETVER entries not needed (run SETVER /? from the prompt to get help on how to achieve this), or completely remove the driver from CONFIG.SYS when not needed by applications. The SETVER list can also be loaded high using DEVICEHIGH=. > BREAK=OFF > BUFFERS=100 This value is way too large for a system also using NWCACHE. Due to the overhead of double buffering, too high values may even reduce performance. However, it is also too large to still fit the buffers into the HMA. I would try BUFFERS=10..30 depending on how much space is left in the HMA. If MEM /F does not list BUFFERS, reduce the value until they show up in the HMA. However, BUFFERS=3..10 should be sufficient on systems using NWCACHE (floppy disk access sometimes seems to be faster with larger buffer values, that is 10..26). > FCBS=8,8 The second argument is not parsed by DR-DOS, and since under DR-DOS FILES and FCBS are dynamically maintained from the same pool of available file handles (MEM /A - search for HANDLES=), FCBS=4 or FCBS=1 is usually sufficient. FCBSHIGH= alias HIFCBS= directives are also available since DR-DOS 7.02+, but using one of the 4 high-variants of FILES or FCBS will move all but 8 handles into UMBs (given enough space in there), even if omitting the high-syntax with the other directives. So, FCBS= or FCBSHIGH= is don't care here, as we already used FILESHIGH= above. (Note, that you need at least 5 *unopened* file handles in low memory for Windows 3.xx to run. This is due to a extremly dirty hack in Windows' startup code, known as "CON: CON: CON: CON: CON:" thing. To detect the size of internal data structures, it opens CON: five times and then scans through the conventional memory searching for the "CON:" pattern. The displacements between these strings are assumed to be the size of the entries... (See Andrew Schulman's et al "Undocumented DOS" 2nd edition for details). So, if you load high handles and Windows 3.xx refuses to start, check that you have 5 *free* handles in low memory - some TSRs may leave orphanted handles when loaded like TSR > \dev\nul.) > HISTORY=ON,512,ON > YEAR2000=ON > DEVICEHIGH=c:\drdos\NWCACHE.exe 7670 7670 /LEND=OFF /DELAY=OFF ... > ... /FLUSH=OFF I would use: VERIFY off DEVICEHIGH=... /LEND=ON /DELAY=5000 /FLUSH=ON instead, but this depends on purpose and taste, of course. > DEVICEHIGH=d:\VIBRA16\DRV\VIBRA16.SYS /UNIT=0 /BLASTER=A:220 I:5 ... > ... D:1 H:5 > DEVICEHIGH=C:\DRDOS\DISPLAY.SYS CON=(EGA,,1) > DEVICEHIGH=C:\DRDOS\ANSI.SYS Some ANSI-drivers must be loaded before the DISPLAY.SYS driver (this does not seem to apply to the DR-DOS ANSI driver, though). > COUNTRY=43,,C:\DRDOS\COUNTRY.SYS With the introduction of the Eurocurrency "EUR", some of the DR-DOS users in EU countries may try the new 21nnn variant of their traditional nnn country code (21043 for Austria, here). In case of compatiblity problems with some applications, the alternative code 11nnn may be used instead. US, UK, and German users may also like to switch over to the ISO 28601/ISO 8601 date format [yy]yy-mm-dd as widely used in engineering and international correspondence (for example, DIN EN 28601 is mandantory in German offices since May 1996). They can so by choosing codes 20001, 20044, or 20049 (or alternatively 10001, 10044, or 10049 in case of compatibility problems with applications not supporting country codes above 999). > devicehigh=d:\vibra16\drv\vibra16.sys > devicehigh=d:\vibra16\drv\ctmmsys.sys > > INSTALLHIGH=c:\drdos\SHARE.EXE /L:1400 /V /F:10000 I usually use SHARE /L:60 which has served me well over the years. Takes much less memory and loads into the HMA. > INSTALLHIGH=c:\drdos\keyb.com gr+ > > INSTALLHIGH=e:\qmouse\ctmouse.com > rem INSTALLHIGH=c:\drdos\print.com /D:LPT1 > INSTALLHIGH=c:\drdos\NLSFUNC.EXE C:\DRDOS\COUNTRY.SYS /X /V While this is usually don't care since there's enough space left in the HMA, it is only necessary to include the XSCAN module, if a MS-DOS style COUNTRY.SYS file is about to be used (this also includes files provided by PC DOS, PTS-DOS, OS/2, and NT, while the Multiuser DOS family uses a variant of the DR DOS style format and therefore does not require XSCAN to be loaded, it only requires NLSFUNC 4.00+). NLSFUNC will in most cases detect this automatically, and adapt and auto-load the XSCAN module by examining the format of the given file, so even then /X switch is usually not required. This option is needed, when the filespec given with NLSFUNC (or - if no filespec given with NLSFUNC - the filespec which was given with COUNTRY=) is not available at the time NLSFUNC loads (e.g. if located on a network drive), and only if this filespec may be a MS-DOS style file. Since this is not the case here nor with Florian's CONFIG.SYS COUNTRY=..., forcing NLSFUNC to load XSCAN is just wastage of memory. (Although it has added functionality it still takes a few KB less memory than the MS-DOS NLSFUNC implementation, though...) (This comment applies to NLSFUNC 4.00 (shipping with DR-DOS 7.02/7.03) only: Earlier issues didn't support XSCAN, and later issues will allow to dynamically redefine the filespec at runtime, so /X will also make sense in a number of other cases - however, NLSFUNC 4.01-4.07 are not yet publically available...) > INSTALLHIGH=d:\cd\cdptsr.com > INSTALLHIGH=c:\mach64\m64vbe.exe > INSTALLHIGH=e:\vibra16\mixerset.exe /P > INSTALLHIGH=c:\drdos\nwcdex.exe /D:MTMIDE02 Usually it is not possible to loadhigh NWCDEX in CONFIG.SYS. A possible solution to still achieve this is to use my INSTCDEX utility available from my web-page (see footer). > INSTALLHIGH=d:\MACH64\CUSTOM.COM > INSTALLHIGH=d:\VIBRA16\DIAGNOSE /S > DEVICEHIGH=e:\tdsk\tdsk.exe 5000 > rem DEVICE=e:\freekeyb\FreeKEYB.com > > echo = 1. FULL DR-DOS > echo = 2. SMART DR-DOS > echo = =Please choose= > switch FULL SMART > > SHELLHIGH=D:\4DOS\4DOS.COM D:\4DOS\ /E:32000 /P > ?"Do you want to execute the DR-DOS Shell?" SHELLHIGH=C:\DRDOS\COMMAND.COM C:\DRDOS\ /E:32000 /P:AUTODOS7.BAT I think there's some confusion regarding SHELLHIGH, probably because it is not documented. SHELLHIGH= works *identical* to SHELL=, except that it takes an optional extra argument SHELLHIGH [SIZE=hhhh] where hhhh is the hex-size of the amount of memory to be reserved in the HMA for the COMMAND.COM shell. SHELLHIGH= by itself does *not* load the shell high in any way. The 4DOS shell can be loaded into UMBs using 4DOS specific switches in the command line or 4DOS.INI, the primary DR-DOS COMMAND.COM can be loaded into the HMA using the /MH command line syntax. Since the shell is only loaded after CONFIG.SYS processing has finished and other HMA clients may have already taken up large portions of the HMA memory, DR-DOS reserves some space at the very beginning of the HMA to be later occupied by the resident portion of COMMAND.COM when it is loaded. When using a 3rd party shell like 4DOS, or not loading COMMAND.COM into the HMA, this space will remain free and available for use by other HMA clients, however, due to the pre-allocation of the space, the HMA segment will get fragmented by this, so that some HMA clients may not be able to use the HMA any more, although the total amount of all free HMA memory chunks in bytes would be sufficient. (This applies to COMMAND.COM as well, as it needs the memory in one continous chunk, too.) The resident size of COMMAND.COM varies from release to release (Novell DOS 7 and OpenDOS 7.01 COMMAND.COM took up ca. 5 Kb, whereas the LFN-enabled 7.02+ COMMAND.COM takes ca. 8 Kb - some newer issues even up to 9 Kb). Thanks the introduction of the SHELLHIGH SIZE parameter with DR-DOS 7.02+, it is now possible to control the amount of memory for this pre-allocation, so that by slightly increasing the hhhh value, a newer (larger) COMMAND.COM can still be loaded into the HMA on older systems (since DR-DOS 7.02+), or if COMMAND.COM is not loaded into the HMA at all (e.g. when using 4DOS), the pre-allocation can be reduced downto a minimum (SIZE=20) to avoid HMA fragmentation and leave more continous memory to the other clients. To find the minimum hhhh value that still allows COMMAND.COM to be loaded into the HMA, one should study the MEM /F outputs while playing with the hhhh parameter. The hhhh values can be compared with the size reported for the first free chunk in the HMA seen in MEM /F outputs. On more thing to know is that if multiple SHELL[HIGH]= directives are executed in CONFIG.SYS, the arguments of the last one will take effect. (There are a few exceptions and special cases regarding what can be considered as "being executed", e.g. when in F5/F7/F8 skip and single-stepping modes, but I guess they are off-topic here.) Things like: SHELLHIGH SIZE=20 SHELL=c:\drdos\command.com c:\drdos\ /MU /P do work. To break it all down, I would change the original setup above to something like: SHELL=c:\drdos\command.com c:\drdos\ /E:512 /MH /P:autodos7.bat TIMEOUT=,YESCHAR ?"Use 4DOS?" SHELLHIGH SIZE=20 d:\4dos\4dos.com d:\4dos\ /E:512 /P BTW. I have reduced the /E: size of the environment downto 512 bytes (instead of almost 32 Kb) to save 31,5 Kb of memory. I doubt anyone has ever used up 32 Kb of environment space. 512..1024 (maybe 2048 for advanced batchjob programming or network use) should be sufficient in 99.99% of the cases. Applying these changes to the example CONFIG.SYS should significantly free up memory in the given configuration (my estimate is between 50 and 100 Kb) - without any noticable backdraw (if there *were* any backdraws, please let me know). > exit > > :FULL > SET CONFIG=FULL > INSTALLHIGH=c:\drdos\DELWATCH.EXE C: /F:65534 /MBX > return > > :SMART > SET CONFIG=SMART > return Matthias ------------------------------------------------------------------- Matthias Paul, Ubierstrasse 28, D-50321 Bruehl, Germany eMail: Web : http://www.rhrz.uni-bonn.de/~uzs180/mpdokeng.html -------------------------------------------------------------------