Basic DOS concepts

Source: Internet
Author: User
Tags dbase

Early computer systems were generally composed of CPU, memory, external devices, and other components. Users often exclusive to all computer resources. For example, when a computer prints data through a printer, other devices are waiting. In this way, the computer is very inefficient and users are waiting for a long time.
With the continuous development of computers, especially the new development of various computer software, there has been a system software specifically used to solve the above problems-the operating system. The operating system task is:
(1) CPU management-Rationally allocate the CPU to each task.
(2) memory management-Rationally allocate memory.
(3) external device management-use peripherals reasonably.
(4) Information management-automatic file management.
After the operating system is used, the user is no longer facing a bare metal (computer hardware), but an operating system. The operating system becomes an interface between the user and bare metal.
DOS is the most basic operating System software, and DOS is short for Disk Operation System. The DOS operating system used by the microcomputer is mainly the MS-DOS developed by Microsoft and PC-DOS developed by IBM. Since the birth of the DOS operating system software in 1981, it has undergone a process of continuous improvement and improvement. Its version also starts from the first 1.0, 5.0, 6.0, 6.22, and so on. Here we will introduce the MS-DOS6.22 version, including many novel and powerful commands.
Functions of the dossystem
All parts of a computer system must be coordinated to make full use of its efficiency. A manager must reasonably schedule its various resources-hardware and software resources, the DOS Operating System is such a manager.
Resources in computer systems are generally divided into four types: CPU, memory, external devices, and information. The DOS operating system manages these four resources.
The CPU models used by early PC series computers were 8088 (8086). Over the past decade, 80286, 80386, 80486, and 80586 (also known as PENTIUM ") more and more features. DOS 6.22 supports all the preceding CPUs.
A 8088 or CPU microcomputer is limited to 1 MB for memory access due to the current conditions. The RAM capacity in the memory is generally 640KB, earlier DOS versions were designed for the above hardware.
Although the range of advanced CPU-managed memory has reached 16 MB (80286) and 4096 MB (80386, 80486), the DOS version has also been upgraded to 5.0, 6.0, 6.2 ..., However, to maintain compatibility with earlier versions of DOS, DOS still limits the memory space that users can directly use to kb, which is also called Basic memory.
Dossystem startup
1. Composition of the DOS system
The DOS system is composed of a group of important programs provided by a floppy disk or hard disk. The core of the DOS system is composed of three Boot modules and one Boot program. The three Boot modules are the input/output modules (IO. SYS), file module (MSDOS. SYS) and COMMAND processing module (COMMAND. COM ). The Bootstrap program is used to load two hidden DOS Startup modules, IO. SYS and MSDOS. SYS, into the memory when the computer starts. IO. SYS is mainly used to manage input/output devices. MS-DOS.SYS is used to manage disk files and system resources. COMMAND. COM is the outermost module of the entire DOS system. Its task is to explain and execute user-entered commands.
2. dossystem startup
To use the DOS system on the disk, you must transfer the DOS system to the computer's internal storage, which is called the startup of the DOS system.
In addition to DOS boot (this kind of boot is generally called cold boot), if for some reason, when the microcomputer runs in an "endless loop" or other "dead" situation, DOS needs to be restarted (this kind of start is generally called Hot Start ). Press (Ctrl) Ten (Alt) Ten (Del) to restart DOS. Some microcomputer panels are equipped with a button (Reset). You can also press this button to restart DOS.
DOS boot can be divided into two types: starting from A soft disk (drive A) and starting from A hard disk (drive C. For a microcomputer with a hard disk, you can set the priority of the two methods by modifying the CMOS. If the priority is set to "A:, C:", you must first check whether there is a dos system in drive A at startup, and then start from drive, if no, search for the DOS system from hard drive C. If the priority is set to "C:, A:", search for the DOS system from hard drive C at startup, if no disk is found, search for it from disk.
There are two important DOS Files in the root directory of the same boot disk:
(1) config. sys is the system configuration file. The user can use it to pre-define the memory arrangement, and so on, so that the system hardware can play a better role.
(2) autoexec. bat is the batch processing file automatically executed at startup specified by the system. It can
A user automatically executes a series of DOS commands (Internal commands and external commands) Before performing keyboard operations. It can set system environment variables, search paths, system prompts, screen or printer modes, you can also start user programs.
(3) high-energy batteries are installed in hosts with CPUs of 80286, 80386, and 80486. After shutdown, the clock can continue to run and the date and time can be automatically read at startup.
[Example] Start DOS with a floppy disk
(There is no autoexec. bat file on the disk ).
Insert the boot disk into drive A and close the door.
The following information is displayed on the screen after the instance is started:
Current date is Wed ll-24-1993
Enter new date (mm dd yy ):
If there is an error between the displayed date and the date of the current day, enter the correct value (in the format of month-day-year) and press the Enter key to correct it. Otherwise, press the Enter key directly. After the query date, the following information is displayed on the screen:
Current time is 11:52:50. 38a
Enter new time:
The query time can be processed in the same way as the date operation.
A dos prompt A: \> appears on the screen, indicating that the microcomputer is currently under the control of the DOS system, waiting for the user to enter the command. The letter "A" indicates that the "current disk" is disk. When the microcomputer is equipped with more than one disk drive, such as disk A, disk B, and disk C, the command to set A disk as the current disk is:
D :( press Enter) (d: drive letter)
To convert the current disk from drive A to drive C, use the following underline:
A: \> C :( press Enter)
Screen Display:
C: \>
[Example 2.1.2] use hard drive C to start DOS.
Do not close drive.
After the device is turned on, the following content is displayed on the screen:
C: \>
Text
In the DOS operating system, the information on the disk is stored and managed in the form of files. In computer science, a file refers to a set of related information. It can be a set of program, Data, sound, game, or other information, which is generally recorded on a storage medium (such as a disk. Each file has its own name, called a file name. When you need to use a file, you only need to specify the corresponding file name, And the DOS system can find the file accurately and perform read and write operations.
1. File Name
To differentiate different files for File Execution, modification, and search, the DOS operating system requires that the file name consists of the file Master name and extension. The format is as follows:
□□□□□□□□. □□□□□
The name can be 1-8 characters before the decimal point. It can contain 0-3 characters after the decimal point, which is called the extension.
For example, G9401.DBF. G9401 indicates the Master name and DBF indicates the extension. The main file name and extension can contain the following characters:
(1) English letter: A-z (case-insensitive)
(2) number: 0-9
(3) Chinese Characters
(4) special symbols: $ # & @ ()-[] ^ ~ .
Space characters, various control characters, and the following characters cannot be used in the file name:
. "/\ <) 10 :;,*?
Because these characters have already been used.
Some names have special meanings in DOS, so we cannot use them as file names, for example:
CON-Console (screen or keyboard)
COM1-> non-synchronous communication transmission port (Serial Port)
The naming of a file should be decided by the user on his/her own, except for complying with the DOS system conventions. To facilitate management and memory, we recommend that you use the primary name and extension with a certain meaning in English or Chinese pinyin.
For example, letter01.txt can be used to indicate a letter with the serial number 01, and GZ9601.DBF can be used to represent the salary database of a certain organization in January.
2. Multi-definition file names and file name wildcards
A file name is generally used to specify a file. In actual use, you sometimes need to process a batch of files at the same time. For example, to copy several files at a time or list a group of related file names, we can use the wildcard "?" And "*", so that you can easily achieve the goal.
(1) character "?" : Represents any character at this position.
(2) character "*": indicates that it can be any string starting from its position.

File in the Multi-definition file name table

*. DOC test1.doc test2.doc
T *. * test1.doc test2.doc temp1.dot temp2.d te1.6a
? R *. * program1.prg program2.prg graph. img gra. img
PRO *. * program1.prg program2.prg
G ??. * Gl. dbf g. bas gra. img
GR ?. * Gra. mg
TE ?? 1. * te8t1.doc temp1.dot
TEST ?. * T68t1.doc t68t2.doc
*.?? Te1.ba letter
3. File Extension
The file extension in the DOS system has some special meanings, and some can be automatically generated by some specific software.
Special extension:

Extension Special Definition
COM Executable files
EXE Executable files
BAT Batch File
SYS System Configuration File

Extensions generated by specific software:

Extension Specific software
BAK Backup files, such as the old files retained by the word processing software
BAS Program files generated in BASIC
DBF Database files generated by the dBASE (or FoxBASE) System
PRG Program files generated by the dBASE (or FoxBASE) System
DOC Document generated by WORD processing software
C C Language Program Files

File directory
1. Tree directory
A directory is created when a disk is initialized. This directory is called the root directory of the disk. We can place the files in the root directory in sequence.
With the development of the disk technology, the disk capacity is getting bigger and bigger. It is no longer difficult for a disk to accommodate hundreds of files. However, placing a large number of files in the root directory brings about two problems:
First, the maximum number of files that can be accommodated in the root directory created by the DOS system is limited. The root directory of the 112 KB disk can accommodate up to 224 files, and the MB and MB disks can accommodate up to files; second, a large number of files are concentrated in a directory, which is disorganized and inconvenient for users and the DOS system to operate.
This is like the management of books in the library: if the books purchased are numbered in the order of purchase, it will cause a lot of inconvenience to the searching and other work, therefore, the library divides books into Chinese, mathematics, foreign languages, and other categories. The Chinese classes can be further divided into small classes such as primary and secondary schools for management. Its shape is like a inverted tree.
Similarly, the dossystem uses a tree directory structure, that is, the dossystem allows not only to store files in the directory, but also to create its sub-directory in a directory, called a sub-directory; if necessary, you can create sub-directories in the sub-directories ;....... In this way, on a disk, its directory structure may be composed of a root directory, several subdirectories, and subdirectories ...... .
With the tree directory structure, we usually put files of the same application system in a sub-directory, or put files of the same type in a sub-directory, you can also create different sub-directories for different users. Each user uses their own sub-directories and does not interfere with each other.
2. File Identifier
With the tree directory structure, you must specify a file in a drive, not only the file name of the file, but also the path of the file-find path. When you want a computer to do things, you need to tell the computer where to get and put it. It's like you write the recipient's address on the envelope when sending a mail, you cannot simply write a name. In DOS, a path is a group of directory names that reach the specified file starting from the root directory (or the current directory, if the first symbol in the path is a backslash ("\"), it indicates the root directory. Different directory names are also separated by backslash,
Several drivers are often installed on a microcomputer. In this way, DOS must specify a file during file operations and provide the following three elements: drive letter, path, and file name, these three elements constitute a file identifier. The file identifier is generally in the following format:
Drive letter path (file name)
The path and file name are generally separated by a backslash.

According to the concept of file identifiers, it is not difficult to understand:
(1) in the same directory (that is, the same path), DOS does not allow two files with the same name.
(2) In different paths, DOS allows two or more files with the same name.
It seems that the same number is not allowed for the two suites in the same building, but the same number is allowed for the two suites in different buildings.
The DOS system treats a subdirectory as a special file when creating a sub-directory. Therefore, it is necessary to specify a sub-directory with three elements: drive letter, path, and sub-directory name. The directory identifier is generally in the following format:
[Drive letter "[path" (subdirectory name)
The path and subdirectory names are generally separated by a backslash.
On a disk with a tree directory created, there are many different directories, including the root directory, level 1 subdirectory, level 2 subdirectory ,......, One directory is called the current directory (for files, called the current path ). So how to identify the current disk and current directory? If you run the doscommand PROMPT $ P $ G (this command is described in the operating system), the first letter in the string before the PROMPT ">" is the current disk, A string of characters before the colon to the prompt ">" is the current directory.

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.