"Description of the Windows 95 Startup Process (Q17401
."
The Windows Operating System Predicaments: "Where am I, how did I get there, and what am I capable of doing in MS-DOS Mode/Single-Action Mode (SAM)?"
What this means and how you got there:
a. Just as the system begins to boot, you see the message "Starting Windows ..." and you press the F8 key or hold the Ctrl key to access the command prompt;
b. You double-clicked the name of an MS-DOS application in the GUI;
c. You double-clicked a shortcut for an MS-DOS application;
d. You clicked on the START button, selecting Shut Down, and "Restart computer in MS-DOS mode";
e. You clicked on the START button, selected Programs, and then the MS-DOS PROMPT.PIF;
* * * * * * * * * *
Phase One (a. above):
? After the system is bootstrapped, VxD loaded, and any configuration files processed, the system displays the MS-DOS prompt on the display (or boots into Windows). "What got loaded?" Reference: "IO.sys: the real-mode operating system".
1. IO.SYS (which is the real-mode operating system) loads drivers for HIMEM.SYS, IFSHLP.SYS, SETVER.EXE, and DBLSPACE.BIN or DRVSPACE.BIN by default. It loads dos=high, files=60, lastdrive=z, buffers=30, stacks=9,256, shell= (it's appropriate entry), and fcbs=4.
2. MSDOS.SYS, which contains special information for Windows. The typical default values loaded are:
[Options]
BootGUI=1
[Paths]
WinDir=C:\WINDOWS
WinBootDir=C:\WINDOWS
HostWinBootDrv=C
3. CONFIG.SYS and AUTOEXEC.BAT:
Note: To override a default value loaded by IO.SYS, place an entry in CONFIG.SYS with a value that exceeds the value listed in #1 above. A lesser value will not take effect.
4. Phase One Caveats:
a. By default, the system does not provide for peripherals other than what is included during the system bootstrapping with the BIOS in control and the Master Boot Record (MBR).
Note: To see a summary of system device drivers, system data, programs, and installed devices that have been loaded, type mem /d/p at the command prompt and press enter. If any device such as a CD-ROM, mouse, or other removable is not listed in this summary, access or recognition of the device will not be available until its driver(s) is(are) loaded.
b. Major caveat #1 is loading peripheral drivers in the configuration files when they are usually not necessary for operation in the Windows Graphical User Interface (GUI/Protected-mode).
Note: Depending on the reason for running anything at the MS-DOS prompt it could makes more sense to use a bootable floppy that contain the necessary entries in its configuration files to access a device at the command line in this phase. For instance, use the Emergency Boot Disk (EBD) which has been prepared to gain access to the CD-ROM drive or a specific boot disk with special entries in the configuration files set for any special tasks.
c. Major caveat #2 is having configuration files which get processed during a system boot and are not necessary. The existence of, or empty, configuration files requires that Command.com be loaded into conventional memory - about 8K, and if there are device driver entries in either file, they are loaded into conventional memory too.
Note: Peripheral devices loaded in configuration files may be accessed globally in any virtual machine. A virtual machine (VM) is an environment in memory that, from an application's perspective, looks as if it is a separate computer, complete with all of the resources available on the physical computer that an application needs to run. Each MS-DOS-based application runs in its own VM.
Hint: If there are no configurations files process during boot and no peripherals such as a mouse or CD-ROM is/are available in DOS, consider whether the DOSSTART.BAT file can be run to activate them. If it contains all the necessary information, the CD-ROM, mouse and other device drivers can be activated by running it. Additional information is provided below on this subject. If a DOSSTART.BAT file does not already exist in the Windows folder, you may create the file manually.
Phase Two (b. above): Double-clicking an MS-DOS application in the GUI.
DOSPRMPT.PIF:
? When double-clicking an MS-DOS applications, this PIF (set with the Windows default properties) is used to run the application. After the session ends, the Windows GUI and protect-mode (PM) drivers are regenerated WITHOUT a system re-boot.
Notes:
a. Windows first searches for this PIF in the folder that contain the file being executed (Windows\PIF folder), for a path specified in the environment, and if no PIF is found, the APPS.INF file in the \INF folder is searched for a match.
b. If Windows does not find an entry for the executed application in the APPS.INF file, it uses its own default settings and creates a PIF. If the system was upgraded from Windows 3.x to Win98, a _DEFAULT.PIF file was retained in the Windows folder. In this case, Windows uses information in the _DEFAULT.PIF file to create a PIF for the application.
Caveats:
a. When a program is run from the Windows GUI and the command is not recognized, the most likely cause is that the PIF's Advanced Properties have been set to "Do Not Detect Windows", "Cannot Start a Windows-Based Program from MS-DOS Prompt (Q134489)".
b. When you know beyond a shadow of a doubt that a PIF's setting is correct and there could be no possible reason for a failure, there is perhaps another PIF that is running the program instead of the PIF you suspect is the correct one. Note what a. and b. above is saying.
Phase Three (c. above): Double-clicking a shortcut for an MS-DOS application.
a. Available parameters for an MS-DOS application using a shortcut depends on its configuration in the Properties | Program tab | Advanced section. By default the box "MS-DOS mode" and "Use Current MS-DOS Configuration" is checked.
b. When the "MS-DOS mode" box is checked in a shortcut, the protected-mode (PM) drivers in the Windows GUI are not available. (See 4aNote above for what is available to the application).
c. By default, if a batch file by the name of DOSSTART.BAT is located in the Windows folder, it is run simultaneously with the shortcut. Entries can be placed in this file just as they can in an Autoexec.bat file. Config.sys type entries cannot be placed in this file.
Hint: Device drivers are activated during a system boot when a Config.sys file is processed. If the system didn't process a Config.sys file, there is no way to activate these drivers without a third-party program.
d. After this session ends, the Windows GUI and PM drivers are regenerated WITHOUT a system re-boot.
e. When the "MS-DOS mode" and the "Specify a New MS-DOS Configuration" boxes are checked for a shortcut:
? ALL active Windows programs are shutdown (CLOSED)
? The DOSSTART.BAT file is not run
? The protected-mode (PM) drivers in the Windows GUI are not available (see 4aNote above for what is available globally)
? Only the configurations entered in the two windows "Config.sys for MS-DOS mode" and "Autoexec.bat for MS-DOS mode" are available
? The system re-boots after the DOS application exits.
a. When an application is run in this manner, existing CONFIG.SYS and AUTOEXEC.BAT files are renamed to CONFIG.WOS and AUTOEXEC.WOS, and the CONFIG.SYS and AUTOEXEC.BAT files specified in the PIF are copied to the boot root. Also, the entry "DOS=SINGLE" is added to the CONFIG.SYS file specified by the PIF to cause Windows to start in MS-DOS mode. If you turn your computer off, it fails, or you restart it while it is running in MS-DOS mode, the PIF-specific CONFIG.SYS and AUTOEXEC.BAT files are retained in the boot root and the computer starts up in MS-DOS mode the next time it boots. During the boot, a user is prompted to press ESC to return to Windows for about two seconds. If you miss this prompt to reboot the Windows GUI, the system defaults to MS-DOS Mode.
b. When you quit an MS-DOS-based program properly, the PIF-specific CONFIG.SYS and AUTOEXEC.BAT files are renamed with the ".WOS" extension and the original files are returned to the extension of ".SYS".
c. "PIF specific" CONFIG.xxx and AUTOEXEC.xxx files are created only the first time a shortcut is created using the "Specify a new MS-DOS configuration" for an MS-DOS-based program that will run in MS-DOS mode. All shortcuts created subsequently, using the "Specify a new MS-DOS configuration", will inherit these settings.
Phase Four (d. above): Clicking the START button, selecting Shut Down, and "Restart computer in MS-DOS mode":
a. The unedited "Exit to DOS" PIF and the DOSSTART.BAT are run
b. ALL active Windows programs are shutdown (CLOSED)
c. The protected-mode (PM) drivers in the Windows GUI are not available (see 4aNote above for what is available)
d. You are presented with an MS-DOS prompt
e. Windows can be restarted by typing "Exit" at the prompt and pressing enter.
Caveats:
a. After you type "Exit" to restart Windows, which does not require a reboot, the computer may reboot. This behavior can occur if a real-mode device driver for MS-DOS mode is being loaded from the Dosstart.bat file. The computer is restarted to remove the real-mode device driver from memory when "Exit" is typed.
b. If you edit the "Exit to DOS" PIF and "Specify a new MS-DOS configuration", then the specified Config.sys & Autoexec.bat files are processed & Dosstart.bat is not. The computer is restarted when "Exit" is typed.
c. Notes:
(1) If there is a real necessity for loading a real-mode device driver in the DOSSTART.BAT file, which will necessitate a reboot, it might be more advantageous to load the driver in the configuration files during boot. However, doing so will cause the device driver to be loaded globally (all the time which uses conventional memory).
(2) When you restart Windows in MS-DOS mode, or when MS-DOS mode is set to use the "Use Current Configuration" option, any "SET" statements entered are ignored.
Phase Five (e. above):
a. Clicking the START button, selecting Programs, and the MS-DOS PROMPT.PIF gives a user access to the DOS command line inside the GUI. Return to Windows by typing "Exit" at the command prompt and pressing enter.
? Caveat: DO NOT configure this shortcut by checking "Specify a New MS-DOS Configuration" in the advanced section. When this box is checked, the system will re-boot after the session. Leave this shortcut set to the Windows default, "Starting an MS-DOS Prompt Restarts Computer in MS-DOS Mode (Q159763)."
b. Tips, tricks, and hints:
Tip: When choosing "Restart the computer in MS-DOS mode" in the Shut Down Windows dialog box and then click OK, you may receive an error message "Invalid COMMAND.COM," (or the screen may go black and then Windows restart). This error can occur if the "Exit to DOS" PIF points to a different version of COMMAND.COM than the one loaded in the computer's memory during boot. This will also occur if the path in the Exit to DOS PIF or the Dosprmpt PIF is set to a folder other than Windows.
Hint: There is an environmental settings for COMMAND.COM when Windows loads (this can be seen by dropping to a DOS prompt and typing SET). It has been my practice to enter %COMSPEC% as the "CMD Line" entry on the PIF Program tab, instead of using a path and filename for COMMAND.COM.
Tip: When creating a PIF (and the box is checked to "Specify a New MS-DOS Configuration") enter in the "Config.sys for MS-DOS mode" the windows driver for SMARTDrive to cache the CDs and Floppies.
Tip: Additional environment variables can be entered for a system when the "Specify a New MS-DOS Configuration" has been selected in the "Advanced" section of a shortcut (see variables in paragraph 1 at the top).
Caveat: When using the selection, "Specify a New MS-DOS Configuration" in a shortcut, the system will warn you that all protected-mode programs must be shutdown before the shortcut is run - you may not want to do this. It depends on the purpose of your shortcut.
Tip: Try a setting that runs "full-screen" not "windowed" - the Windows default which can cause problems with some games and demanding programs. If this doesn't help, try the "Exclusive" setting in the Properties sheet.
Trick: Some 16-bit Windows applications run in the Win95/8 GUI may request version information and will fail if they receive an incorrect version number. To solve this problem, locate in \Windows\System the file MKCOMPAT.EXE. This file acts as a liaison between incompatible programs and Windows. Launch MKCOMPAT and check the menu to select the probable solution to incompatibilities. Use the list and select "Lie about Windows version" may be one to try.
Hint: Because of the way Windows allocates memory, memory below 1Mb is a limited resource even when you are running Windows-based applications.
Hint: When possible, run the MEMMAKER utility to load real-mode drivers in the upper memory blocks (UMB), when loading real-mode drivers in the configuration files. This utility may be available in the OTHER\OLDDOS directory depending on the Windows version. If you run it in an MS-DOS mode from Windows, it will return to this mode when it reboots. If it is being run from the DOS prompt (F8/?-key), it returns to that mode.
Note: After running MEMMAKER, check the configuration file entries for Himem and Emm386 and be sure the path to them are correct.
? WINDOWS 95 v/s 98: Virtually, there is little if any difference between the two, "Multiple Copies of Command.com in Memory in MS-DOS Mode (Q14954
".
? This article describes two additional x.PIF files furnished FYI and describes alternatives of running games in Win98, "Windows 98 Sample Program Information (.pif) Files (Q188157)."