an overview of the pc pc and dos essentials. the components of a pc 1981 - the key year –the ibm...

99
An Overview of the PC PC and DOS Essentials

Post on 21-Dec-2015

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

An Overview of the PC

PC and DOS Essentials

Page 2: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

The Components of a PC

• 1981 - The Key Year– The IBM PC

– The Intel 8086

– DOS

• All versions of these items have been obsessed with backwards compatibility ever since!

Page 3: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

The Operating SystemDOS and Windows

• DOS, the operating system acts as a link between your PC hardware and your applications

• Windows 3.x is a further layer built on top of DOS

• Windows 95 is to a large extent independent of DOS

WINDOWS

DOS

HARDWARE

Page 4: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Storage Devices

• Floppy disks (diskettes)– Slow but convenient

– Hold only small amounts of data (1.44 MB)

• Hard disks– Fast

– Relatively cheap

– Hold large amounts of data

• Tape drives– Excellent for back-ups

• CD-ROMs– Excellent for storing data as reference material

– A convenient method for installing programs, such as Microsoft Office

Page 5: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

The Serial and Parallel Ports

• Parallel communication – Faster than serial communication

– Used to connect the PC to a printer

• Serial communication– Slower, used for connection to a modem

Page 6: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

The CPU (Central Processing Unit)

• The CPU is responsible for all calculations performed within the PC

• It determines how fast the PC will run and what systems will run on it

• Additionally, it gets involved in a host of other activities, such as overseeing the transfer of data from the hard disk into RAM

Page 7: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

The ROM-BIOS and the CMOS-RAM

• The ROM-BIOS – Read Only Memory - Basic Input Output

System

– Interface between DOS and the PC hardware

• The CMOS-RAM– Complementary Metal Oxide - Random

Access Memory

– A read/write chip

– Stores the system configuration, time and date as well as the power-on password (if you have set one)

Page 8: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

PC Interrupts

• 16 hardware interrupts• Allows items within the PC to signal to the CPU

that they require attention• Items must not use the same interrupt line• Use the MSD command to view interrupt usage• When a new card is installed into a PC you must

ensure that it does not try to use an interrupt that is already in use

Page 9: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

DMA (Direct Memory Access)

• DMA was introduced in 1981 with the release of the IBM PC– VERY SLOW!

• The original PC was based on the Intel 8086 CPU, which at the time was considered an OK sort of chip, running at a reasonable speed– To help out the CPU, the DMA was responsible for moving

information from the hard disk or floppy disk into memory, thus by-passing the CPU. This increased throughput and performance

Page 10: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Types of Bus Architecture

• ISA (Industry Standard Architecture) is the original PC bus architecture, introduced in 1981

• MCA (Microchannel Architecture) was introduced by IBM in 1987 and eliminated many of the ISA design bottlenecks

• EISA (Extended Industry Standard Architecture) was introduced in 1989

• Plug and Play is the latest solution and allows automatic hardware configuration

Page 11: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

‘Plug and Play’

• Provides a mechanism for automatically configuring any items you add to your PC

• Requires three elements to work successfully– The operating system must be Plug and Play aware

• Windows 3.1 is not Plug and Play aware, Windows 95 is

– The ROM-BIOS must be Plug and Play aware

– The cards themselves must be specially designed to be Plug and Play aware

Page 12: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Getting HELP Within DOS and Windows

• Help in DOS is limited– HELP

– command /?

– HELP command

• Most Windows applications (and Windows itself) contain tutorials, which are very useful for new users– As later versions of applications are released, the Help files

are often modified to give improved information concerning tips and tricks

– Context-sensitive Help should be invoked when F1 is pressed

Page 13: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Directories and Files

PC and DOS Essentials

Page 14: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

What are Directories?

• A convenient way of dividing up your hard disk

• Each application can be kept in it’s own directory– The root directory is called CD\

– A single . represents the current directory

– A double .. represents the parent directory

Page 15: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Manipulating Directories Under DOS

• Directory commands include:MD

CD

RD

TREE

DELTREE

DELTREE

Please take care using DELTREE

Page 16: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Manipulating Directories Using the Windows File Manager

• Run the File Manager program, by double clicking on the File Manager program icon, located within the Main group

Page 17: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

The DIR Command

• Switches include:

– /w

– /p

– /s

– /?

Page 18: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

What are Files?

• A file is a collection of information contained in a single unit, stored on disk

• The DIR command displays a list of files contained in the current directory (the current directory is the directory you are in at the time)

Page 19: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

File Naming Conventions

• There are very strict rules governing the naming of files• A file name can be up to 8 characters, with a 3

character file extension. You cannot use spaces (produced by pressing the spacebar) within a file name

• File names, must not contain the following characters:-

\ | * ? < > +

• You can use the underscore character– This is often useful for making a file name more readable. You can

use numbers as well as letters

Page 20: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Internal vs External DOS Files

• External DOS files are held on the disk, and loaded into your computers memory (RAM) only as and when required

• Internal commands are pre-loaded in your computers memory (RAM) when you switch on a DOS-based computer

Page 21: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Creating Text Files - EDIT vs COPY CON

• COPY CON is a useful technique for creating small text files

• Edit is useful for editing existing files or creating large complex text files

Page 22: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Renaming, Deleting and Undeleting Files

• DEL– Deletes files

• REN– Renames files

• UNDELETE– Undeletes deleted files

Give me my files back!

Beware of accidental file deletion!

Page 23: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Copying and Moving Files Under DOS

• COPY– Internal command

– Copies files

• XCOPY– External command

– More flexible than copy

• MOVE– External command

– Only works within a disk, not between disks

Everything well organized!

Page 24: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Copying and Moving Files Using the Windows File Manager

• Open the File Manager• Click on the File drop-down menu• Select the Copy or Move command

Page 25: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Viewing and Finding Files Within DOS

• View with the TYPE command

• Use DIR/s to find

Page 26: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Viewing and Finding Files Using the Windows File Manager

• Open the File Manager• Click on the File drop down menu• Select the Search command• Double click on an associated file to view the file

Associated files

Page 27: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Manipulating File Attributes

• Attributes– Read Only– Archive– System– Hidden

• Use of ATTRIB– R Read-only– A Archive– S System– H Hidden

• In Windows manipulated via the File Manager– File/Properties

Page 28: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Disk Fundamentals

PC and DOS Essentials

Page 29: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Types - Floppy Disks (Diskettes) and Hard Disks

• Hard disks– Non-removable– Inside your PC– Very fast– Hold large amounts of data

• Diskettes– Removable– Hold up to 1.44 MB– Very slow

Page 30: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Setting Up a Hard Disk From Scratch

• Low level formatting– Hard disk supplied with low level formatting– DOS FORMAT command will not low level format a hard

disk

• Partitioning – With FDISK

• High level formatting– Using DOS FORMAT command

Page 31: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Disk Partitions

• Options include setting up:– A single primary partition

– A single extended partition

– Multiple logical drives

• Manipulated via the DOS command FDISK– A logical drive is anything addressed by a drive letter

– If you have a single large primary partition, it is referred to as drive C:

– If you have an extended partition, use FDISK to split this into one or more logical drives

– Referred to as drive D: E: F: etc.

Page 32: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

High Level (Logical) Formatting

• Also called logical formatting

• All logical drives within hard disk partitions must first be formatted

• Use the DOS FORMAT command

• Only drive C: needs to be a system (bootable) disk

Page 33: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Diskette Formatting Considerations

• System and non-system diskettes

• Quick formatting

Non-System Disk!

?

Page 34: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Unformatting a Disk

• UNFORMAT

• When you format a disk, by default it saves information concerning the disks contents

• Providing that you use the UNFORMAT command immediately this information can be used to restore the contents of the disk

Page 35: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Copying and Labelling Diskettes

• DISKCOPY– Uses identical source and target diskettes

Page 36: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Speeding Up Disk Access With DEFRAG

• Removes file fragmentation

• Speeds up disk access

• Run DEFRAG if the disk appears slow

The effect can sometimes be dramatic

Page 37: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Buffers

• Used to speed up access from the disk

• Set up via the CONFIG.SYS

Page 38: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

SmartDrive

• Setup via the AUTOEXEC.BAT

• Can increase to AND from the hard disk

Page 39: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Disk Compression DBLSPACE and DRVSPACE

• Compresses data held on a disk, and increases the storage capacity

• Is it safe?

• What about disk performance?

Before After

Page 40: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Disk Structures

• Sides

• Sectors

• Tracks

• Clusters

Page 41: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

The DOS Boot Sequence

• The boot record

• Two hidden system files

• CONFIG.SYS

• COMMAND.COM

• AUTOEXEC.BAT

Page 42: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

RAM Disks

• You can treat part of your memory (RAM) as a virtual disk

• Accessed much faster than a real disk

• Useful with Windows, as you can create temporary files of a virtual disk (by pointing the TEMP= variable to the virtual disk, within the AUTOEXEC.BAT)

Page 43: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Memory Fundamentals

PC and DOS Essentials

Page 44: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Type of Memory Chips - RAM and ROM

• RAM– Random Access Memory

– Read/write memory

– DOS and application programs are loaded into RAM

• ROM– Read Only Memory

– Contains hard coded information that is used by the operating system

– ROM-BIOS

– Video ROM

– Hard disk ROM

Page 45: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

The IBM PC, the 8086 CPU and DOS

• The original IBM PC containing an Intel 8086 CPU and DOS were all released at the same time

• The original PC was designed around the Intel 8086 CPU and DOS in turn was designed to run specifically on the 8086 CPU

• DOS has since been left behind by the hardware, including the CPUs

It’s not 1981 anymore!

DOS

Page 46: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Conventional Memory

• Defined by addressing limitations of the 8086/8088 CPU

• Is the first 1 MB of memory

• Not protected

• Traditionally only 640 KB used by DOS and DOS applications

Page 47: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Extended Memory• Protected Memory above 1 MB

– Used by Windows and Windows applications– The original CPU for which DOS was designed only had 20

address lines, and could only address a maximum of 1 MB

– In 1984, with the release of the IBM AT based on the Intel 80286 CPU, the number of address lines was raised to 24, giving a maximum memory address range of 16 MB

– The first 1 MB was addressed in Real Mode, while the remaining 15 MB were addressed in Protected Mode and were referred to as Extended Memory

– 386/486-based PCs can, in theory, address 4 GB of memory

• Extended Memory Specification - (XMS)– Defines a standard used to access Extended Memory– DOS and Windows use a driver HIMEM.SYS to control access to

the XMS memory

Page 48: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Expanded MemoryAn Old Technology!

• Used only by certain DOS applications– Windows applications do not require Expanded Memory

– Used to extend the life of old 8086-based PCs (which could only address 1 MB of Conventional Memory)

– Modern DOS programs will tend to use Extended Memory rather than Expanded Memory

– Traditionally requires a special Expanded Memory card and a special device driver

– Requires a 64 KB page frame in the UMBs

• May now be emulated from Extended Memory by using the EMM386.EXE device driver

DEVICE=C:\DOS\EMM386.EXE

Page 49: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

The Upper Memory Blocks and the High Memory Area

• The UMB space is located between 640 KB and 1 MB

• The HMA is a 64 KB area just above 1 MB

ConventionalMemory

UMBs

HMA

0 KB

640 KB

1 MB

Page 50: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Using the UMBs and HMA - Devicehigh and Loadhigh

• Allows you to load items with the CONFIG.SYS and the AUTOEXEC.BAT above the 640 KB limit

• CONFIG.SYS– DEVICE=C:\DOS\HIMEM.SYS

– DEVICE=C:\DOS\EMM386.EXE

– DOS=HIGH,UMB

– DEVICEHIGH .....

• AUTOEXEC.BAT– LH .....

Page 51: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Virtual Memory - Used by Windows!

• Treats part of your disk as if it were memory– Used by Windows and Windows applications, but not

by DOS

– Transparent to Windows applications

– Only used when physical memory is full

– DOS was designed for the Intel 8086 CPU, which did not support Virtual Memory. Consequently, DOS does not support Virtual Memory

– Virtual Memory is used by Windows 3.1 which was designed to run on 286 and 386 CPUs (which do support Virtual Memory)

Page 52: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Examining Memory

• Use the MEM or MSD commands

• System Info is available via the Help drop-down menu of most modern Microsoft applications

Page 53: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Configuring Your PC

PC and DOS Essentials

Page 54: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

The DOS Boot Sequence

• ROM-based diagnostics run first• Then the Boot Record is executed• IO.SYS loads• MS-DOS.SYS loads• If a CONFIG.SYS is present, this is then loaded• COMMAND.COM is then loaded• Lastly, if present, the AUTOEXEC.BAT is loaded

Page 55: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Conditional Booting

• To completely by-pass the DOS configuration

• First either boot or re-boot the computer

• When you see the message ‘Starting MS-DOS’ ...– Either depress (and release) the F5 key

– or depress (and keep depressed) the Shift key

Page 56: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

The CONFIG.SYS

• The CONFIG.SYS file is optional and is used to customize the way your PC will work– For instance, it may be used to set up the country

characteristics for countries other than the United States (DOS is basically American and needs customization for proper use outside the USA)

• Device drivers are software that extend the function of DOS in a particular way– For instance, if you have installed a particular tape drive, you

may need to install a tape device driver (supplied by the tape manufacturer) that instructs DOS on how to talk to the tape drive unit

Page 57: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

The AUTOEXEC.BAT

• A batch file that executes automatically when you boot the PC

• Sets items such as the PROMPT and PATH

C:\DOS\SMARTDRV.EXE

@ECHO OFF

PROMPT $p$g

PATH C:\WINDOWS;C:\DOS

SET TEMP=C:\temp

MODE CON CODEPAGE PREPARE=((437) C:\DOS\EGA.CPI)

MODE CON CODEPAGE SELECT=437

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

Page 58: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

The DOS PATH

• The PATH command is normally set from within the AUTOEXEC.BAT

• Defines a search path for executable files or batch files (i.e. files that run when you type in the correct file name and press the Return key)– It is important to remember that by default DOS always

searches the current directory first (i.e. the directory you are in when you issue a command)

– The root directory of a disk will only be searched if it is the current directory, or if it is specified in the PATH statement

– Held as an environment variable, within the DOS environment • A small area of memory used for storing variables for use by DOS,

Windows or other applications

Page 59: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

The DOS Environment

• The DOS Environment is a small area of memory used by DOS, Windows and some other applications to store used items of information

• Standard items include the Path, Prompt and COMSPEC variables

• Windows uses the TEMP= variable to determine where to store temporary files

• Use the SET command to view the contents of the Environment

Page 60: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

‘Loading High’

• Since the release of DOS 5 elements of DOS may be loaded above 640 KB

• CONFIG.SYS– Use the DEVICEHIGH statement

• AUTOEXEC.BAT– Use the LH statement

• Allows you to free up Conventional Memory for use by DOS application programs

Page 61: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Configuring a Windows-Based PC

• Most Windows configuration is set via the Control Panel

Page 62: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Batch Files, I/O and Redirection

PC and DOS Essentials

Page 63: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

What are Batch Files?

• Batch files allow you to assign repetitive tasks to a small file which once created may be run as often as you wish

• Batch files have a .BAT file extension

• The AUTOEXEC.BAT is a batch file with the special property that it will run automatically each time you boot DOS

Page 64: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

REM and ECHO

• REM– This allows you to document a batch file– Not displayed on the screen

REM message

• ECHO – May be used to turn off echoing of batch file statements

ECHO OFF

– ECHO OFF often preceded by @, which turns echoing off for the line containing it

@ECHO OFF

– May be used to display (echo) messages to the screenECHO message

– May be used in batch files to activate the system bleepECHO ^G (CONTROL+G)

Page 65: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

GOTO and CALL

• GOTO– Allows you to go from one line to another, within the same batch file

– A single trip (no automatic return)

– You go to a label which is indicated by a preceeding colon (:)

• :START• TYPE C:\AUTOEXEC.BAT• PAUSE• GOTO START

• CALL– Used to transfer control from one batch file to another batch file

– When the second batch file has finished processing, control automatically returns to the original batch file

Page 66: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

PAUSE

• Used to temporarily suspend batch file processing

• By default displays a message‘Press any key to continue’

Page 67: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

I/O, Device Names and Redirection

• Standard devices include:– The console– The serial port– The parallel port– The console– The NUL device

• Standard Output– Informational output that is displayed on the console (screen) by

default – May be re-directed to the NUL device

• Standard Error– Information concerning errors that is displayed on the console– Cannot be re-directed to the NUL device

TYPE AUTOEXEC.BAT > LPT1:

XCOPY A:\ C:\ > NUL

Page 68: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Piping

• The output of one command is fed directly into a second command, and will modify the output, which is then displayed on the standard device (i.e. the screen)

• Used by certain DOS commands– MORE

– FIND

– REPLACE TYPE C:\WINDOWS\WIN.INI ¦ MORE

The output is modified so that it is displayed one screen at a time

Page 69: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Advanced Batch File Concepts

PC and DOS Essentials

Page 70: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

What are Variables?

• A variable is like a container such as a cup– The cup is always called a cup, but the

contents of the cup can change– For instance the cup may contain coffee or tea– But the container is still called CUP– DOS can use this idea of a named container,

i.e. variable

• The DOS path is held in a container called PATH, it is always called Path, but as we know the contents of the Path may be changed

PATH

C:\DOS

C:\DOS;C:\WINDOWS

OR

Page 71: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Command Line Parameter Substitution

• This concept allows you to run the batch file and specify parameters that are picked up by the batch file and used within it– Each parameter is separated by a space

BATCH_FILE Parameter1 Parameter2 Parameter3 ...

Page 72: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Environment Variable Substitution

• The DOS environment is a small area of memory used for storing variables

• Environment variables include:– PATH, PROMPT, TEMP, COMSPEC

• To set an Environment variable use the syntax:– SET variable= value

• To put an Environment variable into a batch file use:– %enviroment_variable_name%

• To add an Environment variable to the DOS path, use:– PATH=%PATH%;%1

– NB: This assumes that the existing path does not end with a semi-colon (;)

Page 73: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

IF EXIST

• Used to detect the existence of a particular file

• NOTE that this command will NOT detect the existence of a directory

IF EXIST C:\AUTOEXEC.BAT GOTO DONTCOPY

: DONTCOPY

Page 74: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

IF ERRORLEVEL

• Some DOS commands issue ERRORLEVEL reports on completion

• Also called return codes or exit codes– An Error level of 0 normally

indicates success

– An Error level above 1 normally indicates failure

IF ERRORLEVEL 3 GOTO SOMTHING_WRONG_3

IF ERRORLEVEL 2 GOTO SOMTHING_WRONG_2

IF ERRORLEVEL 1 GOTO SOMTHING_WRONG_1

IF ERRORLEVEL 0 GOTO NO_PROBLEM

ERRORLEVEL is supported by:

BACKUP CHKDSK

CHOICE DEFRAG

DELTREE DISKCOMP

DISKCOPY FIND

FORMAT GRAFTABL

KEYB MOVE

MSAV REPLACE

RESTORE SETVER

XCOPY

Page 75: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

DOSKEY Macros

• Use DOSKEY to create them• DOSKEY TA TYPE C:\AUTOEXEC.BAT• Similar to DOS-based batch files BUT held in

memory, not on the disk• Faster than Batch files• Volatile• Load via the AUTOEXEC.BAT if you want to make

them more permanent

Page 76: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Printers

PC and DOS Essentials

Page 77: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Types of Laser PrinterPCL vs Postscript

• PCL (Printer Control Language)– Not so good for DTP

– Device dependent

– Reasonably fast

– PCL5 used in HP LaserJet 4 series

– Normally used with resolution enhancement

• Postscript– Much more flexible and configurable

– Slower

– More expensive hardware required

– Ideal for graphics and DTP

– Device resolution dependent

Page 78: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Printer Considerations

• Important items to consider when specifying a printer are:– Speed

– Resolution

– Resolution Image Enhancement

– Printer memory

– Duplex printing

Page 79: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Printer Drivers for DOS and Windows

• Each DOS program requires its own printer driver

• All Windows programs use a single Windows printer driver

PRINTER DRIVER

Page 80: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Security, Backups and Viruses

PC and DOS Essentials

Page 81: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

What are Viruses?

• Viruses can cause permanent loss of data

• Viruses spread from one PC to another, even across networks

• ALWAYS use a virus checker on your disks

Suddenly, I do not feel so well!

Page 82: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Virus Protection Methods DOS and Windows

• MSAV– Run from the command line or

from the AUTOEXEC.BAT

• VSAFE– TSR program

– Constantly on alert for viruses

• Windows 3.1 is given anti-virus tools by DOS

Page 83: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Backups

• Under DOS – Use MSBACKUP

• In Windows– Open the File Manager and

click on the Backup command, located under the Tools drop down menu

Perform REGULAR backups!

Page 84: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Fixing Errors On a Disk

• Disks are physical devices, and disk drives are full of moving parts

• Like anything else, they are prone to wear and tear as they get older

• CHKDSK /F and SCANDISK can be used to fix a range of problems that may occur on your disks

Use SCANDISK rather than CHKDSK it is safer and more effective

Page 85: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Windows Fundamentals

PC and DOS Essentials

Page 86: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

The Advantages of Using Windows

• The Microsoft sales pitch– Multitasking

– Uses all available memory

– Has a consistent User Interface

– Allows programs to talk to each other

• The down side– Prone to crashing

– Does not multitask in a sensible way

Page 87: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Select, then Manipulate!

• The basic rule when using Windows!

Page 88: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Components of a Window

• The Title Bar

• The Menu Bar

• Borders

Page 89: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Maximizing, Minimizing and Restoring a Window

• Maximize– Causes the program to fill the whole

screen

• Minimize– Causes the program to be displayed

as an icon

• Restore– Restores an icon to a window, or a full

screen program to a window

Page 90: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Moving and Re-sizing a Window

• Any program displayed as a window within Microsoft Windows can be moved around on the screen

• Any program displayed as a window within Microsoft Windows can be re-sized either horizontally, vertically, or in two dimensions at the same time

Page 91: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Menus and Dialog Boxes

• All windows programs have drop down menus of one sort or another. The drop down menus within a Windows program allow you to interact with a program. For instance, most applications have a File drop down menu containing commands such as Open, Save, or Exit

Page 92: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Multitasking Within Windows

• When you multitask programs under Windows on your PC, they appear to run simultaneously– In fact each program is allocated a small proportion of the

CPUs attention and whilst one program is running, the other programs are temporarily suspended

– By default, all Windows applications will appear to run simultaneously, whilst DOS programs will only run when in the foreground

Page 93: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Using the Task List

• Displayed in a window and, as the name suggests, lists all the tasks (i.e. programs) that are currently running in memory

• Allows you to easily switch to any of the programs listed in it, or to close any program listed in it

• Can tile or cascade programs– This causes each separate program that is

running to be displayed either side-by-side, or in a layered fashion

• You can arrange the icons at the bottom of the screen

Page 94: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

The Program Manager, File Manager and Control Panel

PC and DOS Essentials

Page 95: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Program Manager Groups

• A number of standard groups are installed by default– Main group

– Accessories group

– Games group

– StartUp group

• Groups can be added, deleted or modified

Page 96: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Manipulating Groups and Adding Programs

• Click on File and select New

This dialog box is displayed when you create a new program group or program item

Page 97: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

File Manager Terminology

• It is important to understand the terminology associated with using the File Manager

Page 98: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

Directories and Drives

• Make sure that you know how:– To expand a directory level

– To expand all directory levels

– To indicate expandable branches

– To collapse a directory level

– To display a particular directory

– To change the active disk drive

Page 99: An Overview of the PC PC and DOS Essentials. The Components of a PC 1981 - The Key Year –The IBM PC –The Intel 8086 –DOS All versions of these items have

The Control Panel

• Allows you configure items including:– Colors and Fonts

– Ports

– Mouse and Keyboard

– Desktop

– Printers

– International settings

– Date/Time

– Sound and Drivers

– 386 Enhanced