home *** CD-ROM | disk | FTP | other *** search
- **********************************************************************
- MULTICNF.SYS v2.1
- multi configuration program
- **********************************************************************
- (C) 1990 Tero Pelander.
-
- You can distribute this utility when
- following conditions are met:
- - The program is not modified in any way
- - You ask no contribution from the receiver
- of this program.
-
-
-
- ***** Description *****
- This program enables one to use 3 different CONFIG.SYS and AUTOEXEC.BAT
- configurations. These configurations can be selected at boot-time by
- pressing a specific key.
-
-
-
- ***** Usage *****
- The MULTICNF.SYS file should be the first line in the CONFIG.SYS file,
- and the CONFIG.SYS file must contain four lines starting with
- "device=--------".
-
- Usage: device=MULTICNF.SYS xx /T /N /R /Ox
-
- Explanations:
- xx - wait time in seconds 0 - 60
- - This is the time that program will wait for a responce from the keyboard.
- - If the time is 0 none of the texts (see /T below) are writen on the
- screen unless one of the selection keys is pressed.
- - The default wait time is 10s.
- - This should be the first option.
-
- /T - Text lines follow
- - This option allows the user to display instructions on the screen.
- Any line following that begins with "device=text " will be displayed.
- Note however that only the text that follows "device=text " will
- be displayed, also note the trailing two blanks.
-
- e.g. device = text Press shift key for max available memory
- DEVICE=TEXT Press alt key for min memory but most tsr programs
- ...
- - Depending on the MS-DOS version you should leave one or two spaces behind
- the word TEXT before you start your own text.
- - Currently all text will be converted to uppercase (by MS-DOS).
- - If wait time is 0 none of the texts will be printed. However, you should
- still leave the /T option to suppress any warnings about device=text lines.
-
- /N - No prompt
- - The line "Press SHIFT, ALT or CTRL." won't be printed
-
- /R - Remove comments
- - You may want to include explanations in your config.sys starting with the
- REM command. Ms-dos versions before 4.0 don't understand that command
- and will print "Unrecognized command". Including this option will suppress
- all "Unrecognized command" warnings but warnings like
- "Unable to find ANSI.SYS driver" are printed. Note the /O option below.
-
- /Ox - Force the ms-dos version
- - The program automaticly detects what MS-DOS version it is using but
- you can force it to use different settings.
-
- Where x=:
- 0 or null
- - assume ms-dos 4.0 or greater (the default)
- 1
- - assume ms-dos before 3.3 - Note this leaves a small part of code
- in memory and does not use the empty line mark (see below),
- 2
- - assume ms-dos 3.3x - also does not use the empty line mark.
-
- Empty line mark
- - Ms-dos versons before 4.0 do not count lines in config.sys and do
- not have an "empty line" mark. Therefor when multicnf processes
- config.sys it uses the "unrecognized command" mark to revise
- config.sys in memory for later processing. This will produce
- an "unrecognized command" at the end of config.sys. The /R option
- does not remove this behaviour. NOTE see technical information below
- for more details.
-
- Example of the first line in CONFIG.SYS for MS-DOS v3.2:
- DEVICE=C:\MULTICNF.SYS 15 /R
-
- Example of the first line in CONFIG.SYS for MS-DOS v4.0:
- device=c:\multicnf.sys 15
-
-
-
- ***** Selecting the boot configuration *****
- When you boot your machine with MULTICNF, it will print it's acknowledgments,
- any text you have specified and asks you to press SHIFT, ALT or CTRL.
- One of these keys can already be depressed when the program executes. If none
- of the keys are pressed in a preset time (see xx above), then configuration
- one (as if a SHIFT were pressed) is selected. Therefore, the first
- configuration is considered to be "the normal one".
-
-
-
- ***** Creating multiple configurations *****
- All three configurations must be in CONFIG.SYS, separated by lines that
- begin with "DEVICE=--------" (8 minuses). The part between the first line
- (which loads MULTICNF) and the first separator (device=--------) is always
- executed. The part from the first separator to second is executed when
- the normal/SHIFT configuration is selected, and so on (see the example below).
-
- You can include comments to the end of separator line by first putting
- a space after "device=------".
-
- You can put commands after the last separator line but the results are
- a bit messy. Ms-dos versions 2.11 -3.x will give the warning
- "Unrecognized command" before the commands after the last "device=--------"
- line is executed. Version 4.x users will get invalid line numbers when an
- error is detected on such a line, usually around 100 - 500 depending on how
- many device=text lines there are.
-
- An example of config.sys (without the actual CONFIG commands.)
-
- DEVICE=C:\DOS\DRV\MULTICNF.SYS 15 /T
- <if you use option /T, device=text lines are placed here>
- <commands in here are always executed>
- DEVICE=-------- <comment here>
- <commands in here are executed when nothing or SHIFT is pressed>
- DEVICE=-------- <comment here>
- <commands in here are executed when ALT is pressed>
- DEVICE=-------- <comment here>
- <commands in here are executed when CTRL is pressed>
- DEVICE=-------- <comment here>
-
-
-
- ***** Detecting errors in config.sys *****
- An error will be reported if any line (even within a part that doesn't get
- executed) has a command that MS-DOS doesn't understand and you haven't used
- the /R option.
-
- MS-DOS version 4.0 always reports the line number with the error. Lines
- correspond directly to the config.sys file. However, out of range line numbers
- will result from adding command(s) after the last "device=--------" line.
-
- If you are using the /O1 or /O2 option or you are using ms-dos version 3.3 or
- older you will always get an extra "Unrecognized command" warning at the end
- of config.sys.
-
-
-
- ***** Using multiple AUTOEXEC.BATs *****
- The MULTICNF.SYS program doesn't change AUTOEXEC.BAT in any way regardless
- of the key pressed when booting. The way you can use multiple AUTOEXECs when
- booting, is by using the other program included: MULTIRET.COM. It returns an
- ERRORLEVEL depending on the key pressed during boot.
- as follows:
-
- 0 - no key was pressed at boot time.
- 1 - SHIFT was pressed
- 2 - ALT was pressed
- 3 - CTRL was pressed
-
- The following example shows a way of doing this. The example just
- echoes the key combination the machine was booted with, but of course you
- can put anything you want in place of the echoes.
-
- @echo off
- rem @ as the first mark on the line turn echo off for one line only
- rem on MS-DOS version 3.3 and later
- multiret
- if errorlevel 3 goto CNF3
- if errorlevel 2 goto CNF2
- if errorlevel 1 goto CNF1
- echo No key was pressed
- :CNF1
- echo Started with config 1, SHIFT/none was pressed
- goto END
- :CNF2
- echo Started with config 2, ALT was pressed
- goto END
- :CNF3
- echo Started with config 3, CTRL was pressed
- :END
-
-
-
- ***** Technical information *****
- During boot, after MS-DOS has been loaded the CONFIG.SYS file is decoded to
- memory. When a device (e.g. MULTICNF.SYS) is executed for the first time it is
- given a pointer to this decoded information of CONFIG.SYS in memory.
-
- This program makes changes to the information and after it has finished it
- tells MS-DOS that it couldn't install itself properly. MS-DOS releases
- the memory and executes the next command in this changed information.
- MS-DOS versions before 3.3 can't properly dechain the device driver so a
- small part (48 bytes) of the program is left in the memory.
-
- There is no way of knowing where the end of the decoded information is so
- the user must supply the info by a "device=--------" line. Because of the way
- multicnf patches the decoded info this is the place where anomalies get
- grouped. On MS-DOS versions 2.11 - 3.x the unwanted lines are writen over
- by later config.sys lines and at the end an "unrecognized command" line is
- used to fill up the space.
-
- On MS-DOS version 4.0 and later it is possible to use an "empty line" mark.
- Every line that is removed is replaced by an "empty line" mark. Because
- this is only one byte long the rest of data has to be moved forward.
- The end of the decoded config.sys area is filled with "empty line" marks.
- This is why line numbers on an error that is after the last "device=--------"
- line are totally wrong. Usually the line number can be 50 to 500 too large.
-
- The program has been tested on MS-DOS versions 2.11, 3.2, 3.3 and 4.0.
-
-
-
- ***** Version history *****
- 1.0 First releace by Sami Tammilehto
- 2.0 completely rewritten by a new author
- added all options, wait time is no longer needed on config.sys,
- added support for ms-dos 4.0
- 2.1 fixed a bug: time zero and no key pressed
- dos timer is no longer modified
- commands behind last device=-------- line allowed
- (--) (document rewriten by Ted Medin)
-
- I hope you have use of this utility. If you find any bugs, are intrested
- in the source code or think of some enchantments contact me.
-
- Internet: tpelander@kontu.utu.fi (130.232.2.1)
- Bitnet: tpelander@FIRIEN
- Post: Tero Pelander
- TOP-keskus
- Torninkatu
- 20100 Turku
- Finland
-