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-07-31 14:45
中国DOS联盟论坛 » DOS学习入门 & 精彩文章 (教学室) » [Repost] A Brief Talk on MS-DOS View 5,215 Replies 7
Original Poster Posted 2003-04-22 00:00 ·  中国 台湾 桃园市 远传电信
元老会员
★★★★★
Credits 8,312
Posts 3,551
Joined 2003-03-22 00:00
23-year member
UID 1225
Gender Male
Status Offline
1. What is DOS?
The so-called DOS is the abbreviation of "Disk Operating System". Translated into Chinese, it means "disk operating system".
The collection of programs in which computer designers organize and arrange the programs that drive the hardware, along with some essential and commonly used programs needed when using a computer, is called an operating system (Operation System, abbreviated as OS). It controls the various components of the computer equipment, and at the same time is responsible for supervising, coordinating, and directing the work among those components.
DOS is one kind of operating system mainly centered on disk operations, called the Disk Operating System (abbreviated as DOS). The DOS developed by Microsoft is MS-DOS, while the operating system for the IBM-PC is called PC-DOS. Its main function is to manage the data on disks, which is why it is called DOS - Disk Operating System, disk operating system.
The main functions of DOS:
1. Managing access to data on disks
No matter what kind of data it is, it must normally be stored on disk, and when it is needed, the data is then loaded from the disk into the computer. This job is carried out by DOS. Therefore DOS plays the role of an intermediary between the user, the computer, and the application program, that is, the so-called interface (Interface). As for the management of disk data, it includes displaying the disk directory or the contents of data, formatting disks, copying and deleting data, and so on.
2. Coordinating and directing the operation of various peripheral devices
Whether you want to print out a document through a printer, or use a mouse to run some software, and so on, the operation of these peripheral devices must also be supervised and managed through DOS.
3. Setting up the computer operating environment
Since the various components of a computer can be freely combined according to the user's preferences and abilities, it is necessary to set up an optimal operating environment according to the hardware equipment, such as: how much memory is available for use, the setting of the virtual disk drive, how many data files can be opened at one time, and so on. After all these are set by DOS, the application programs then run according to the configured operating environment.
MSN:tiqit2@hotmail.com
Floor 2 Posted 2003-04-22 00:00 ·  中国 台湾 桃园市 远传电信
元老会员
★★★★★
Credits 8,312
Posts 3,551
Joined 2003-03-22 00:00
23-year member
UID 1225
Gender Male
Status Offline
The five major boot-up steps:
1. Turn on the computer power.
2. Self-Test
After the power is turned on, a system program inside the computer called BIOS (Basic Input/Output System) starts to run. BIOS first checks all of your hardware equipment, including memory, keyboard, disk drives, monitor, and even the printer; all of these are within its inspection range. If there is a problem with any device, BIOS will display the cause of the error on the screen. If the error is serious, it may even fail to boot.
3. Load DOS
DOS contains three files:
   IO.SYS            input/output control part       MSDOS.SYS          system logic execution part     COMMAND.COM        command processing execution part    
4. Loading DOS means loading these three files into memory. If these three files cannot be loaded successfully, the following error message will appear on the screen:
      Non-system disk or disk error                 Replace and strike any key when ready         
5. This tells us: "This is a boot disk without a DOS system, or the data on the disk cannot be read. Please replace it with the correct disk, and press any key."
6. If DOS is loaded successfully, BIOS hands over control to DOS. From this point on, the computer is managed by DOS.
7. Load CONFIG.SYS (not required)
After DOS has been successfully loaded into memory, it will try to search for a rather special file: CONFIG.SYS. We call this file the "configuration file". Its function is to set up the DOS operating environment. If DOS cannot find this file, DOS has its own default environment settings. Therefore, even if CONFIG.SYS cannot be found, the computer can still be used normally.
8. Load AUTOEXEC.BAT (not required)
Finally, DOS will search for another special file: AUTOEXEC.BAT. We call this file the "automatic batch file". It can save you from having to enter some routine working commands every time after booting, such as setting the DOS prompt, setting the file search path, and so on. At this point, the boot-up process is complete.
MSN:tiqit2@hotmail.com
Floor 3 Posted 2003-04-23 00:00 ·  中国 台湾 桃园市 远传电信
元老会员
★★★★★
Credits 8,312
Posts 3,551
Joined 2003-03-22 00:00
23-year member
UID 1225
Gender Male
Status Offline
1. Tree structure
╭───────╮
│ (ROOT) C: │
╰───┬───╯

┌─────┼──────┐
┌─┴─┐ ┌─┴─┐ ┌─┴─┐
│ ET3 │ │DOS62 │ │ PE2 │
└─┬─┘ └───┘ └─┬─┘
┌───┴───┐ ┌────┴┬─────┐
┌─┴─┐ ┌──┴┐┌─┴─┐ ┌─┴─┐ ┌─┴─┐
│ UTL │ │ DMO ││ BAK │ │ DOC │ │ TXT │
└───┘ └───┘└───┘ └───┘ └───┘
1. Root directory - abbreviated as root (ROOT or \), created when the disk is FORMATted. This directory always exists, cannot be deleted, and after the system is activated you enter the root directory.
2. Subdirectory - all directories other than the root directory are subdirectories. There is no limit to the number of levels of subdirectories.
3. Working directory - the directory you are currently in is called the working directory (Working directory) or current directory (Currtent directory ), and can be represented by ".".
4. Child directory - a directory directly derived from another directory is called that directory's child directory (Child directory).
5. Parent directory - the direct source of a child directory is called that child directory's parent directory (Parent directory), and can be represented by "..".
6. Path - the connection between directories and directories (or files) is called a path (PATH).
7. Pathname - the string formed by all directory and file names on a path, separated by "\", is called a pathname (Pathname).
EXAMPLE:
(1)C:\PARK.COM
(2)C:\DB3\SALES.PRG
(3)C:\PE2\DOC\HW.TXT
(4)C:\DOS\DOS62\FORMAT.COM
(5)C:\ET3\UTL\SETHRC.COM
If there are hundreds of files on a disk, and they are all put together without being categorized, then it would be very inconvenient when trying to find and use a particular file. Therefore we must store files in separate categories, and that is how the concept of directories came about. Usually we use many directories to divide the entire disk space into several areas. Each directory can store different files, and the files in each directory are completely independent and do not interfere with each other.
In order to make it easier to manage a large number of directories, DOS adopts a so-called "hierarchical" directory management method. That is, within each directory, many more directories can be created below it for classification. Since each directory can generate more directories below it, we call the directories generated under a certain directory its "child directories". The directory above each directory is called that directory's "parent directory" or "ancestor directory". The very topmost directory is called the "root directory". Therefore the root directory can have many child directories, but it cannot possibly have a parent directory. For any directory, there can be many child directories, or there can be no child directories at all, but there must be one and only one parent directory (except for the root directory).
Directory naming rules
Since there may be many child directories under one directory, and for the sake of distinction, each directory must have a name. The naming rules for directories are as follows:
· Root directory - uses the backslash ( \ ) as its name.
· Subdirectory - named by the user; the naming rules are exactly the same as file names.
· Parent directory - represented by ".." (two consecutive periods).
· Current directory - represented by "." (one period).
Another point to note is that within the same directory area, two files or subdirectories with the same name cannot exist at the same time. However, as mentioned earlier, the files in each directory are completely independent and do not interfere with each other, so files or subdirectories with the same name can exist in different directory areas.
MSN:tiqit2@hotmail.com
Floor 4 Posted 2003-04-23 00:00 ·  中国 台湾 桃园市 远传电信
元老会员
★★★★★
Credits 8,312
Posts 3,551
Joined 2003-03-22 00:00
23-year member
UID 1225
Gender Male
Status Offline
2. Path (PATH)
Since the space on a disk is divided into several directory areas, when I want to specify a certain file, besides telling DOS the drive letter of the disk drive, I must also tell DOS which directory area the file is located in. This indication of the directory area where a file is located is the so-called concept of a path. To describe a path, the following two formats can be used:
┌─────────────────────────────┐
│Format 1: │
│ drive letter:\directory1\directory2\directory3\...\filename │
│ │ │ │ │
│ starting from the root directory, used to separate each └>also separated from the filename by │
│ level of directory "\" │
│ │
│Format 2: │
│ drive letter:directory1\directory2\directory3\...\filename │
│ │ │
│ └>without a backslash it means starting downward from the current directory area │
│ │
└─────────────────────────────┘
EXAMPLE:
(1)C:\PARK.COM
(2)C:\DB3\SALES.PRG
(3)C:\PE2\DOC\HW.TXT
(4)C:\DOS\DOS62\FORMAT.COM
(5)C:\DOS\DOS33\FORMAT.COM
MSN:tiqit2@hotmail.com
Floor 5 Posted 2003-04-23 00:00 ·  中国 台湾 桃园市 远传电信
元老会员
★★★★★
Credits 8,312
Posts 3,551
Joined 2003-03-22 00:00
23-year member
UID 1225
Gender Male
Status Offline
MS-DOS internal commands
DOS commands are divided into two major categories: internal commands (Internal Command) and external commands (External Command). DOS classifies some commonly used commands as internal commands, while the less frequently used ones mostly belong to external commands. The main reason DOS divides commands into internal and external is to save memory. If some infrequently used commands were also kept resident in memory, the efficiency of memory usage would be reduced.
After the user enters a DOS command, the command is analyzed by COMMAND.COM. COMMAND.COM is called the command processor, and its function is to determine whether the command entered by the user is an internal command or an external command. If it is an internal command, it is immediately handed over to IO.SYS or MSDOS.SYS for processing. But if it is an external command, then it looks for that file on the disk. If it is found, control is transferred to that file, which means the command is executed. If the file cannot be found, the screen will display
  Bad Command or filename         
such an error message.
1. Internal commands and external commands
o Internal commands
Internal commands are hidden in the two files IO.SYS and MSDOS.SYS. When booting with DOS, these two files are loaded into memory and remain resident all the time. Therefore, after DOS boots, internal commands are always available.
o External commands
External commands are stored on disk in the form of files, and are loaded into memory from disk only when needed. In other words, external commands are not always available; it depends on whether that file exists on the disk.
2. Commonly used internal commands
DIR (list the contents of a directory), DIRectory, abbreviated as DIR
MKDIR (create a subdirectory), Make Directory, abbreviated as MD
CHDIR (change the working directory), Change Directory, abbreviated as CD
COPY (copy one or more files)
REN (change a filename), REName, abbreviated as REN
DEL (delete one or more files), DELete, abbreviated as DEL
TYPE (list the contents of a file)
PROMPT (symbol parameters or text)
DATE (display, setting, and management of the system date)
TIME (display, setting, and management of the system time)
CLS
VER (display the current DOS version), VERsion, abbreviated as VER
PATH path1;path2;path3;......
VOL (display the disk volume label), Volime label, abbreviated as VOL
MSN:tiqit2@hotmail.com
Floor 6 Posted 2003-04-23 00:00 ·  中国 台湾 桃园市 远传电信
元老会员
★★★★★
Credits 8,312
Posts 3,551
Joined 2003-03-22 00:00
23-year member
UID 1225
Gender Male
Status Offline
DOS external commands
1.FORMAT drive:
〔Function〕 format a disk or hard disk
2.UNFORMAT drive:
〔Function〕 recover data on a diskette or hard disk
3.SYS drive:
〔Function〕 transfer DOS's three system files IO.SYS, MSDOS.SYS, and COMMAND.COM to the specified disk
4.UNDELETE drive:path filename
〔Function〕 recover deleted data on a diskette
5.DELTREE path
〔Function〕 can delete the specified subdirectory together with the files in it, or that subdirectory itself in one go
6.MOVE
┌ source ┐ ┌─ destination ─┐filename
〔Function〕 move files according to the specified path, and filenames can also be changed at the same time
7.XCOPY source destination
〔Function〕 file-to-file copying, but can also copy files in subdirectories together
8.DISKCOPY (copy an entire disk)  DISKCOPY source drive: destination drive:  C:>DISKCOPY  
? EXP:  C:>DISKCOPY A: B:  
If only the first drive is specified, then the current drive will be taken as the destination disk drive. For a brand-new unformatted disk, DISKCOPY will format while copying; for a formatted disk, it only copies the disk contents. 〔Function〕 copy an entire disk track by track
9.MEM 
〔Function〕 display memory usage
10.LABEL
〔Function〕 set or cancel the disk volume label
11.APPEND   path1;path2;path3;...
〔Function〕 set the search path for data files
12.ATTRIB path filename
〔Function〕 change or display file attributes
MSN:tiqit2@hotmail.com
Floor 7 Posted 2003-04-23 00:00 ·  中国 台湾 桃园市 远传电信
元老会员
★★★★★
Credits 8,312
Posts 3,551
Joined 2003-03-22 00:00
23-year member
UID 1225
Gender Male
Status Offline
Creating and using batch files
A so-called batch file (Batch file) is a file composed of one or more DOS commands. It is an executable file that can be run directly under DOS. When a batch file is executed, DOS will execute the commands contained in that batch file in sequence. Therefore, using a batch file can avoid repeatedly entering the same commands and save time.
DOS has the following points to note regarding batch files:
1. The extension of a batch file must be .BAT.
2. The commands that can be included in a batch file are: (1) DOS internal commands, (2) DOS external commands, (3) the main name of an executable file, and also (4) commands used specifically for batch files.
3. When executing a batch file, you only need to enter the main name of the batch file.
4. The execution priority of batch files is lower than .COM and .EXE, so try to avoid using the same main filename as a .COM or .EXE file.
5. Pressing CTRL-C or CTRL-BREAK can interrupt a batch file that is currently executing.
In addition, there are some commands intended specifically for use in batch files:
ECHO descriptive text
ON|OFF
〔Function〕 (1) display the specified descriptive text on the screen     (2) whether the commands executed in the batch file are displayed on the screen
PAUSE   
〔Function〕 pause execution of the batch file, and display the message Press any key to continue…… on the screen.

CALL batch filename
〔Function〕 call another batch file from within a batch file
REN descriptive text
〔Function〕 add comment text to a batch file to improve the batch file's readability.
MSN:tiqit2@hotmail.com
Floor 8 Posted 2017-09-21 02:40 ·  中国 海南 海口 电信
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
Featured version?
1<词>,2,3/段\,4{节},5(章)。
Forum Jump: