Ana səhifə

Appendix e: ms-dos


Yüklə 0.5 Mb.
səhifə5/8
tarix25.06.2016
ölçüsü0.5 Mb.
1   2   3   4   5   6   7   8

Disk Based Operating Systems

The Disk Operating System (DOS), as the name implies is an Operating System on Disk. This was rather significant, as many personal computers available at the time of the PC's launch in 1981, had all the Operating System (OS) permanently stored in a ROM chip. Having the OS, or part of it on disk, offers advantages to the end user and the OS manufacturer alike. Of course modern GUI operating systems like Windows 95/98/ME/2000/NT are also disk operating systems

Having an operating system on disk rather than permanently stored in ROM allows the end user to update the OS to keep pace with new developments in both hardware and software. It also offers greater flexibility, as the system can be easily configured to suit the users needs. Hardware items such as a mouse, graphics pad, scanner, sound card, CD-ROM drive, to name a few, can easily be added to the list of items recognised by the operating system.

From the manufacturer’s point of view, a disk based OS has a monetary advantage as it allows new versions and upgrades to be launched. This in turn has a knock on effect of increasing the saleable life of the product. A firmware (ROM based) operating system would be far more difficult for the end user to install and this would adversely effect volume sales and the long term success of the product.



The Configuration Files


MS-DOS provides two configuration files named config.sys and autoexec,bat, these are automatically executed after the system has booted. When a card or peripheral is added to a DOS based PC system, these files are updated with the driver software supplied with the device. This allows DOS to serve the new item just like any other installed device.

Device drivers are small programs (routines) that allow DOS to recognise devices and parameters that are not part of the normal PC system. Items such as a mouse, scanner, printer, sound card, graphics card, and CDROM drive are usually supplied with their own driver software, that must be installed along with the hardware.




CONFIG.SYS


Config.sys resides in the root directory of the boot disk and is executed automatically after the system has booted.

The main purpose of config.sys is to:

(i) make DOS aware of extra driver software,

(ii) allow system memory space for information processing and

(iii) configure the system to conform to international standards.

To inform DOS of the new driver software, a device statement is installed in config.sys (or sometimes in autoexec.bat). DOS itself provides a handful of standard device drivers, these are listed in table 3.1.7.

Device drivers provided with MS-DOS 6.22


ANSI.SYS

DISPLAY.SYS

DRIVER.SYS

EGA.SYS


RAMDRIVE.SYS

INTERLNK.EXE

POWER.EXE


Table 7

CONFIG.SYS COMMANDS


To effect a user installable device driver facility, DOS provides a set of commands that can be added to the config.sys file. The purpose of each command is described below:
COMMAND PURPOSE

BREAK Enables more frequent checking of the Ctrl-C or control-Break, keys.

BUFFERS Sets the number of sector buffers.

COUNTRY Allows international time, date, and currency to be set.

DEVICE Installs a particular device driver in the system.

DRIVPARM Defines parameters for block devices.

FCBS Sets the number of File Control Blocks that can be opened concurrently.

FILES Sets the number of files that can be opened at once.

LASTDRIVE Sets the maximum number of drives that can be accessed.

SHELL Change to a user defined command processor.

STACKS Specifies the no. memory stacks for hardware interrupts.
Table 8
Don't worry if some of these terms sound like double-Dutch – they do to most people meeting DOS for the first time. The important thing to do is to at least make yourself aware of config.sys and autoexec.bat files. They are not used on Windows 2000 systems or on new Windows ME systems, however they are still found frequently on Windows 95 /98 systems. This is particularly the case on systems upgraded from DOS or Windows 3.1. The less used commands are often inserted automatically when new driver software is installed. The more you get your hands on older systems, the more quickly you will feel at home using Config.sys and Autoexec.bat.4
The example config.sys file below, shows some of the more widely used commands.

BREAK=ON


FILES = 50

BUFFERS = 30

COUNTRY = 044, , C:\DOS\COUNTRY.SYS

DEVICE = C:\DOS\SETVER.EXE

DEVICE = C:\MOUSE\MOUSE.SYS

LASTDRIVE = f


Each of the commands in the above config.sys file will now be explained briefly:
The ‘BREAK = ON’ command tells MS-DOS to check for the ‘Ctrl-C’ or ‘Ctrl-Break’ key combination as often as possible. (This key combination normally only allows a break to take place during a printing process to screen or printer.) Depending on the software in use, the BREAK = ON command may enable the break key sequence during disk processing or program execution.
FILES = 50 allocates space in memory for information on up to twenty open disk files called by MS-DOS. The maximum number of files that can be opened at once and called by MS-DOS by this command is 255.

Note for the inquisitive reader:

The maximum number of files that can be opened by an application program in MS-DOS is 65534. This is achieved when the program executes interrupt 21h, service 67 effectively overriding the config.sys limit of 255.

BUFFERS = 30’ allocates a block of memory as a ‘disk buffer’. This allows MS-DOS to hold data in the buffer area during disk reading and writing. Each buffer takes up 512 bytes of memory so this particular command line allocates 10k bytes of memory as a disk buffer, reducing the amount of conventional RAM available for applications. In a simple DOS based system, the use of buffers can increase the performance of disk operations. Many DOS based word processors insist on a minimum buffer size.


COUNTRY = 044, , C:\DOS\COUNTRY.SYS’, tells MS-DOS to follow the UK Date, Time and number format. The number 044 is the international dialling code for the UK. A common failure to insert this command results in the default American date and time formats. The statement following the two commas indicates the path to DOS's country.sys command. If country.sys is placed in the root directory, then this statement is not necessary, however it is neater to leave it as it is, in the DOS directory.
Together with the ‘KEYB UK’ command in autoexec.bat, these commands tell the system to use British characters and key functions. For example the full ‘A to Z’ alphabet, ‘£’ sign, ‘day/month/year’, and ‘24 hour’ time format, is adopted.

If you wish to write a letter in French for example, then you can change the Country value in config.sys to 033 and the KEYB command in autoexec.bat, to KEY FR.


'DEVICE = C:\DOS\SETVER.EXE' This loads a table called the 'version table' into memory. This is contains a list of the DOS version that each program on the disk was originally designed to run on. Most DOS programs run on any DOS version without problems. However some must be loaded into the version table so that DOS can trick the application into thinking that the correct version of DOS is present. To load a particular program to the version table the command SETVER filename n.nn is used. For example to place a DOS 3.3 program called 'pack1.exe' into the version table using DOS6.22, the command SETVER pack1 3.3 is used.

To see the contents of the version table you simply enter setver.


'DEVICE = C:\MOUSE\MOUSE.SYS' installs the mouse driver, mouse.sys allowing MS-DOS to communicate with the mouse hardware when required. The disk supplied with the mouse package usually contains a mouse.sys and a mouse.com file. This allows the mouse to be configured from either config.sys or autoexec.bat respectively. See the example config.sys file on page 3.37.
'LASTDRIVE = f ', This command simply specifies the maximum number of drives that can be accessed form DOS, in this case six drives, a:,b:,c:,drive:,e:,and f:.

BATCH FILES

A batch file is a sequence of DOS commands saved in a file with a ‘.BAT’ extension after the name. When the batch file called up via the keyboard or via another program, each command is executed in sequence.


As a simple example of a bat file we will assume we have a wordprocessor program called myword.exe, saved in a subdirectory of the apps directory, named wordproc. See the directory structure in figure 3.1.

Figure 13


To run the program called myword we must enter the path followed by the filename thus, C:\apps\wordproc\ myword,
To save having to type this each time we want to execute the program, we will make a batch file named word.bat that runs the program by simply entering the name word.
To do this we could enter the following from the root directory of drive C using the DOS copy to Console command (copy con):
copy con word.bat press enter

c:\apps\wordproc\ myword press enter

lastly hold down the Ctrl key and press the z key, i.e. Ctrl z, to save the file.


The file called word.bat is now saved to the root directory of drive c: To run myword

now all we have to do is type word and then press enter.



AUTOEXEC.BAT

Any batch file labelled ‘AUTOEXEC.BAT’ will run automatically when the system has booted. This is a useful facility in aDOS based machine as it allows the user to run a chosen application immediately the system is booted. For example a computer system can be made to automatically run a wordprocessor program by inserting the path and file name in the autoexec.bat file.

The normal use of autoexec.bat however is to automatically run DOS commands, allowing the system to be configured as required. It may seem strange that config.sys and autoexec.bat are both used to configure the system. The reason for this is that autoexec.bat can run normal DOS commands whereas config.sys contains files that can only be read and processed by the hidden DOS boot program called ‘IO.SYS’, when the system is booted.

A simple autoexec.bat file is shown below:

@ECHO OFF

PATH C:\;C:\DOS;C:\APPS\WORDPROC;C:\UTILS

PROMPT CURRENT DIRECTORY $P$G

KEYB UK,, C:\DOS\KEYBOARD.SYS

Each line of the above autoexec.bat file will now be explained briefly:
ECHO OFF’, prevents each line being executed, from appearing on the screen, a process known as ‘echoing’. ‘ECHO ON’ enables screen echoing. The ‘@’ sign placed before the ECHO command, prevents the command itself from echoing on the screen.

PATH C:\;C:\DOS;C:\APPS\WORDPROC;C:\UTILS’, tells MS-DOS which directories, and in what order, it must search for external commands. For example from the directory structure of figure 13, to run myword.exe in the wordproc directory, instead of using a separate bat file as shown earlier, we simply include its path in autoexec.bat. i.e., C:\APPS\WORDPROC.

From the PATH statement in autoexec.bat: After the system has booted and confi.sys and autoexec.bat have executed, typing ‘myword’ followed by the ENTER key, in the root directory would force MS-DOS to first first search for the command in the root directory, then in DOS and finally in WORDPROC. The use of the semicolon ';' in the path statement, allows several paths to be specified in one line.

NOTE: Entering ‘PATH’ on its own, shows the current path setting on the screen.



'PROMPT current directory $p$g', changes the normal default DOS prompt to display the current directory name, the time and date, or any text the user wishes. In this case the words ‘current directory’ followed by the working directory, and the ‘>‘ character are shown.

'KEYB UK,, C:\DOS\KEYBOARD.SYS', this configures the keyboard for UK English and therefore enables the full ‘QWERTY’, alphanumeric characters and special symbols like the ‘£’ sign. This is used to complement the COUNTRY= 044 command in config.sys.


BATCH PROCESSING COMMANDS



COMMAND PURPOSE

Call
Echo

For (in, do)
Goto

If


Pause
Rem

Shift

Runs a second batch file and then returns to the first one.
ECHO ON displays a message on screen, ECHO OFF stops messages being displayed.
Runs a specified command for each file in a group of files. It must be used with IN and DO.
Allows the batch file sequence to be processed at another part of the batch file, pointed to by a label name.
Carries out a command or sequence of commands depending on the logical result of a specified condition.
Stops a batch file from continuing until a key is pressed.
Placed before the text, allows notes (REMarks), to be made about each part of a batch program.
Changes the position of replaceable parameters.


Table 9

The autoexec.bat file can contain any DOS commands well as the batch processing commands shown above.



1   2   3   4   5   6   7   8


Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©atelim.com 2016
rəhbərliyinə müraciət