DOS Basic Concept _dos/bat

Source: Internet
Author: User
Tags current time dbase
Early computer systems usually consist of central processing units (CPUs), memory, peripherals, and so on, and users often monopolize all of the computer's resources. For example, when a computer prints through a printer, other devices are waiting, so that the computer is inefficient and the user waits a long time.
With the development of computer, especially the new development of computer software, the system software-operating system, which is specially used to solve the above problems, appears. The tasks of the operating system are:
(1) CPU management--a reasonable allocation of CPU to each task.
(2) Memory management--allocating storage properly.
(3) External equipment management--rational use of peripherals.
(4) Information management-automatic management of files.
After using the operating system, the user is no longer a bare metal (computer hardware), but the operating system, the operating system becomes the user and bare metal interface.
DOS is the most basic operating system software, DOS is the abbreviation of the English disk Operation system. The DOS operating system used by microcomputers is primarily a pc-dos developed by MS-DOS and IBM developed by Microsoft Corporation in the United States. Since its inception in 1981, DOS operating system software has undergone a process of continuous improvement and refinement, and its version is also from the original 1. 0, gradually developed to so far has been widely used in 5. 0, 6. 0, 6. 22 and so on. A DOS6.22 version of MS introduced here includes a number of novel, powerful commands.
functions of DOS system
Each part of a computer system should coordinate work, give full play to its efficiency, need a manager to reasonably dispatch its various resources---hardware and software resources, DOS operating system is such a manager.
The resources in a computer system are typically grouped into four categories: Processor (CPU), memory, external devices, and information. The DOS operating system has the management function of these four resources.
Early PC series computer use of the CPU model is 8088 (8086), nearly more than 10 years, the advent of 80286, 80386, 80486 and 80586 (also known as Pentium, in the translation of "Pentium") more and more powerful. DOS 6. 22 supports all of the above CPUs.
Using 8088 or 8086CPU of microcomputers, limited by the conditions at the time, the ability to access memory limited to 1MB, RAM capacity in memory generally 640KB, the early version of the DOS is designed for the hardware.
Although the advanced CPU can manage the range of memory has reached 16MB (80286) and 4096MB (80386, 80486), the version of DOS also upgraded to 5. 0, 6. 0, 6. 2., however, to keep up with the low version of DOS compatibility, DOS still restricts the memory space that users can use directly to 640KB, which is also called basic memory.
start of DOS system
1. the composition of DOS system
A DOS system consists of a set of important programs provided by a floppy disk or hard disk. The core of the DOS system consists of three boot modules and a boot program (boot), and three boot modules are input/output modules (io.sys), file modules (Msdos.sys), and command processing modules (Command.com). The role of the bootstrapper is to load two suppressed DOS boot modules Io.sys and Msdos.sys into memory when the computer starts. Io. The main role of SYS is to manage input/output devices. Ms-dos. The purpose of SYS is to manage disk files and system resources. COMMAND. COM is the outermost module of the entire DOS system, and its task is to interpret and execute the commands entered by the user.
2. start of DOS system
To use the DOS system on disk, the DOS system must be transferred into the computer's internal memory, which is called the DOS system boot.
In addition to booting on the boot DOS (this startup, generally known as cold start), in the microcomputer operation, if for some reason, the computer running in the "dead cycle" or other "panic" situation, also need to reboot DOS (this startup, generally known as hot start). Press the (Ctrl) 10 (ALT) 10 (Del) key to reboot the DOS. Some microcomputer panel is equipped with a button (Reset), press the button can also reboot DOS.
DOS boot can be split from floppy disk (a drive) to boot and boot from hard drive (also known as C disk) to start two kinds. For the computer equipped with hard disk, the priority of these two approaches can be set through the modification of CMOS. If the priority set is "A:,c:", then start in drive A to find out if there is a DOS system, and then boot from a disk, if not from the hard drive C to find a DOS system; Conversely, if the priority is set to "C:,a:", then start from hard drive C to find the DOS system, If you do not find it from floppy disk a again.
In the DOS file, there are also two important files, which are in the root directory of the same boot disk:
(1) Config.sys is a system configuration file. Users can use it to advance the arrangement of memory, and so on, so that the system's hardware to play a better role.
(2) Autoexec.bat is a batch file that is automatically executed by the system at startup. It can
Automatically executes a series of DOS commands (internal commands and external commands) before the user performs a keyboard operation, which sets the system environment variable, search path, System prompt, screen, or printer mode, and can start the user program.
(3) to 80286, 80386, 80486 for the CPU of a variety of computer mainframe equipped with high-energy batteries, in the shutdown, the clock can continue to run, when the boot can automatically read out the date and time.
"Example" starts the DOS with a floppy disk
(There are no Autoexec.bat files on this disk).
Insert the boot disk into a drive and close the door.
The following information is displayed on the screen after the boot:
Current date is Wed ll-24-1993
Enter new Date (mm one DD one yy):
If the display date and day date error, you can enter the correct value (in the format: Month-day-year) and then press ENTER to correct, or directly press ENTER. After the date is asked, the following information is displayed on the screen:
Current time is 11:52:50.38a
Enter New Time:
The operation of the query time can be handled as a date operation.
The flag that starts the normal end is a DOS prompt a:\> on the screen, which means that the microcomputer is currently under the control of the DOS system and waits for the user to enter the command. The letter "a" means "current Disk" is a disk. When a computer is equipped with more than one disk drive, such as disk A, B, and C, the command to set a disk to the current disk is:
D: (Enter) (d: for the letter)
To convert the current disk from a to C, the following underlined section should be key:
A:\>c: (Enter)
Screen display:
c:\>
"Example 2. 1. 2 "Boot dos with hard drive C."
A drive door is not closed.
After the boot, the screen generally displays the following contents:
c:\>
file
The information on the disk is stored and managed in the form of a file under the DOS operating system. In computer science, a file is a set of related information that can be a program, data, sound, game, or other information that is generally recorded on a storage medium (such as a disk). Each file has its own name, called the filename. When you need to use a file, the DOS system can find the file correctly and read, write, and so on as long as the corresponding file name is indicated.
1. Name of File
To distinguish between different files so that files are executed, modified, and searched, the DOS operating system requires that the file name be composed of the file's main name and extension. The format is as follows:
--------. --
A decimal point can consist of 1-8 characters, called the primary name. A decimal point can be made up of 0-3 characters, called an extension.
For example: G9401. DBF, here G9401 is the main name, DBF is the extension. The characters that can be used by the file's primary and extension names are:
(1) English letter: A-Z (equivalent to case)
(2) Number: 0-9
(3) Chinese characters
(4) Special symbol: $#&@ ()-[]^~, etc.
Spaces, various controls, and the following characters cannot be used in file names:
. "/\<) 10:;, *?
Because these characters have been done with it.
Since there are some names that have special meaning in DOS, we cannot use them for file names, such as:
con-Master Console (screen or keyboard)
com1-〉 non-synchronous communication transmission port (serial port)
The name of the file, in addition to generally comply with the DOS system of the Convention, can be determined by the user. In order to facilitate management and memory, it is recommended to use English or Chinese pinyin with a certain meaning in the name and extension.
If you can use Letter01.txt to represent a letter with an ordinal number of 01, gz9601.dbf the Payroll database for a unit in January 1996.
2. multi-literal file name and filename wildcard characters
A filename is typically used to specify a file. When used in practice, it is sometimes necessary to process a batch of files simultaneously. For example, to copy several files at a time, or to list a group of related file names, we can use wildcard characters "? "and" * "to deal with, so that you can easily achieve the purpose.
(1) character "? ": Indicates that the position can be any one character.
(2) The character "*": indicates that it can be any string starting from its location.

Files represented by Polysemy file names

*. 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 name extension
File extensions under DOS systems have some special meaning, and some can be generated automatically by some specific software.
Special Extensions:
Name extension A special definition
Com Executable files
Exe Executable files
BAT Batch File
SYS System configuration File

Specific software-generated extensions:

Name extension Specific software
Bak Alternate files, such as old files kept by word processing software
Bas Program files generated by Basic language
Dbf DBASE (or Foxbase) system-generated database files
PRG DBASE (or Foxbase) system-generated program Files
DOC Document files produced by word processing software
C C language-generated program files

file directory
1.tree-like directory
When a disk is initialized, the directory is created, which is called the root of the disk, and we can put the file in the root directory in turn.
As disk technology grows and disk capacity grows, it is no longer difficult for a single disk to hold hundreds of files. However, putting a large number of files in the root directory poses two problems:
The first is that the root directory of the DOS system can hold the maximum number of files is limited, 360KB disk's root directory to accommodate up to 112 files, 1. 2MB and 1. A 44MB disk can hold up to 224 files, and the second is to centralize a large number of files in a directory, and users and DOS systems are inconvenient to operate.
It's like the library's management of books: If the books you buy are numbered in the order in which they were purchased, will be to find and so on the work brings many inconvenience, therefore the library divides the book into the language, the mathematics, the foreign language and so on big class, the Chinese class may divide into the elementary school, the middle school and so on the small class to manage, its shape like an upside down tree.
Similarly, the DOS system uses thetree-like directoryStructure, that is, DOS system not only allows files in the directory, but also allows the establishment of its subordinate directory in a directory, called a subdirectory, if necessary, users can be in the subdirectory to establish the subdirectory of the child directory; So on a disk, its directory structure may be a subdirectory of a root directory and several subdirectories and subdirectories ... Constituted.
With the tree directory structure, we often put the same application system files in a subdirectory, or the same type of files in a subdirectory, or for different users to set up different subdirectories, each using their own subdirectories, non-interference.
2.file Identifiers
With a tree directory structure, in a disk to indicate a file, not only to give the file name, but also give the file path-find the way. When you want a computer to do something, you have to tell the computer where to take it and put it where it is, as if you were writing the address of the addressee and the writer on the envelope instead of writing the name on the letter. A DOS path is a set of directory names that go from the root directory (or the current directory) to the specified file, and if the first symbol in the path is a backslash ("\"), it represents the root directory. The individual directory names are also separated by backslashes ("\").
On a computer, often install several drives, so that dos in the file operation to indicate a file, must give the following three elements: disk, path, file name, these three elements constitute a file identifier. The general form of the file identifier is:
"Disk" and "path" (filename)
The path and file name are generally separated by a backslash ("\").

Based on 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 to have the same name.
It's as if two rooms in the same building are not allowed to use the same number, but the two rooms in different buildings are allowed to use the same number.
A DOS system treats a subdirectory as a special file, so there are three elements to indicate a subdirectory: disk, path, subdirectory name. The general form of the directory identifier is:
[Letter "[Path] (subdirectory name)
The path and subdirectory names are generally separated by backslashes ("\").
On a disk that has a tree directory, there are a number of different directories, a root directory, a subdirectory, a level two subdirectory 、......, and a directory called the current directory (called the current path for the file). So how do you identify the current disk, the current directory? If you perform a DOS command prompt $p$g (This command is described in the operating system), the first letter of a string of characters before the prompt ">" is the current disk, and 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.