China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-22 14:55
中国DOS联盟论坛 » 网络日志(Blog) » 【Billunique】Personal Blog - Drops Make an Ocean View 40,502 Replies 59
Original Poster Posted 2007-04-06 03:12 ·  中国 北京 雅虎中国
中级用户
★★
菜鸟总动员
Credits 259
Posts 112
Joined 2006-08-28 15:53
19-year member
UID 61454
Status Offline
Inspired and lured by Redtek's blog ~

Got an itch, so I'm also going to start my study blog!

Hope to record my study footprints, so that when I look back, I can feel my progress bit by bit!

[ Last edited by Billunique on 2007-4-9 at 08:00 AM ]
★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲
Floor 2 Posted 2007-04-06 03:23 ·  中国 北京 雅虎中国
中级用户
★★
菜鸟总动员
Credits 259
Posts 112
Joined 2006-08-28 15:53
19-year member
UID 61454
Status Offline
First, link this over as the opening~ : )

http://www.cn-dos.net/forum/viewthread.php?tid=28955&fpage=1&highlight=%2BBillunique

[ Last edited by Billunique on 2007-4-6 at 03:28 AM ]
★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲
Floor 3 Posted 2007-04-06 04:06 ·  中国 北京 雅虎中国
中级用户
★★
菜鸟总动员
Credits 259
Posts 112
Joined 2006-08-28 15:53
19-year member
UID 61454
Status Offline
★"Comprehensive Collection of DOS Commands for Windows 98/2000/XP/2003" - Hope Book Studio

☆The filename CON refers to the console (CONsole), which is the terminal through which users communicate with the computer. On a PC, it refers to the screen and keyboard. When CON is used for "input," it means the "keyboard," and when used for "output," it means the "screen."

 Since CON is treated as a file (somewhat similar to Unix, heh), you can use Copy to connect the data input from CON with a file (suitable for simple content addition to a file):
A:\>copy con 1.txt
line1
^Z
1 files(s) copied

A:\>copy 1.txt+con temp
1.txt
con
line2
^Z
1 file(s) copied

A:\>type temp
line1
line2

☆When copying multiple files using Copy, the target file only takes the code before the Ctrl+Z key in each source file. (In Notepad, this code is implicit, and the Ctrl+Z marker is where the cursor is at the end of the text)

The mechanism of Copy+: First, the first file in the source file queue overwrites the target file (creates it if it doesn't exist), and then successively adds the contents of other members in the queue to this target file. Therefore, if there is a file with the same name as the target file in the source list, the content of this file will not be copied in - because its content has already been "pushed out" by the first file in the source list before, and after pushing out, when reading again, it's no longer the same. (This is the reason why Copy usually ignores this file)

[ Last edited by Billunique on 2007-4-7 at 11:41 PM ]
★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲
Floor 4 Posted 2007-04-06 05:55 ·  中国 北京 雅虎中国
中级用户
★★
菜鸟总动员
Credits 259
Posts 112
Joined 2006-08-28 15:53
19-year member
UID 61454
Status Offline
Environment variables can be used to pass data that cannot be passed by % variables between two batch programs. For example, the following Test.bat program will first look for the specified file in the current working directory. If found, it will Type its directory data; if not found, it will call Test2.bat, and Test2 will go to the Usr subdirectory to find and Type its content.

C:\>type test.bat
@echo off
if not exist %1 goto find
type %1
goto end
:find
set file=usr\%1
call test2
:end
echo OK!

C:\>type test2.bat
@echo off
echo Type out now....
type %file%

C:\>type \usr\doc
This is a test file in C:\usr

----------------------
C:\>test doc
Type out now....
This is a test file in C:\usr
OK!


[ Last edited by Billunique on 2007-4-7 at 11:42 PM ]
★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲
Floor 5 Posted 2007-04-06 07:49 ·  中国 北京 雅虎中国
中级用户
★★
菜鸟总动员
Credits 259
Posts 112
Joined 2006-08-28 15:53
19-year member
UID 61454
Status Offline
What are the benefits of configuring ANSI drivers in MS-DOS?

  ANSI.SYS is a terminal driver compliant with ANSI standards. Because the early terminal control code rules were inconsistent, programs used at terminal A could not be used at terminal B (causing abnormal screens and keyboards), and this situation was particularly common in network systems because a network might connect several manufacturers' terminals. If all terminals comply with the same standard control codes, programs can be universal among various terminals without differences.

  This is the origin of ANSI.SYS, which is provided by the American National Standards Institute. When DOS is specified to load ANSI.SYS and integrate with DOS, MS-DOS will comply with ANSI control codes. ANSI control codes are composed of more than one character, so they are also called control sequences.

  Since ANSI.SYS is a terminal control program, as long as the ANSI control code is sent to the standard output of DOS, ANSI.SYS can receive the control code and perform actions according to the instructions of the control code. Then how to send the ANSI control sequence to the output? Because the control code will immediately produce a control effect, the control code cannot be directly typed under the DOS state.

  Usually, the prompt command of DOS is used to transmit the control code. Because the prompt command itself has some ability to control output, and combined with the functions of ANSI.SYS, many useful things can be completed.

[ Last edited by Billunique on 2007-4-7 at 11:42 PM ]
★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲
Floor 6 Posted 2007-04-06 11:43 ·  中国 北京 雅虎中国
中级用户
★★
菜鸟总动员
Credits 259
Posts 112
Joined 2006-08-28 15:53
19-year member
UID 61454
Status Offline
What is the difference between Comspec and Shell?

  Shell is stored in the Config.sys file and provides the pathname of the DOS command processor at startup.

  While Comspec is an environment variable stored in memory after startup.

  What is the function of this variable? Because some programs may damage the non-resident part of Command.com, so when the program ends and returns to DOS, DOS must reload the non-resident part of the command processor, but it doesn't know where the command is or what its name is. Then it can be obtained from the commands in Config.sys. However, the floppy disk in the current drive may not be a boot disk (without the Config.sys file). So MS-DOS designed an environment variable called Comspec to remember the pathname of the command processor. When DOS needs to re-resident the non-resident part, it finds the command interpreter according to the instruction of Comspec.

  Of course, when an application needs to load the DOS command processor, it can also find it from the disk according to the record of Comspec.

[ Last edited by Billunique on 2007-4-7 at 11:43 PM ]
★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲
Floor 7 Posted 2007-04-06 23:21 ·  中国 北京 雅虎中国
中级用户
★★
菜鸟总动员
Credits 259
Posts 112
Joined 2006-08-28 15:53
19-year member
UID 61454
Status Offline
☆ DOS provides a multi-flexible way to execute the commands in the Config.sys file, allowing users to easily master the Config file that is more in line with the current situation, and control which programs do not run and which programs need to be installed. Therefore, it can not only quickly adjust the system settings according to different needs, but also return to the most original configuration, and also make the memory not waste needlessly.

  DOS 6.22 provides 3 ways for users to control the running of the Config.sys file and the Autoexec.bat file:

  1. Ask the user whether to run a certain Config command - add? in front of Device: Device? = C:\DOS\ANSI.SYS

  2. All Config commands and Autoexec.bat commands need to be confirmed by the user - press the F8 key at startup (when "Starting MS-DOS……" appears immediately). (Version 6.0 can only confirm the running of Config, and starting from version 6.2, it can also control Autoexec) During this period, if you decide that none of the following commands will run, you can press the F5 key; conversely, you can also press the Esc key to run all the following commands.

  3. Completely skip the running of the Config.sys and Autoexec.bat files and start with the most original settings - press the F5 key at startup. Since the Config.sys file is skipped, the Shell = command will not be run. At this time, DOS will automatically load the Command.com file into the required directory as the command processor. In case Command.com is not in the root directory, DOS will also look for it in the C:\DOS directory. In case it is not found in this directory, DOS will display the following information:
  Bad or Missing Command Interpreter
  Enter correct name of Command Interpreter(eg, C:\COMMAN.COM)

  In addition, because the Autoexec.bat is also skipped, its Path command is not run. However, DOS will set PATH=C:\DOS by default. As for the programs in other directories, you need to manually specify them with the Path command.
  

[ Last edited by Billunique on 2007-4-7 at 11:44 PM ]
★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲
Floor 8 Posted 2007-04-07 00:55 ·  中国 北京 雅虎中国
中级用户
★★
菜鸟总动员
Credits 259
Posts 112
Joined 2006-08-28 15:53
19-year member
UID 61454
Status Offline
☆ The settings mentioned above can meet users' multiple needs to a certain extent, but in some cases, they seem relatively cumbersome. Is there a customized configuration environment for a specific user or occasion that can be directly loaded and entered when needed?

The answer is yes. DOS endows the Config.sys file with another very useful function: Multiple system configurations!

1. Structure of multiple configuration files

Multiple configuration files can be divided into three major parts: option area (menu block), configuration area (configuration block), and common area (common block). The format is as follows:


menuitem=Bill
menuitem=Gates

Files=40
Device=C:\Device1.sys

Files=10
Device=C:\Device2.sys

Buffers=30
Install=C:\Dos\Doskey.com

  ●Option area: This is the beginning of the multiple configuration file. It must start with , and Memuitem is used to specify the names of each configuration area. After startup, a startup menu will be displayed on the screen listing the names of each configuration area:

MS-DOS 6.22 Startup Menu

1.Bil

2.Gates

Enter a choice:1


F5=Bypass startup files F8=Confirm each line of CONFIG...

Each item in the startup menu represents a set of configurations for users to choose. Please note that only Menuitem statements can be in the option area, and other commands will not be accepted by DOS.

  ●Configuration area: This is the actual environment setting area where Config commands are stored. Each option in the startup menu corresponds to a configuration area. In the above example, after entering a choice and selecting item 1 Bill, it will jump to the configuration area headed by to run its environment settings.

  ●Common area: In addition to having their own independent configuration areas for each option, the multiple configuration file also sets up a common running area. No matter which set of environment settings is selected, the commands in this area will be run. The common area starts with .

The order of each configuration area and the common area can be arranged arbitrarily regardless of the order. If the options listed in the option area do not have corresponding configuration areas, DOS will display an error for that line.

[ Last edited by Billunique on 2007-4-7 at 11:45 PM ]
★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲
Floor 9 Posted 2007-04-07 02:31 ·  中国 北京 雅虎中国
中级用户
★★
菜鸟总动员
Credits 259
Posts 112
Joined 2006-08-28 15:53
19-year member
UID 61454
Status Offline
### 2. Menuitem Command

The Menuitem command is used in the option area. This command is used to set the name of the configuration area corresponding to the boot menu. If necessary, explanatory text can be added. The format is:
Menuitem=BlockName

- **BlockName**: Can be any character except the characters \ /, ; = , with a maximum of 70 characters.
- **Menuitem**: This parameter is optional and is mainly used to explain the meaning of BlockName. After adding this parameter, the item displayed on the boot menu will be Menu Text instead of BlockName. (But when selected, it will still jump to the configuration area corresponding to its BlockName. It just replaces the display of BlockName.) Similarly, Menu Text can also be up to 70 characters.

### 3. MenuDefault Command

This command is used to set the pre-selected item of the boot menu. If necessary, a timeout parameter can be added. The format is as follows:
MenuDefault=BlockName

- **Timeout**: Waiting time. Generally between 0 - 90 seconds. When the user does not make a choice, DOS will automatically run the default item after the time set by Timeout. If the Timeout time is not specified, DOS will wait until the user presses a key to make a choice before proceeding to the next step.

If the MenuDefault command is not added in multiple configurations, the first item will be the pre-selected item.

[ Last edited by Billunique on 2007-4-7 at 04:24 AM ]
★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲
Floor 10 Posted 2007-04-07 03:27 ·  中国 北京 雅虎中国
中级用户
★★
菜鸟总动员
Credits 259
Posts 112
Joined 2006-08-28 15:53
19-year member
UID 61454
Status Offline
### 4. MenuColor Command

  In the option area, you can also use the MenuColor command to set the text and background colors. The format is as follows:
  
MenuColor=X

  X represents the color of the text, and Y represents the color of the background. There should be no space between Y and the comma. X and Y are values between 0 and 15, and the corresponding colors are as follows --

  0: Black  4: Red  8: Gray   12: Bright Red
  1: Blue  5: Purple  9: Bright Blue   13: Bright Purple
  2: Green  6: Brown  10: Bright Green   14: Yellow
  3: Light Green  7: White  11: Grass Green 15: Bright White

  If the background color is 8 to 15, it will cause a flashing effect, (Is this really the case?) So it is recommended to try to use colors 0 to 7. The settings using these colors will be restored to the original color state due to the loading of ANSI.SYS.

[ Last edited by Billunique on 2007-4-7 at 03:30 AM ]
★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲
Floor 11 Posted 2007-04-07 04:20 ·  中国 北京 雅虎中国
中级用户
★★
菜鸟总动员
Credits 259
Posts 112
Joined 2006-08-28 15:53
19-year member
UID 61454
Status Offline
Okay, let's move on to a more comprehensive example:


Menuitem=first_config,First Level Configuration Only
Menuitem=second_config,Second Level Configuration
Menuitem=net_config,Normal Configuration With Network
Menudefault=fir_config,30
Menucolor=15,1


Buffers=10
Device=C:\DOS\Ramdrive.sys


Buffers=20
Device=C:\CMouse.sys


Buffers=30
Device=C:\DOS\Himen.sys


Files=15
Device=C:\DOS\ANSI.sys

 After running, the screen will display:
MS-DOS 6.22 Startup Menu

1.First Level Configuration only

2.Second Level Configuration

3.Normal Configuration with Network

Enter a choice:1 Time remaining:28


F5=Bypass startup files F8=Confirm each line of CONFIG...

After 30 seconds, it will automatically run 1.

[ Last edited by Billunique on 2007-4-7 at 04:23 AM ]
★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲
Floor 12 Posted 2007-04-07 09:00 ·  中国 北京 雅虎中国
中级用户
★★
菜鸟总动员
Credits 259
Posts 112
Joined 2006-08-28 15:53
19-year member
UID 61454
Status Offline
5.Submenu Command

  In the option area, you can also use the Submenu command to divide the items on the startup menu into sub-items. So when you select this item, another string of submenus will appear on the screen immediately, making the structure of the options present a tree organization. The format is:
Submenu=BlockName
  
  The parameters BlockName and MenuText have exactly the same meaning as the parameters of the Memuitem command.

Menuitem=Ordinary
Menuitem=Special
Submenu=Combination


Menuitem=Text_Proc
Menuitem=Image_Proc


……

……

……

……

  After running, the screen displays:
MS-DOS 6.22 Startup Menu

1.Ordinary

2.Special

3.Combination

Enter a choice:3

F5=Bypass startup files F8=Confirm each line of CONFIG...

  If you choose the 3rd item Combination, the following screen will appear:
MS-DOS 6.22 Startup Menu

1.Text_Proc

2.Image_Proc

Enter a choice:1

F5=Bypass startup files F8=Confirm each line of CONFIG...


[ Last edited by Billunique on 2007-4-7 at 09:04 AM ]
★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲
Floor 13 Posted 2007-04-07 12:18 ·  中国 北京 雅虎中国
中级用户
★★
菜鸟总动员
Credits 259
Posts 112
Joined 2006-08-28 15:53
19-year member
UID 61454
Status Offline
### 6. Include Command

The Include command is applicable in the configuration section. When the configuration section needs to use the same settings as other configurations, this command can be used to include the contents of other configuration sections (Include) to avoid repeated writing. The format is as follows:
Include=BlockName

- **BlockName**: It is not limited to before or after, as long as it is within the file.

Now here is a relatively complete example:

Menuitem=Old_Proc,Old version Operation
Menuitem=Reg_Proc,Regular Operation
Menuitem=Dbase_Proc,Data Base Operation


device=c:\dos\himen.sys
device=c:\dos\emm386.exe noems(?)
dos=high,umb(?)
shell=c:\dos\command.com c:\dos /p(?)


device=c:\dos\setver.exe
include=Reg_Proc


buffers=30
files=30


device=c:\dos\ramdrive.sys 384,128,16/E(?)
lastdrive=E
buffers=30
files=20

- The running order in the MS-DOS Config file is:
1) DOS=High and DOS=UMB run first, and these two run in the order of arrangement. If Himen.sys or Emm386.exe has not been run at this time, DOS will be reserved first, and after Himen.sys or Emm386.exe is loaded, DOS=High and DOS=UMB will be run immediately.
2) Next, run the Config commands such as Device, Files, Buffers…DeviceHigh, Shell, etc. Each command runs according to the arrangement order.
3) Finally, run the Install command.

The above commands are scattered in multiple configuration sections. Then DOS will wait for the user to complete the configuration section selection, concentrate the selected configuration section and the Config commands in the Command section, and then run according to the above orders 1, 2, 3.

[ Last edited by Billunique on 2007-4-7 at 12:26 PM ]
★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲
Floor 14 Posted 2007-04-07 23:37 ·  中国 北京 雅虎中国
中级用户
★★
菜鸟总动员
Credits 259
Posts 112
Joined 2006-08-28 15:53
19-year member
UID 61454
Status Offline
Multi-configuration Autoexec.bat

  When using multi-configuration, DOS will create a dedicated environment variable Config to record which configuration section is currently running. According to this environment variable, you can make multiple Autoexec.bat files so that each set of configurations can correspond to separate batch files. This will make the configuration of each set of systems more personalized and will not interfere with other system configurations.

  How to make multiple Autoexec.bat files? You can use the Goto command and cooperate with the environment variable Config to run the corresponding part.

  The following is the Autoexec.bat file written specifically to respond to the previous example of the multi-configuration file:
@echo off
path c:\dos; c:\windows; c:\pctools8; c:\et31
prompt $p $g

goto %config% rem Record the name (BlockName) of the currently running configuration section

:Old_Proc
msav
goto End

:Reg_Proc
doskey
smartdrv
goto End

:Dbase_Proc
call et31
append c:\dbf
goto End

:End


[ Last edited by Billunique on 2007-4-7 at 11:46 PM ]
★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲
Floor 15 Posted 2007-04-08 07:12 ·  中国 北京 雅虎中国
中级用户
★★
菜鸟总动员
Credits 259
Posts 112
Joined 2006-08-28 15:53
19-year member
UID 61454
Status Offline
Addressing Capability of CPU

  Addressing capability refers to the address space that the CPU can access, that is, the number of addresses that can be combined by the CPU's address lines. The CPU uses address lines to select the address of the memory. Since each address line has two states, 0 and 1. So n address lines can select 2 to the power of n addresses.

  The following is the addressing capability of 80x86 series CPUs:

    CPU        Number of Address Lines    Addressing Capability
    8088/8086      20            1MB
    80286        24            16MB
    80386SX      24            16MB
    80386DX      32            4GB (4096MB)
    80486        32            4GB (4096MB)

The following is quoted from Redtek:)
  5. The address bus widths of 8080, 8088, 80286, 80386 are 16, 20, 24, 32 respectively, and their addressing capabilities are _KB, _MB, _MB, _GB.

    Answer: 8080 is: 64KB
      8088 is: 1MB
      80286 is: 16MB
      80386 is: 4GB

  6. The data bus widths of 8080, 8088, 8086, 80286, 80386 are 8, 8, 16, 16, 32 respectively, then how many B can they transfer at one time?

    Answer: 8080 is: 256B
      8088 is: 256B
      8086 is: 65536B
      80286 is: 65536B
      80386 is: 4294967296B

    1GB = 2 to the power of 10 MB (I don't know how to do superscripts, newbie here~)
      = 2 to the power of 10 * (2 to the power of 10 KB) = 2 to the power of 20 KB
      = 2 to the power of 10 * 2 to the power of 10 * (2 to the power of 10 B) = 2 to the power of 30 B
    1MB = 2 to the power of 10 KB = 2 to the power of 10 * (2 to the power of 10 B) = 2 to the power of 20 B


[ Last edited by Billunique on 2007-4-8 at 07:14 AM ]
★①②③④⑤⑥⑦⑧⑨⑩㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ【●】→←↑↓▲
Forum Jump: