Boot.ini switches - Windows NT startup

The author of this document is Mark Russinovich.
Visit his website at
http://www.sysinternals.com/.

There are number of Boot.ini switches that are useful for driver developers that wish to test their drivers under a variety of different system configurations without having to have a separate machine for every one. For example, limiting the amount of memory Windows NT sees can be useful for stressing memory loads, and limiting the number of processors for testing scalability.

Switches in red are new in Windows 2000.

 
/PAE This has NTLdr load NtKrnlpa.exe, which is the version of the x86 kernel that is able to take advantage of Intel Physical Address Extensions (PAE), even when a system does not have more than 4Gb of physical memory. PAE permits an x86 system to have up to 64Gb of physical memory, but an operating system must be specially coded to use memory beyond 4Gb (the standard x86 limit). The PAE-version of the Win2K kernel presents 64-bit physical addresses to device drivers, so this switch is helpful for testing device driver support for large memory systems.
/NOPAE This switch forces NTLdr to load the non-PAE version of the Win2K kernel, even if the system is detected as supporting x86 Physical Address Extensions (PAE) and has more than 4Gb of physical memory.
/NOLOWMEM This switch requires that the /PAE switch be present and that the system have more than 4Gb of physical memory. If these conditions hold, then the PAE-enabled version of the Win2K kernel, NtKrnlpa.exe, will not use the first 4Gb of physical memory. Instead, it will load all applications and device drivers, and allocate all memory pools, from above that boundary. This switch is useful only to test device driver compatability with large memory systems.
/NOGUIBOOT When this option is specified, the VGA video driver responsible for presenting bit mapped graphics
during Win2K's boot process is not initialized. The driver is used to display boot progress information, as well as to print the Blue Screen crash screen, so disabling it will disable Win2K's ability to do those things as well.
/FASTDETECT When you dual boot WinNT 4.0 and Win2K, the Win2K version of NTDetect.com is used during the boot process. In Win2K, detection of parallel and serial devices is performed by plug-and-play
device drivers, but WinNT 4.0 expects NTDetect.com to perform the detection. Thus, specifying /FASTDETECT causes NTDetect.com to skip parallel and serial device enumeration for a boot into Win2K, whereas ommitting the switch has NTDetect.com perform enumeration for a boot into WinNT 4.0. For Win2K boots the switch is present and for boots into WinNT 4.0 the switch is omitted.
/BOOTLOG Specifying this switch will result in Win2K writing a log of the boot to the file %SystemRoot% \NTBtLog.txt.The log has entries that detail which drivers load and do not load during the boot process. Here is example output from a log (note that the log file is un UNICODE) :
Microsoft (R) Windows NT (R) Version 5.0
Loaded driver \WINNT\System32\ntoskrnl.exe 
Loaded driver \WINNT\System32\hal.dll 
Loaded driver \WINNT\System32\bootvid.dll 
Loaded driver pci.sys 
Loaded driver isapnp.sys 
Loaded driver intelide.sys
/SAFEBOOT: You should never have to specify this option manually, since NTLdr does it for you when you use
the F8 menu to perform a safe boot. Following the colon in the option you must specify an additional switch :
MINIMAL   Safe boot without network support. Win2K only loads drivers and services that are specified by name or group in HKLM \System \CurrentControlSet \Control \SafeBoot \Minimal.
NETWORK   Safe boot with network support. Win2K only loads drivers and services that are specified by name or group in HKLM \System \CurrentControlSet \Control \SafeBoot \Network.
DSREPAIR   The DSREPAIR (Directory Services Repair) switch causes Win2K to boot into a mode where it restores the Active Directory from a backup medium you present.
ALTERNATESHELL   This tells Win2K to use the program specified by HKLM \System \CurrentControlSet \SafeBoot \AlternateShell as the graphical shell, rather than to use the default which is Explorer.exe.
/PERFMEM=
/PERFPAGES=
These flags are not likely to be supported in the final release of Win2K, as they are used to have WinNT 4.0 reserve physical memory for the purposes of Basic Block Testing (BBT). They should not be specified together.
See transcript at Microsoft dated 02/02/99.
PERFMEM   Physical memory to reserve in Mb
PERFPAGES   Physical memory to reserve in number of pages
/INTAFFINITY This new switch directs the multiprocessor HAL (HALMPS.dll) to set interrupt affinities so that only the highest numbered processor in an SMP will receive interrupts. Without the switch the HAL defaults to its normal behavior of letting all processors receive interrupts.
/MAXPROCS
PERCLUSTER=
It seems that the multiprocessor HAL in Win2K (HALMPS.dll) has the ability to work with multiprocessors that are made up of tightly-coupled clusters of smaller multiprocessors. For example, if you had an 8-way system that was made up of 2 4-way clusters, the processor IDs of each processor would have to be specified in a cluster-oriented manner by the HAL. The maximum cluster size is 4 and the default is 0 (system is not based on clusters).
/TIMERES= Default resolution is 7.8ms. On the multiprocessor HAL (HALMPS.dll) this option will set the resolution of the system timer. The argument is a number interpreted in 100's of nanoseconds, but the rate will be set to the closest  resolution the HAL supports that is not larger than the one requested. The HAL supports the following resolutions :
100's of nanoseconds   Milliseconds
9766   .98
19532   2.0
39063   3.9
78125   7.8
/YEAR= Specifying this option causes Windows core time function to ignore the year that the computer's real-time clock reports and instead use the one indicated. Thus, the year used in the switch affects every piece of software on the system, including the NT kernel. Note : this option is only available on WinNT 4.0, Service Pack 4 and later, and Win2K.
/USE8254 This switch is intended for systems with older BIOS's. It instructs the NT HAL to use the 8254 timer chip as its base timer.
See KB Q169-9-01 for more information.
/MAXMEM= This option will limit NT to using only the amount of memory you specify. The number is interpreted as Mb.
/BURNMEMORY= This option will cause NT to "forget" about the amount of memory specified, which limits memory like /MAXMEM. The value specified is interpreted as Mb. NT will discard the amount of physical memory you have indicated as unusable.
/ONECPU This option will have NT only enable one CPU in a multiprocessor system.
/NUMPROC= Only the number of CPUs specified will be enabled. Example: /NUMPROC=2 on a 4-way system will cause 2 of the 4 processors to be unused by NT.
/SOS Causes NT to print information about which drivers are being loaded as the system boots.
/BASEVIDEO Causes NT to use the standard VGA display driver when moving to GUI mode.
/NODEBUG Prevents kernel-mode debugging from being initialized. Overrides the specification of any of the three debug-related switches, /DEBUG, /DEBUGPORT and /BAUDRATE.
/CRASHDEBUG If you include this switch, the kernel debugger is loaded when the system boots, but remains inactive unless a crash occurs. This allows the COM port that you specify (or COM1 by default) to be available for other use while the system is running.
/DEBUG Enables kernel-mode debugging.
/DEBUGPORT= Enables kernel-mode debugging and specifies an override for the default serial port (COM1) to which a remote debugee is connected.
/BAUDRATE= Enables kernel-mode debugging and specifies an override for the default baud rate (19200) at which a remote debugee will connect.
/BREAK Causes the HAL to stop at a breakpoint at HAL initialization. The first thing that the NT kernel does when it initializes is to initialize the HAL, so this breakpoint is the earliest one possible. The HAL will wait indefinitely at the breakpoint until a debugger connection is made. If the switch is used without the /DEBUG switch the system will Blue Screen with STOP code 0x00000078 PHASE0_EXCEPTION.
/KERNEL= 
/HAL=
These options specify overrides of NTLdr's selection of the file named NTOSKrnl.exe in %SystemRoot% \System32 as the kernel's image file and of the file named HAL.dll as the HAL image
file. They are extremely useful for alternating between a checked kernel environment and a free kernel environment. If you wish to boot into a checked environment that consists solely of the checked kernel and HAL, which is typically all that is needed to test drivers, follow these steps on a system installed with the free build (retail NT) :
1. Copy the checked version of the kernel from the checked build distribution CD to your %SystemRoot% \System32 directory, naming it NTOSkChk.exe. If you are on a uniprocessor then copy NTOSKrnl.exe, otherwise on a multiprocessor copy NTKrnlMP.exe. Note that the kernel file name must be a 8.3-style short names.
2. Copy the checked version of the HAL from the checked build distribution CD to your %SystemRoot% \System32 directory, naming it HalChk.dll. To determine which HAL to copy, go into your %SystemRoot% \Repair  directory and open Setup.log in Notepad. Search for HAL.dll and you will find a line like \WINNTF\system32\hal.dll="halmps.dll","1a01c". The name to the right of the equal sign is the name of the HAL you should copy.
3. Make a copy of the default line in the system's Boot.ini.
4. Add the following parameters :
/KERNEL=NTOSKCHK.EXE /HAL=HALCHK.DLL
/3GB This switch made its debut in WinNT 4.0 Service Pack 3 and is supported on all later releases of NT. With /3GB : 2Gb user memory + 2Gb system memory
Without /3GB : 3Gb user memory + 1Gb system memory
Giving virtual memory intensive applications like database servers a larger address space can improve their performance. Note, however that for an application to take advantage of this feature two additional conditions must hold : the system must be part of the NT Enterprise suite (SP3 is not) and the application must be flagged as a 3Gb-aware application.
See KB Q171-7-93 for more information.
/WIN95 This switch is only pertinent on a triple-boot system that has DOS, Win9x and WinNT installed. Specifying the /WIN95 switch directs NTLdr to boot the Win9x boot sector stored in BootSect.w40.
See KB Q157-9-92 for more information.
/WIN95DOS This switch is only pertinent on a triple-boot system that has DOS, Win9x and WinNT installed. Specifying the /WIN95DOS switch directs NTLdr to boot the DOS boot sector stored in BootSect.dos.
See
KB Q157-9-92 for more information.
/PCILOCK Stops WinNT from dynamically assigning IO/IRQ resources to PCI devices and leaves the devices configured by the BIOS.
See KB Q148-5-01 for more information.
/NOSERIALMICE
=[COMx | COMx,y,z...] 
Disables serial mouse detection of the specified COM port(s). Use this switch if you have a component other than a mouse attached to a serial port during the startup sequence. If you use /NOSERIALMICE without specifying a COM port, serial mouse detection is disabled on all COM ports.
See KB Q131-9-76 for more information.
/SCSIORDINAL: Adding a new SCSI device to a system with an on-board SCSI controller can cause the controller's SCSI ID to change, so you use this switch to direct WinNT to the SCSI ID of the controller.
See KB Q103-6-25 for more information.