Autoexec. BAT and config. Sys File Usage

Source: Internet
Author: User
Tags ranges xms
Config. SYS file is a very important text file in the DOS system. It is located under the root directory of the boot disk and consists of a series of system configuration commands, these commands initialize the various hardware that make up the computer, so that the DOS operating system can make good use of them after startup.

Strictly speaking, Windows 95/98 is not a real operating system. It is just a very large application built on a DOS gui (graphical user interface, after it is started, it takes control of hardware resources from the DOS system. In fact, the operating system it depends on is dos 7.0. In this case, early dos applications can also run on this DOS platform. To prevent the computer from entering the GUI Windows platform after it is started, you must modify msdos. sys File: First find msdos in the root directory of the system startup partition. sys File and remove its read-only property, then open it with notepad, change "bootgui = 1" inside to "BOOT-GUI = 0", save the file to exit, in this way, the operating system is directly transferred to the pure DOS mode without entering the GUI after being started. To enter the Windows operating platform, you only need to type win in this mode (the executable file Win. com is located in the Windows System directory ). The following is a typical DOS and Windows Multi-startup configuration (assuming that the Windows System directory is under pwindows 98 on drive C ):
-------- Config. sys --------
[Menu]
Menuitem = sub_1 DoS
Menuitem = sub_2 dos & CDROM
Menuitem = sub_3 ms_windows
Menucolor = 15, 1
Menudefault = sub_3, 10
[Sub_1]
Device = himem. sys/testmem: Off
Device = emm386.exe Ram noems I = B000-B7FF
Lastdrive = z
DOS = high, umb
Files = 96
Stacks = 9,512
[Sub_2]
Device = himem. sys/testmem: Off
Device = emm386.exe Ram I = B000-B7FF
Devicehigh = C: cdromteac_cdi.sys/D: mscd001
Lastdrive = z
DOS = high, umb
Files = 96
Stacks = 9,512
[Sub_3]
[Common]
Lastdrive = z
The format is as follows:
[Menu]
Menuitem = block name, menu content
Menucolor = x, y
Menudefault = block name, time value
[Block name]
............
[Common]
............
This is a command format with multiple configurations. The [menu] block is essential and defines the menu items and colors of the Startup menu, most other blocks are named after a menu item. When a menu item is selected, the statements in the corresponding block are executed. [common] is a public item, no matter which menu item is selected, the commands in the public item will be executed.

Menuitem = sub_1 the system defines a menu item in the format:
Menuitem = block name menu content
Block name: the name of the configuration block to be executed when this menu item is selected.
Menu content: the content displayed on the screen when the Start menu is displayed. This item is optional. If it is specified, only the block name is displayed when the menu is started, otherwise the block name is displayed on the menu.
Menucolor = 15, 1 defines the foreground color and background color of the Start Menu. Format: menucolor = x, y
X: Specifies the color of the text in the menu. The value ranges from 0 ~ 15.
Y: Specifies the background color in the menu. The value ranges from 0 ~ 15. The default value is 0, that is, black.
Menudefault = sub_3, 10 defines a default option in the Startup menu, and sets a time-out limit value. The format is as follows:

Menudefault = block name, time value
Block name: the block name of the default menu item.
Time: specifies the number of seconds after waiting. If no button is clicked, the system executes the corresponding menu block of the default menu item.

Device = C: pwindows 98himem. sys/testmem: off: load the extended Memory Manager. "/testmem: Off" indicates that the memory is not detected when the extended memory manager is loaded.
Device = C: pwindows 98emm386. EXE Ram noems I = B000-B7FF to load the extended memory hypervisor (you must first load the extended memory hypervisor ). "Ram" indicates that ~ The idle memory of KB is submitted to the DOS management. This space is umb (upper-level memory block). "noems" indicates that the system does not provide any memory expansion function, the emm386 administrator simulates the extended memory as the extended memory. "I = B000-B7FF" indicates that the address is b000 ~ B7ff (For monochrome display Rom ing ROM) memory of 32 KB is released to umb.

Devicehigh = C: cdromteac_cdi.sys/D: mscd001 load the optical drive driver into the upper memory. Note: If you want to use the optical drive under DOS, it is best to configure config. run the installation file of the driver under DOS drive before sys, and then install the installation program in config. sys and autoexec. write down the statements added to the BAT files and add these statements when configuring multiple Enis. Because all types of optical drive drivers are not the same, you can only configure this.

Lastdrive = z specifies the last drive letter that can be allocated by the system. The value is ~ Z.
DOS = high; umb indicates that DOS manages umb created by emm386.exe and loads a part of it into HMA (high-end memory ).
Files = 96 specifies the number of files that DOS can simultaneously access.
Stacks = 9,512 this command indicates that nine K data stacks can be dynamically used when handling hardware interruptions.

-------- Autoexec. Bat --------
@ Echo off
Goto % config %
: Sub_1
Set Path = C: UCDOS; C: tools; % PA-TH %
Lh c: toolsmouse
Smartdrv
Goto end
: Sub_2
Set Path = C: UCDOS; C: tools; % PA-TH %
Lh c: toolsmouse
Lh c: cdrommscdex. EXE/D: MSC-D001
Smartdrv
Goto end
: Sub_3
Win
Goto end
: End

Description:

@ Echo off: autoexec is not displayed. the content of each line of command statement in bat. If "@" is added before "echo off", it is not displayed on the screen. Otherwise, "echo off" is displayed on the screen ".
Set is used to set, display, or delete DOS environment variables. % PATH % indicates taking the search path parameter of the current system.
Goto % config % indicates that DOS will go to the statement labeled environment variable config value and start executing the following statement.
LH mouse. com indicates adding the mouse driver to the upper-level memory. If the mouse driver is *. in the form of SYS, you must pass the driver through config. the sys file is loaded into the upper-level memory zone in the format:
Devicehigh = C: mousemouse. sys where "devicehigh" indicates loading the device driver to umb.
Lh c: cdrommscdex. EXE/D: MSCD-001 to load the drive into the upper memory. Note that before adding this command, you must add the "DEVI-CEHIGH = C: cdromteac_cdi.sys/D: MS-CD001" statement to config. sys.
Smartdrv loads the high-speed disk cache program. When a program is loaded, the above-Bit Memory has enough space, and it will be automatically loaded to the upper-level memory. To effectively accelerate system disk operations, use smartdrv. EXE creates a disk cache in the extended memory. It stores the data of the disk sectors that are used and will be used later, because data will be read directly from Ram rather than from the disk in the future, therefore, the access speed is improved.
After the final debugging is successful, you can use a text editor to open the msdos. SYS file and add a line of statement ---- "bootkeys = 0" at the end of the file to prevent users from using the F4, F5, and F8 keys. You can also add the following statement to the first line of config. sys (that is, "[menu:
Switches =/f/N (the switch option at startup, "/F" indicates that the "Starting ...... "Wait time;"/N "indicates that you cannot use the" F5 "or" F8 "key to skip the startup command)
Note: All punctuation marks in the config. sys and autoexec. BAT files must be in the Spanish format (for example, "," cannot be written as ","). Otherwise, an error will occur during startup!
Definition of extended memory, extended memory, regular memory, upper memory, and high-end memory
Extended memory (XMS, extended MEMO-RY), is on the motherboard 0 ~ Memory other than 640k. Due to the limitations of early dos development, only 0 ~ Memory segments within kb. To use extended memory other than kb, the e-brain industry has developed an extended memory specification standard (Lotus/Intel/micro-soft/AST ). Himem provided by ms_dos. the sys file is an extended memory management (driver) program compiled according to this specification. By loading this management (driver) program at startup, the system can use a memory space of more than kb.

Extended memory (EMS, expanded MEMO-RY) is the memory that is implemented by inserting boards or by simulation. To use more than KB of extended memory, the computer industry has formed a usage standard (Lotus/Intel/Microsoft) Expanded Memory specification (extended memory usage Specification ). For the extended memory of the card, you must run the driver that comes with the card. If you want to use the extended memory to simulate the extended memory, you need to run the emm386.exe driver provided by ms_dos. From the perspective of the generation time of EMS and XMS, EMS is earlier than XMS, and the early computer memory is small, which is far from meeting the running needs of large-scale software, therefore, you must add boards to increase the memory. As the manufacturing costs of the motherboard and memory decrease, XMS gradually replaces EMS, however, in order to adapt to the needs of some early applications that must use EMS (such as the Three Kingdoms series from koei), ms_dos provides the emm1_. exego function to simulate EMS using XMS.

The regular memory starts at 0 kb and ends at 640kb. If the club does not use some memory management programs (in ms_dos, except himem. in addition to sys and emm386.exe, there are qemm of quarterdeck and memory max of qualitas), so regular memory is the only memory you can use, the general memory will be occupied by DOS and device drivers and TSR (memory resident program. TSR is a program that loads computer memory and resident in it, while general programs often return the occupied memory to the operating system after use.

Upper memory (umb, upper memory blocks) refers to the memory size between 640kb and 1024kb. Generally, this area is used by memory such as system ROM and video. However, most computer hardware does not use the entire Upper-level memory zone. When we use a memory management program such as emm386, we can move some TSR programs to this memory zone.
High-end memory (HMA, high memory area) is a 64 kB continuous memory space larger than 1 MB. It is an extended memory. In other words, it refers to the first 64 K of extended memory. This is a special area of memory, which is usually used to load DOS into high-end memory areas.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.