Master Rush Talks About DOS Knowledge
When the MS-DOS system starts, it first reads in IO.sys, and then in turn msdos.sys, config.sys, command.com, autoexec.bat... Of course, most of the colleagues in this forum at present can't do much with core startup files like IO.sys like the webmaster wengier... Then let's freely DIY in the config file.
When the PC system starts, it will automatically look for the config.sys file. If it doesn't exist, the system will run in the default way, but this default way is not the most suitable for the system to use in most cases. So we should set up the system startup environment, such as setting the use of extended memory, loading the CD-ROM, USB driver programs, etc. When your system has problems like the system can't be used, insufficient program memory, the device can't be found, the sound card can't be driven, can't connect to the network, etc., reasonably modifying config.sys may solve more than half of the problems.
config.sys is a text file, which can be edited, created and modified with any text editor. (Just create a text file, write the content, and then rename it to config.sys.) Of course, if you call the same content by another name, like autoexec.sys... the system will definitely not recognize it. If you add, change or delete any configuration command in the config.sys file, this change will only take effect when DOS is started next time. Everyone must remember this. The config file is only loaded and executed during system initialization...
The above mentioned that when DOS starts, before executing the automatic batch processing commands, it automatically searches for the config.sys file in the root directory where the startup file is located... If this file exists, the system will read this file into memory. And interpret each command in this file line by line (everyone must remember the four words "interpret line by line"
to set the current DOS system configuration...
Generally speaking, the config.sys file is an ASCII code text file. Now let's talk about some common commands in the config file and their functions.
1. Check Command
The BREAK command is used to instruct DOS to constantly check whether the user presses the Ctrl_Break key. Its general format is: BREAK=ON/OFF. When break=on, the DOS system checks the Ctrl_Break state at any time. In this state, the user can exit the running program process by pressing the Ctrl+Break combination key (the famous CTRL+C). When break=off, the DOS system only checks whether the user presses the Ctrl+Break combination key when the following conditions are met.
(1) Standard output operation;
(2) Standard input operation;
(3) Standard print operation;
(4) Standard auxiliary operation;
2. Buffer Command
BUFFERS: After DOS starts, it establishes a disk buffer in the system memory. The disk buffer uses a certain area in the memory, and DOS uses it for data operations. The disk buffer is a block of memory area, which is used to store data read from the disk or data written to the disk. When DOS reads or writes a record, it first checks whether the data block containing that record is already in the disk buffer. If not, it reads the data block from the disk into the disk buffer, and then transfers this record to the application program; if the data is already in the disk buffer, there is no need to read from the disk, but directly transfer the data to the application program. Since reading data from the disk is a relatively time-consuming operation, increasing the disk buffer can save a lot of disk reading time. But it should be noted that increasing the disk buffer will occupy memory, thus reducing the memory that the application program can use, which will inevitably increase the number of disk reads and writes, resulting in the software execution speed being slowed down or even unable to execute. Therefore, the number of disk buffers is not set larger is better. The optimal number of disk buffers should be determined according to the user's machine configuration and the type of programs usually run. The general format of the buffers command is: BUFFERS=an integer between 1-99, and its default value is 2, and for ibmdos it is 3.
3. Set the Number of Open Files
The FILES command and the FCBS command generally set the number of files that the DOS system can handle simultaneously. When we want to install some games (like DD's Chinese Paladin), when copying or decompressing a large number of small files, the number of files may be several thousand. At this time, we can increase the upper limit of FILES. This will increase the speed of copying or decompressing by DOS. But remember, this will occupy a lot of memory. The FILES command can only control the number of files that the file manager (word) can open simultaneously, and will not affect the number of files that the file control block (FCB) can open simultaneously.
Its command general format is:
FILES=(an integer between 8-255), and its default value is 8
FCBS=(an integer between 1-255), (an integer between 0-255), and the default value is 40, 0. The number in front of FCBS= must be greater than the number behind. The number in front specifies the maximum number of files that the file control block (FCB) can open simultaneously, and the number behind specifies the number of files that the DOS system cannot automatically close when the file control block (FCB) opens the corresponding files simultaneously. If an error occurs due to DOS closing a certain FCBS file, you can increase the value in front. When the FCBS command statement is used in the config file, the resident space of DOS will increase. Most application software uses FILES to manage open files.
4. Driver Loading
We know that various external devices of the PC have corresponding device driver programs, and the system needs to load their driver programs when using these devices. The DEVICE command is for this job. It loads all the standard device drivers (floppy disk, hard disk, keyboard and other input and output device) that we need when running the DOS system, as well as the device drivers other than those supported. And we can load our own driver files. Its general command format is:
DEVICE=drive letter/path (folder)/device driver file
This command is a very unique command in the config file because it can be used multiple times to specify the driver programs of multiple devices with different functions. In some cases, we can add HIGH after the DEVICE command to load the device driver into the upper memory area to save the conventional memory of DOS.
5. Set the Command Processor
The SHELL command is used to set the command interpreter used by the DOS system. DOS defaults to command.com as the outermost command processing program. If we use other compatible DOS system's command (such as I once used romdos's command.com in msdos), we should use the SHELL command to set it in the config file. We can also use this command to call other more powerful command interpreters, such as 4dos, exe, etc. Of course, if someone develops a better command interpreter by themselves (such as aommand.com or 7dos.exe, etc.), the SHELL command can also be used to load it. The general format of this command is SHELL=drive letter/path (folder)/command manager program. If the command manager and this config file are in the current disk, the path can be omitted.
6. Set Variables
The SET command is used to change the limitation of the string in the DOS system environment. Establish a new DOS environment. This command reflects the real meaning of man-machine interaction. The operator and the system can use the memory area specified by this command to change specific limitations and default settings. This command can be used to establish variables from %0 to %9.
At this time, the format is: SET variable name (string)=any setting value from %0 to %9.
If we want to use this variable, we can use the % symbol before and after this string (variable) in the batch command file. For example: After we set tmp=c:\dos, we can use the DIR %tmp% statement in the batch command to open and view the content in the c:\dos folder. This command was used in the autoexec file before DOS6 mode. Of course, it can also be used in the batch command now.
There are some specific commands in DOS. For example, some instructions included in command such as copy, del, type, etc., which are called internal commands. Some in the autoexec file such as for, call, lh, if... and so on. Similarly, which commands are supported in the config file? I will list the names one by one below, and the explanation work will be done later.
List of config configuration file commands:
ACCDATE BREAK BUFFERS
COMMENT COUNTRY DEVICE
DOS DRIVPARM FCBS
FILS INCLUDE INSTALL
LASTDRIVE LOGO MENUCOLOR
MENUDEFAULT MENUITEM NUMLOCK
REM SHELL STACKS
SUBMENU SWITCHES SET
Among them, commands such as BUFFERS, DEVICE, FCBS, FILES, INSTALL, LASTDRIVE, STACKS, etc., can add the "HIGH" statement to use the extended memory of DOS. Such as: DEVICEHIGH=, of course, it must be when there is extended memory of DOS.
Here, I would like to explain one thing. This explanation is written according to the general usage frequency of the commands. In a sense, it is written according to what I am familiar with and relatively commonly used first... It is not sorted in strict academic order according to the alphabet. Please forgive me... Let's continue to talk below.
7. Set Time and Date Format
Here is a command that we Chinese don't commonly use, COUNTRY. This is a command to set the time and date format. We all know that due to physical reasons of the earth, the races, customs, and times of various countries are all different, so the currencies of various countries are also different. The default of DOS is to use the USA's. COUNTRY can change the default time, date, and currency. The format used is:
COUNTRY=(country codes such as 001-972). There is no Chinese one. So I don't remember the specific code very clearly. I basically don't use this command. I only remember that country E is probably 044. Maybe wengier will know very clearly.
8. Lower Memory Management
This is a very interesting command. The DOS command in DOS. The front DOS refers to the DOS system. The following DOS manages and releases the lower memory for application programs. This DOS establishes and maintains the lower memory and the connection between the lower memory and the upper memory. It can load part of the DOS system into the UMB (upper memory area).
Its general format is:
DOS=HIGH\LOW\AUTO
HIGH: Load part of DOS into the high memory area (HMB)
LOW: Restrict DOS to the low memory area
AUTO: Automatically select where to place DOS.
UMB: Maintain the connection between the lower memory and the reserved memory.
Let DOS be able to use commands such as LOADHIGH and DEVICEHIGH to load devices or programs into the high memory area.
NOUMB: Prohibit DOS from using the high memory area. Restrict the connection between the lower memory and the upper memory. In this command, generally non-contradictory parameters can be used together. When used together, separate them with ",". When using the HIGH and UMB parameters, note that HIMEM.SYS should be loaded at least. This command can exist anywhere in the CONFIG file.
9. Install TSR
Generally, we call the memory-resident program TSR. We know that most program calls are completed through batch processing commands. INSTALL is to install some TSR (memory-resident) programs in memory when the DOS system starts and executes the config file. At this time, the execution of the INSTALL command does not pass through the command (command manager) and does not need to use environment variables. Its general format is:
INSTALL=path/TSR program
10. Include Command
config has a menu function, the purpose of which is to configure the corresponding configuration files for using the machine in different environments. In this way, there will inevitably be some repetitive command statements. And the config file executes the statements one by one. But if we repeat these same statements N times, I believe even the friend with the best temper will scold "bill - damn". But the smart bill provides us with such a command INCLUDE. It indicates that when the option mode exists in the config file, it includes all the contents of another configuration block in a set configuration block. This command allows us to set a set of configuration statements that several configuration blocks commonly use into a single block. Use the INCLUDE command to include this block at the appropriate time. This greatly reduces our repetitive work and the length of the config file. Its command general format is:
INCLUDE=the name of the block that needs to be included.
11. Comment Command
The config file is quite different in the DOS system. In order to let the user understand the meaning, principle, or even purpose of the settings in the config file. We can use the REM command in the config file to add comment statements. Such statements do not participate in execution. Just let the user understand the content of the config file configuration and the operations to be carried out more quickly, etc.
Its command general format is:
REM comment statement.
The rem command allows repeated use. The maximum number of characters after each command statement can reach 123 characters. Characters with special meaning to DOS should be enclosed in double quotes.
This command is common in.bat files and config files. In the batch file (.bat file), it can cooperate with the ECHO command to display the content commented by rem. At this time, ECHO is in the ON state. We can browse the content commented by the rem command through text editors such as EDIT. And we can use the REM command without comments to add blank lines in the.bat file and the config file. But the DOS will ignore the blank lines when starting. So this point is generally not of much significance. (To be continued)
-------------------------------------------------------------------------------------------------------------------
When the MS-DOS system starts, it first reads in IO.sys, and then in turn msdos.sys, config.sys, command.com, autoexec.bat... Of course, most of the colleagues in this forum at present can't do much with core startup files like IO.sys like the webmaster wengier... Then let's freely DIY in the config file.
When the PC system starts, it will automatically look for the config.sys file. If it doesn't exist, the system will run in the default way, but this default way is not the most suitable for the system to use in most cases. So we should set up the system startup environment, such as setting the use of extended memory, loading the CD-ROM, USB driver programs, etc. When your system has problems like the system can't be used, insufficient program memory, the device can't be found, the sound card can't be driven, can't connect to the network, etc., reasonably modifying config.sys may solve more than half of the problems.
config.sys is a text file, which can be edited, created and modified with any text editor. (Just create a text file, write the content, and then rename it to config.sys.) Of course, if you call the same content by another name, like autoexec.sys... the system will definitely not recognize it. If you add, change or delete any configuration command in the config.sys file, this change will only take effect when DOS is started next time. Everyone must remember this. The config file is only loaded and executed during system initialization...
The above mentioned that when DOS starts, before executing the automatic batch processing commands, it automatically searches for the config.sys file in the root directory where the startup file is located... If this file exists, the system will read this file into memory. And interpret each command in this file line by line (everyone must remember the four words "interpret line by line"
to set the current DOS system configuration...Generally speaking, the config.sys file is an ASCII code text file. Now let's talk about some common commands in the config file and their functions.
1. Check Command
The BREAK command is used to instruct DOS to constantly check whether the user presses the Ctrl_Break key. Its general format is: BREAK=ON/OFF. When break=on, the DOS system checks the Ctrl_Break state at any time. In this state, the user can exit the running program process by pressing the Ctrl+Break combination key (the famous CTRL+C). When break=off, the DOS system only checks whether the user presses the Ctrl+Break combination key when the following conditions are met.
(1) Standard output operation;
(2) Standard input operation;
(3) Standard print operation;
(4) Standard auxiliary operation;
2. Buffer Command
BUFFERS: After DOS starts, it establishes a disk buffer in the system memory. The disk buffer uses a certain area in the memory, and DOS uses it for data operations. The disk buffer is a block of memory area, which is used to store data read from the disk or data written to the disk. When DOS reads or writes a record, it first checks whether the data block containing that record is already in the disk buffer. If not, it reads the data block from the disk into the disk buffer, and then transfers this record to the application program; if the data is already in the disk buffer, there is no need to read from the disk, but directly transfer the data to the application program. Since reading data from the disk is a relatively time-consuming operation, increasing the disk buffer can save a lot of disk reading time. But it should be noted that increasing the disk buffer will occupy memory, thus reducing the memory that the application program can use, which will inevitably increase the number of disk reads and writes, resulting in the software execution speed being slowed down or even unable to execute. Therefore, the number of disk buffers is not set larger is better. The optimal number of disk buffers should be determined according to the user's machine configuration and the type of programs usually run. The general format of the buffers command is: BUFFERS=an integer between 1-99, and its default value is 2, and for ibmdos it is 3.
3. Set the Number of Open Files
The FILES command and the FCBS command generally set the number of files that the DOS system can handle simultaneously. When we want to install some games (like DD's Chinese Paladin), when copying or decompressing a large number of small files, the number of files may be several thousand. At this time, we can increase the upper limit of FILES. This will increase the speed of copying or decompressing by DOS. But remember, this will occupy a lot of memory. The FILES command can only control the number of files that the file manager (word) can open simultaneously, and will not affect the number of files that the file control block (FCB) can open simultaneously.
Its command general format is:
FILES=(an integer between 8-255), and its default value is 8
FCBS=(an integer between 1-255), (an integer between 0-255), and the default value is 40, 0. The number in front of FCBS= must be greater than the number behind. The number in front specifies the maximum number of files that the file control block (FCB) can open simultaneously, and the number behind specifies the number of files that the DOS system cannot automatically close when the file control block (FCB) opens the corresponding files simultaneously. If an error occurs due to DOS closing a certain FCBS file, you can increase the value in front. When the FCBS command statement is used in the config file, the resident space of DOS will increase. Most application software uses FILES to manage open files.
4. Driver Loading
We know that various external devices of the PC have corresponding device driver programs, and the system needs to load their driver programs when using these devices. The DEVICE command is for this job. It loads all the standard device drivers (floppy disk, hard disk, keyboard and other input and output device) that we need when running the DOS system, as well as the device drivers other than those supported. And we can load our own driver files. Its general command format is:
DEVICE=drive letter/path (folder)/device driver file
This command is a very unique command in the config file because it can be used multiple times to specify the driver programs of multiple devices with different functions. In some cases, we can add HIGH after the DEVICE command to load the device driver into the upper memory area to save the conventional memory of DOS.
5. Set the Command Processor
The SHELL command is used to set the command interpreter used by the DOS system. DOS defaults to command.com as the outermost command processing program. If we use other compatible DOS system's command (such as I once used romdos's command.com in msdos), we should use the SHELL command to set it in the config file. We can also use this command to call other more powerful command interpreters, such as 4dos, exe, etc. Of course, if someone develops a better command interpreter by themselves (such as aommand.com or 7dos.exe, etc.), the SHELL command can also be used to load it. The general format of this command is SHELL=drive letter/path (folder)/command manager program. If the command manager and this config file are in the current disk, the path can be omitted.
6. Set Variables
The SET command is used to change the limitation of the string in the DOS system environment. Establish a new DOS environment. This command reflects the real meaning of man-machine interaction. The operator and the system can use the memory area specified by this command to change specific limitations and default settings. This command can be used to establish variables from %0 to %9.
At this time, the format is: SET variable name (string)=any setting value from %0 to %9.
If we want to use this variable, we can use the % symbol before and after this string (variable) in the batch command file. For example: After we set tmp=c:\dos, we can use the DIR %tmp% statement in the batch command to open and view the content in the c:\dos folder. This command was used in the autoexec file before DOS6 mode. Of course, it can also be used in the batch command now.
There are some specific commands in DOS. For example, some instructions included in command such as copy, del, type, etc., which are called internal commands. Some in the autoexec file such as for, call, lh, if... and so on. Similarly, which commands are supported in the config file? I will list the names one by one below, and the explanation work will be done later.
List of config configuration file commands:
ACCDATE BREAK BUFFERS
COMMENT COUNTRY DEVICE
DOS DRIVPARM FCBS
FILS INCLUDE INSTALL
LASTDRIVE LOGO MENUCOLOR
MENUDEFAULT MENUITEM NUMLOCK
REM SHELL STACKS
SUBMENU SWITCHES SET
Among them, commands such as BUFFERS, DEVICE, FCBS, FILES, INSTALL, LASTDRIVE, STACKS, etc., can add the "HIGH" statement to use the extended memory of DOS. Such as: DEVICEHIGH=, of course, it must be when there is extended memory of DOS.
Here, I would like to explain one thing. This explanation is written according to the general usage frequency of the commands. In a sense, it is written according to what I am familiar with and relatively commonly used first... It is not sorted in strict academic order according to the alphabet. Please forgive me... Let's continue to talk below.
7. Set Time and Date Format
Here is a command that we Chinese don't commonly use, COUNTRY. This is a command to set the time and date format. We all know that due to physical reasons of the earth, the races, customs, and times of various countries are all different, so the currencies of various countries are also different. The default of DOS is to use the USA's. COUNTRY can change the default time, date, and currency. The format used is:
COUNTRY=(country codes such as 001-972). There is no Chinese one. So I don't remember the specific code very clearly. I basically don't use this command. I only remember that country E is probably 044. Maybe wengier will know very clearly.
8. Lower Memory Management
This is a very interesting command. The DOS command in DOS. The front DOS refers to the DOS system. The following DOS manages and releases the lower memory for application programs. This DOS establishes and maintains the lower memory and the connection between the lower memory and the upper memory. It can load part of the DOS system into the UMB (upper memory area).
Its general format is:
DOS=HIGH\LOW\AUTO
HIGH: Load part of DOS into the high memory area (HMB)
LOW: Restrict DOS to the low memory area
AUTO: Automatically select where to place DOS.
UMB: Maintain the connection between the lower memory and the reserved memory.
Let DOS be able to use commands such as LOADHIGH and DEVICEHIGH to load devices or programs into the high memory area.
NOUMB: Prohibit DOS from using the high memory area. Restrict the connection between the lower memory and the upper memory. In this command, generally non-contradictory parameters can be used together. When used together, separate them with ",". When using the HIGH and UMB parameters, note that HIMEM.SYS should be loaded at least. This command can exist anywhere in the CONFIG file.
9. Install TSR
Generally, we call the memory-resident program TSR. We know that most program calls are completed through batch processing commands. INSTALL is to install some TSR (memory-resident) programs in memory when the DOS system starts and executes the config file. At this time, the execution of the INSTALL command does not pass through the command (command manager) and does not need to use environment variables. Its general format is:
INSTALL=path/TSR program
10. Include Command
config has a menu function, the purpose of which is to configure the corresponding configuration files for using the machine in different environments. In this way, there will inevitably be some repetitive command statements. And the config file executes the statements one by one. But if we repeat these same statements N times, I believe even the friend with the best temper will scold "bill - damn". But the smart bill provides us with such a command INCLUDE. It indicates that when the option mode exists in the config file, it includes all the contents of another configuration block in a set configuration block. This command allows us to set a set of configuration statements that several configuration blocks commonly use into a single block. Use the INCLUDE command to include this block at the appropriate time. This greatly reduces our repetitive work and the length of the config file. Its command general format is:
INCLUDE=the name of the block that needs to be included.
11. Comment Command
The config file is quite different in the DOS system. In order to let the user understand the meaning, principle, or even purpose of the settings in the config file. We can use the REM command in the config file to add comment statements. Such statements do not participate in execution. Just let the user understand the content of the config file configuration and the operations to be carried out more quickly, etc.
Its command general format is:
REM comment statement.
The rem command allows repeated use. The maximum number of characters after each command statement can reach 123 characters. Characters with special meaning to DOS should be enclosed in double quotes.
This command is common in.bat files and config files. In the batch file (.bat file), it can cooperate with the ECHO command to display the content commented by rem. At this time, ECHO is in the ON state. We can browse the content commented by the rem command through text editors such as EDIT. And we can use the REM command without comments to add blank lines in the.bat file and the config file. But the DOS will ignore the blank lines when starting. So this point is generally not of much significance. (To be continued)
-------------------------------------------------------------------------------------------------------------------


