:::::::::   ::::::::  :::::::::  ::::::::::
                        :+:    :+: :+:    :+: :+:    :+: :+:
                        +:+    +:+ +:+        +:+    +:+ +:+
                        +#++:++#+  +#++:++#++ +#++:++#:  :#::+::#
                        +#+    +#+        +#+ +#+    +#+ +#+
                        #+#    #+# #+#    #+# #+#    #+# #+#
                        #########   ########  ###    ### ###

              	             http://blacksun.box.sk
                           _____________________________
    ______________________I          Topic:             I_____________________
   \                      I                             I                    /
    \     HTML by:        I  Getting more control over  I   Written by:     /
    >                     I the WinDOS 9x / 7.x startup I                  <
   /      Martin L.       I_____________________________I  Freeshadow       \
  /___________________________>                    <_________________________\

Version: 1.0

A tutorial about tweaking and tuning the MSDOS.SYS, CONFIG.SYS and AUTOEXEC.BAT files. Get more control over your box, save memory and time and turn off functions you don't need.


CONTENTS:

  1. INTRO
    1. why am I speaking about WinDOS ?
    2. Do you need this DOS ?
    3. You have never seen this DOS before Windows ?
  2. OPTIMIZING THE MSDOS.SYS
    1. The [Options] section: Part 1
    2. The [Options] section: Part 2
    3. MSDOS.SYS demystified ?
  3. OPTIMIZING CONFIG.SYS & AUTOEXEC.BAT
    1. MENU-specific commands
    2. other CONFIG.SYS commands
    3. Multiple configuration inside the AUTOEXEC.BAT
    4. the sample configuration files
  4. Other Autoexecuted BATch files
  5. Final notes
  6. THE END (really)

1. INTRO

NOTE: sample configuration files included in the folder "\samples".

1.1. why am I speaking about WinDOS ?

Some of you may believe that the times Windows ( 3.x) has been put over a running DOS systems are over. Just assuming you're right - if there's no DOS anymore why do we have still the IO.SYS; MSDOS.SYS; CONFIG.SYS and AUTOEXEC.BAT in the root dir ?

Well, if you boot down to DOS-mode the VER command will repeat you have DOS 7.something running. So in fact there is no DOS-"mode" but PURE DOS still running on your box, even if the DOS-kernel has been slightly improved. The .something depend s on which version of Win you have: in win95A having no FAT32 support it is 7.0 later 7.1

Although this is a "startup" tutorial I will say nothing about things happening during the startup of the Windows-GUI (GraphicalUserInterface) or, to call it bluntly, your Desktop.
if you want to know about this, check your startup folder, the registry keys
"Run", RunOnce", "RunServices","RunServicesOnce" as well as the windows' .ini files
There are other good windows and registry tutorials on BSRF so I won't cut 'n' past other peoples work. Apart from that you can download a proggy to manipulate all this widespread settings from the BSRF site. I will just talk about what happens before Windows wakes up
Now at least the title of this tutorial should be clear.

1.2. Do you need this DOS ?

Yeah, you do. Believe me.
Let's say you have some oldie-but-goldie progs or games which don't work in the DOS-Box on your Desktop, but need DOS-Mode. So in standard cases you boot up the whole Windows, boot down to DOS again and finally start the proggy. Sounds silly ? Sure but, that's the way it happens. Even if you don't do all this steps manually but via link, it always happens, if the proggy needs pure DOS. So if you need this DOS, why boot the whole win-GUI up and down again if you can have it, BEFORE the GUI starts?

But even if you don't have any of such games or progs (you really miss some cool games) it is more than handy to have a working box when the win-based stuff crashes again. Just for emergency cases.

1.3. You have never seen this DOS before Windows ?

You might have seen it when something broke down, and after you rebooted a kind of boot menu offered you "command line only". When everything works well "Standard" is performed and windows loads the GUI automatically. It does a lot of things automatically and in most cases it is a waste of resources even if a minor one. Now it's time to tweak this settings and let the system do what YOU want.

2. OPTIMIZING THE MSDOS.SYS

The place where a nice bunch of settings is stored is the MSDOS.SYS file. In contrary to former DOS versions it is no longer a "system" file. the whole DOS-kernel is now in the IO.SYS. So the MSDOS.SYS has only two functions:

  1. carry the settings
  2. just be there

Just open the MSDOS.SYS with Notepad or another ASCII-editor. What you see is an ASCII file like the CONFIG.SYS containing two sections:

The 1st: "[Paths]" contains entries making Windows to know where it is. like that


[Paths]
HostWinBootDrv=C
WinBootDir=C:\WINDOWS
WinDir=C:\WINDOWS


The paths depend on which folder name you specified while installing windows, the above is default. It may also contain the entry
UninstallDir=
when you installed win9x over an existing DOS/win3.x system

The 2nd section called "[Options]" is much more interesting. I'll tell you about the options you have, but don't alter your MSDOS.SYS yet !!! As you shall have noticed I've prepared a folder with customizable template files, The settings of MSDOS.SYS are placed in WINBOOT.INI. If you put a WINBOOT.INI file in your root dir (C:\) the settings in this file override the ones in MSDOS.SYS. Using the INI file you can undo things easier by simply deleting it when something doesn't work.

The heap of seemingly useless comment lines filled with "x" shall be left as it is, because as you can read there, they assure that the MSDOS.SYS has its minimal assumed size, just for the sake of compatibility. ("just be there") As long as you don't change that, there won't be problems with antivirals and other proggys spreading panic around by telling you the file is infected by some kind of virus and probably killing it. If this would happen you'd be confronted with a bluescreen and win telling you it can't initialize the VFAT driver. But you should check whether there are some [Options] settings specified below this comment lines.

2.1. The [Options] section: Part 1

Some settings are set to their default values without being explicitly written in the MSDOS.SYS so if you read about changing the value "ExampleVal=1" to 0 but there's no ExampleVal entry in the file, just create the entry "ExampleVal=0" (of course WITHOUT " ") As you shall have noticed EVERY setting stands in a separate line. The values are 1/0 Boolean (Yes/No) variables or integer.

(excuse me when I'm boring you sometimes, I wanted this tutorial to be newbie-friendly, ok ?)

I've said already that Windows starts the GUI by default. You can change this by setting "BootGUI=0" now the bootup is finished after AUTOEXEC.BAT and you may stay in DOS or start windows with the command "win". (what else ?) like in win3.x-times.

Now some other settings concerning the default behavior of Windows briefly:

Set "Logo=0" it turns off the windows splash screen. I'd recommend this because it saves bootup time. Somebody (sorry, I've lost your e-mailadr.) posted at the BSRF board that the setting "Logow=0" turns off the shutdown screens although it causes an error msg (invalid line in the MSDOS.SYS). I just tell it for the sake of giving you all the facts i found, because there's no need to use this setting. You can simply delete the other logos. the files are LOGOS.SYS and LOGOW.SYS. In the 1st win95 versions there was a LOGO.SYS for the splash screen, so you could delete it too, but then the default logo was put into the IO.SYS so only "Logo=0" turns it off.

The LOGO.SYS can be 'animated' (you noticed the blue bars in the bottom line of the default logo ?) when you manipulate the palette of the pic, but I don't know exactly how. If you do then write about it or send me info.

As you can see a lot of Windows' .SYS files are not what they seem to be :-)

"LoadTop=1" means the COMMAND.COM will be loaded into high memory. Set it to 1, saves base mem; only if it causes unspecified memory problems set to 0.

"DisableLog=1" turns off logging every startup to C:\BOOTLOG.TXT. I turned the logs off because... yes guessed, saves time. and turn them only casually on when something screwed my box in order to check them for hints on the cause.

"DblSpace=" and "DrvSpace=" both by default set to 1 assure the auto-loading of the matching .BIN files needed to access Drives compressed with Double- or Drivespace. if you don't use this compression set both to 0.

I recommend NOT to use it, because it:

"DoubleBuffer=1" needed for some SCSI drives, is automatically available in Win, but the setting 1 is needed in DOS-mode. when you haven't turned double buffering on and the "dir" command returns only crap when you're in DOS you see you need it.

"SystemReg=", is by default set to 1. This setting makes the IO.SYS checking the registry for existing Hardware Profiles, and offering you a selection if any profiles exist. When you don't use Hardware Profiles set it to 0, but ONLY in this case! If you use this feature and turn the check off the win GUI 'll be the 1st one finding out that you HAVE defined profiles. This offers you a better-looking menu for choice, but is definitely TOO LATE for some hardware to be accessed properly. e.g. you find yourself sitting in front of a standard-VGA display. (or nothing works at all)

When win crushes it has the habit to start the text-based version of ScanDisk after reboot. It sometimes doesn't come along with the disk structure, because of the long file names so I recommend to turn this off with the entry
"AutoScan=0".

As you may have found out Windows offers you a boot menu you can access via the F-keys or when it crushed. This happens because the option "BootWarn=" is by default set to 1. If you set it to 0 (not recommended) Windows will not request what to do and after crash always reboot in 'safe mode'.
The 'safe mode'-boot itself is performed because the option "BootFailSafe=" has been set to 1. So better don't play around with those two. Honestly I don't know anybody who wants win ALWAYS boot in safe mode.

Because later I'll tell you how to make yourself a boot menu with your CONFIG.SYS & AUTOEXEC.BAT files I now have to take care you don't mix them up. So I will refer from now to the bootmenu Windows offers as winbootmenu, and to the one which I'll show you later how to customize AUTOEXEC.BAT and CONFIG.SYS as dosbootmenu, right ?

The appearance of the winbootmenu also depends on settings made in the MSDOS.SYS. because I wanted not to mix up general settings with those affecting only the menu I spared them up to tell you now about them. So even if there are no parts defined in the [Options] section, for better understanding I write now about:

2.2. The [Options] section: Part 2

You can set up the winbootmenu to appear at every startup by setting "BootMenu=1", it's off by default and I won't change it. You can also define whether it shall be accessible via the F-keys by the option "BootKeys=". If they are activated the option "BootDelay=" defines how long (in sec.) they appear.
NOTE: If "BootKeys=0" and "BootDelay=" is higher that 2 it'll be set down to 2.

"BootMenuDefault=" sets which selection is highlighted.
"BootMenuDelay=" defines in sec. how long the system waits before the highlighted option is automatically chosen.

How many options the winbootmenu offers is set by the following options.

The option "Network=1" will be set when you install networking stuff. this gives you the option "safe mode with Network" in the winbootmenu i.e. boot with network access via command line.

The option "BootMulti=" is or can be set to 1 if you installed win over an existing MS-DOS system. In this case you can boot "Previous MS-DOS version". via the menu or <F4> key. when you have old DOS sys files on disk. they all (autoexec.bat, config.sys, io.sys, msdos.sys, command.com) are renamed to .DOS. In contrary when the previous. DOS has been booted the matching Windows files get the extension .W95.
Be careful with it because using older DOS versions only has works if your hard disk is FAT16 formatted. !!! The trap is that if you have a FAT32-formatted HDD you won't get any warning. The system tries to boot the old DOS... and ends in a hang because the old DOS can't access the FAT of your hard disk.
You have then to boot from a win-system diskette access your hard disk and rename all .W95 files to their proper extensions.

The 1st win version offering FAT32-formatting is Win95 B. This is the reason why they only sold it as OEM-ver with new boxes, and not as upgrade. The M$ guys feared people may get the trouble with older DOSes I explained before.

Another option called "BootWin=" defines win as the default OS. this means when it's set to 1 (default) <F4> will boot DOS but after reboot Windows will boot again, acts as a switch FOR DOS. If "BootWin=" is 0 then the OS which was active when you shutdown your box, will boot AGAIN, here <F4> is a switch BETWEEN DOS AND WINDOWS.

Nevertheless even if you CAN use old DOS, you won't need it anymore, because now I'll show you how to customize the new one. Believe me and keep "BootMulti=0" and "BootWin=1"

2.3. MSDOS.SYS demystified ?

Although I told you now everything I could find out about this bloody file, there are still things I couldn't find out. I checked some printed and online sources for hints but they didn't knew either.
The option "Logow=1" shows us that settings may produce a reasonable result, regardless of the error message which appears. I know that there are options called: "SafeBootMenu=" and "WorkBoot=" (seen in the IO.SYS) no one could tell me what they are good for or if they work at all. They also may be waste-code from beta versions.
There might be even more... If you know something I haven't mentioned then mail me please ! [
Freeshadow@web.de]

3. OPTIMIZING CONFIG.SYS & AUTOEXEC.BAT

Now after we've successfully separated the Win and DOS components from each other it's time to customize the boot process giving you startup memory configurations. You may have heard of or even used a CONFIG.SYS / AUTOEXEC.BAT boot-menu, in MS-DOS 6.x. The possibility to use this is also available in the Windows 9x DOS 7.x - kernel.

If you have already had a PC in this times, you may know the method and think now "It's right, I know how to proceed", you are 90 % right, you could stop reading now and adapt your old startup files inf they survived somewhere, it would work. Nevertheless I'd ask you to continue to read because there are slightly improvements in the 7.x kernel which I'll point out. At least search for: "{new in DOS 7.x}"

Now you can see by which special commands this menu is created:

---sample CONFIG.SYS begin
NUMLOCK=ON
[MENU]
MENUITEM=config_name,displayed_name
SUBMENU=subconfig_name,sub_displayed_name
MENUITEM=config_name_2,displayed_name_2
more menuitems...

MENUCOLOR=text,background
MENUDEFAULT=config_name,wait_time

[subconfig-name]
MENUITEM=subconfig1,name
MENUITEM=subconfig2,name2

[config_name]
CONFIG.SYS commands
more commands...
INCLUDE additional_config

[config_name2]
CONFIG.SYS commands
more commands...

[additional_config]
more CONFIG.SYS commands

[subconfig1]
more commands...

[subconfig2]
more commands...

[COMMON]
more CONFIG.SYS commands
---sample CONFIG.SYS end

3.1. MENU-specific commands:
"[MENU]" indicates that menuitems will be specified
"MENUITEM" link to a block of commands to execute, "config_name" is the name of the block,
  "displayed_name" its description as it is shown on the screen.
"SUBMENU" appearance and syntax like the above, but when opened shows its own MENUITEMs (2nd level of menu)
"MENUDEFAULT" defines which MENUITEM is highlighted by default, and after how many sec. activated when no key is pressed.
"MENUCOLOR" explains itself, when background is not defined it remains black.
  text=(1-7), background=(8-15)
"INCLUDE" includes a block of commands into another (what else ?)
[COMMON] a block of commands which is always executed REGARDLESS of the chosen MENUITEM
3.2. other CONFIG.SYS commands:
NUMLOCK=ON|OFF sets the status of num.keypad
I recommend to activate it before starting a menu so the entry can be chosen by numeric keys.
SHELL=path tells the system where your COMMAND.COM is (or another shell you may use e.g. 4DOS)
SET= sets environment variables
DEVICE(HIGH)=path (high)loads a driver specified in path
DOS= (HIGH,UMB,AUTO|NOAUTO) sets if the DOS kernel uses HIGHmemory, UpperMemoryBlocks {new in DOS 7.x} The parameter NOAUTO disables a win default setting, autoloading the HIMEM,SETVER,IFSHELP driver

{new in DOS 7.x} the highloading of the sysparmeters listed below.

"FILESHIGH=x" how many files can be opened simultaneously by DOS.
"BUFFERSHIGH=x" interrupt call buffersize
"FCBSHIGH=x" FileControlBlockS. x=amount
"STACKSHIGH=x,y" Stack buffer. x=amount y=size
"LASTDRIVEHIGH=x" how many "mountpoints" for drives are reserved to use. x= last drive letter
3.3. Multiple configuration inside the AUTOEXEC.BAT

The AUTOEXEC.BAT doesn't offer any multiconfig commands. The choice of configuration blocks is done via the GOTO command. in case multiconfig is used the system sets an environment var called CONFIG which contains the name of the chosen MENUITEM. When you customize the sample AUTOEXEC.BAT you'll see how it's done.

use "LH name.exe/com" to highload drivers in the AUTOEXEC.BAT

I won't explain you now the complete syntax and commands of batch programming. The reasons:

  1. Although it's not too complicated it is NOT the topic of this tutorial.
  2. this is just a tutorial, not a book.
  3. if I'd be really that crazy to write a tutorial called "EVERYTHING still worth to be known about DOS"
    I'd have already assimilated my seat and desk and my fingertips 'd be bleeding ;-)

But don't worry, I'll tell you where to get additional info. You may be sitting in front of it, and haven't noticed...

3.4. the sample configuration files

The DOS kernel can only manage the base memory i.e. the first 640 Kb of RAM. The rest (high memory) is accessed via memory manager drivers (himem.sys, emm386.exe). There are two methods to declare this memory: as EMS and XMS. this is the reason why I prepared three DOS-memory configurations.

"HIMEMONLY" is XMS without the memory manager. I recommend it to use with progs shipping it's own DMIM mem management. they usually use a "DOS4GW.EXE" extender.
"XMS" uses the EMM386.EXE to prepare XMS.
"EMS" uses the EMM386.EXE to prepare EMS.

If you REALLY need only a well customized emergency shell with drivers ( really ? NO games ?!?) then you can remove the "XMS" and "EMS" keeping "HIMEMONLY".
All lines starting with a semicolon or "REM" are comments and may by removed if no longer needed.

The HIMEM parameter "/TESTMEM:OFF" I use turns off testing of the RAM-chips and spares some boot seconds. There's already a test done by the BIOS and I really see no reason to test RAM TWICE every bootup.

Please understand that I can't give you nearly completed startup files, but only the sample "patterns" you have to fill by yourself. The contents of AUTOEXEC.BAT and CONFIG.SYS depend on the language you use in DOS, and the hardware you use, (do they need drivers?, if yes: .SYS, .EXE or .COM files ? How are the parameters?) Read the manuals and README's shipped with you devices and ask people for help, if you get stuck.
I know that it's a whole lot more complicated then the win install-wizards and managers, but, hey it's FUN ! Not to forget that you have the possibility to learn about Addressing, DMA channels and IRQ's i.e. how hardware is managed and how your boxes' parts communicate with each other.

All the various fancy win-auto installers mostly only kick off pieces of hardware you installed before when you install new ones ;-)

4. Other Autoexecuted BATch files

The WINSTART.BAT is run WinGUI started. It is "the 1st DOS-Box" opened in Windows.
The DOSSTART.BAT is run when you EXIT Windows via "Boot in DOS-Mode".

5. Final notes

Hint 1: If you can't get a DOS-mouse driver try the on from LOGITECH, it works with nearly everything. use the "NOENHANCE" parameter if VESA-graphics mode games don't get the mouse.
Hint 2: The MEMMAKER optimization entries "DEVICEHIGH /L:x,yyy=drivername" still work even if memmaker is no longer shipped. If you have a copy from an older DOS 6.x version you can use it.
Hint 3: If you want to know more about the old DOS stuff, check "\tools\oldmsdos" on your Win9x CD and copy the progs you haven't to \COMMAND in your windows folder. the command HELP gives you additional info on DOS-, CONFIG.SYS- and batch-specific commands.
Hint 4: because DOS doesn't support long file names they get lost when file operations on LFN-named files are made in DOS-commandline. To prevent this you can use the GNU software "Odi's LFN tools" (http://odi.webjump.com/) or (http://o.to/odi) I use 'em too.

6. THE END (really)

When you have new info, questions or ideas to include in a revision of this tutorial then send me an e-mail: Freeshadow@web.de

The things I wrote about are either undocumented (MSDOS.SYS) or simply no longer mentioned (dosbootmenu in CONFIG.SYS) This shows what micro$oft customer information strategy is:

Don't use the manual to show user the way,
then for "The Technical Reference" they'll pay.
Tell them, it's easy, tell them it's fine,
soon they will call the support line.

Had a laugh ? - Right. That's all. Have fun with your box. - Freeshadow.