The hardware and software interaction
in the PC is best understood in the context of a layered model.
Each layer provides services to the previous layer.
Overview
!
The end-user interacts with the PC via the Application Program.
She issues commands which are specific to the application program.
Typical application programs are: word processing, spreadsheet,
database, telecommunications, and personal information managers.
!
The actual computational work is performed by the Hardware.
The hardware generally consists of a microprocessor, RAM, custom
ICs, I/O devices, and on-line mass storage.
Application
Program & Hardware Interaction
!
An end-user creates a document employing the proprietary commands
of the word-processing program and then issues a save file command.
!
The word-processing program requests that the end-user provide
a name for the file.
? The word-processing program issues
a command to the hard disk controller to copy the document currently
held in RAM and onto the hard drive.
Limitations
of the Two-Layer PC Model
!
Each application program must have complete knowledge and mastery
of the intricacies of the computer hardware. This results in long
development times, duplicate efforts, staggering incompatibilities,
and inflexible, hardware-specific program code.
!
There is no control mechanism for application programs to share
disk space. Application programs have no means of knowing which
areas of the disk drive are currently in use by other programs.
!
The Operating System (O/S) is a layer of software that
provides a common interface between the Application Program and
the Hardware layers. The O/S isolates the application program
from the hardware.
!
There are many operating systems available for PC-compatible computers:
MS-DOS, OS/2, UNIX, Netware, and Windows-NT are among the most
popular.
!
An application program is written to run under the control of
a specific O/S. Most popular PC programs are MS-DOS applications.
OS/2 & Windows-NT emulate DOS function calls to provide compatibility
with existing applications.
!
MS-DOS (and its OEM derivatives) is the most popular PC operating
system. DOS is an acronym for Disk Operating System. The
name correctly suggests that:
The primary function of DOS is
to manage and allocate disk space for application programs.
!
Its secondary function is to provide access to standard I/O such
as keyboards, serial ports, parallel ports, and video displays.
Three-Layer
Model Sample Interaction
!
An end-user creates a document employing the proprietary commands
of a word-processing program and then issues a save file command
and provides a file name.
!
The word-processing program executes a DOS function call. It provides
the file name, size of the file and location in RAM, and requests
that DOS create a disk file.
!
As the manager of disk space, DOS maintains a file allocation
table (FAT) on each hard drive and floppy diskette. The FAT has
an entry for every storage unit on the drive. Each FAT entry specifies
if the particular storage unit is Free, In-Use, or Bad.
!
DOS creates a directory entry for the file and allocates the appropriate
number of disk storage units for the file's data.
? DOS commands the disk drive controller
to copy the data from the RAM onto the specified storage areas
on the disk drive.
Limitations
of the Three-Layer PC Model
!
IBM compatible PCs are based on the Intel series of microprocessors;
from the original 8088/8086 through the Pentium. Due to differences
in the five generations of microprocessors and custom chip-sets
the specific characteristics of PC-compatible system boards are
extremely diverse.
!
However, MS-DOS is a generic Intel microprocessor O/S; it functions
on any PC-compatible computer. DOS doesn't distinguish between
the different generations and capabilities of microprocessors
and specific system board designs.
!
A general-purpose O/S doesn't usually directly communicate with
the hardware.
!
Consequently, there must be an additional layer which provides
the interface between the O/S and the custom PC hardware.
Protected mode is the native mode
used in Novell NT, OS2 Warp. Real mode becomes interpreter of
DOS collapses 16 MB capability down to 1MB. Windows 95 - 95% in
Protected Mode, 5% in Real mode.
The Four-Layer
PC Model
The BIOS ROM
!
The BIOS ROM (Basic Input/Output System, Read-Only Memory)
is an IC on the system board which is customized for a specific
microprocessor/system board implementation.
!
It contains dozens of low-level, routines which directly drive
the system hardware. DOS calls BIOS routines, and the BIOS translates
these requests for services into the specific commands required
to drive the hardware.
!
Typical BIOS routines are: access the disk drive to read or write
a sector of data, send a character to an LPT: port, access a COM:
port to read/write serial data, read the keyboard buffer, send
characters to an EGA adapter. This is a limit.
!
Because of the many types and capabilities of VGA chip-sets, VGA
adapters have their own custom BIOS ROM.
!
Every system BIOS must be a 100% compatible super-set of the original
1985 IBM-AT BIOS.
!
Most system board manufacturers don't write their own BIOS; they
license them from BIOS specialty companies like AMI, Phoenix,
or Award.
In addition to dozens of low-level
hardware interface program routines, the BIOS ROM contains the
Power-On Self Test program. On power-up, the microprocessor executes
the POST. A typical POST performs these actions:
Flash ROMS are reprogrammable 75
or so time.
BIOS Supported Devices
PCs have expansion slots in which
to accommodate third-party I/O adapters. (Appendix-A contains
a concise summery of the five PC bus standards.) The BIOS was
designed to support standard DOS addressable resources-devices
that can be directly accessed via application programs or from
the DOS command prompt:
!
Floppy disk drives
!
ST-506 compatible hard disk systems (ST=Seagate Technology) Antique
IBM's used these IDE driver)
!
RS-232 asynchronous serial ports; called COMmunications ports.
!
Centronics parallel interface ports; called LPT (Line PrinTer)
ports.
!
An advanced set-up screen to support the custom, sophisticated
chip-set functions. With few exceptions, this set-up screen is
never modified.
APPLICATION
PROGRAM AND FOREIGN HARDWARE INTERACTION
Many popular devices and expansion
cards don't enjoy MS-DOS or system BIOS support:
!
Pointing devices
!
Network Interface Cards (NICs)
!
SCSI Host Adapters
!
Sound Cards
!
Proprietary CD-ROM Adapters
!
CD-ROM Drives
!
Terminal Emulation Cards
Consider the operation of a serial
mouse:
!
Hardware Layer: The mouse
is connected to the system board via a serial port. There are
many different hardware layer mouse standards that define the
physical interface, and the speed and content of the mouse bit
stream.
!
BIOS Layer: MacIntosh and
RISC workstations have a dedicated mouse port and the equivalent
of BIOS-level mouse routines. The PC system BIOS doesn't support
pointing devices.
!
Operating System: Graphical-based
operating systems like OS/2 and Windows-NT have complete mouse
support. Text-based MS-DOS doesn't support pointing devices.
!
Application Layer: As pointing
devices gained popularity, many DOS application programs added
mouse support.
FOREIGN HARDWARE AND DEVICE DRIVERS
In a system which lacks BIOS and
O/S support, how do the application program and mouse interact
without violating the hierarchy of the layered-system architecture?
!
A device driver is a program that provides support for
foreign hardware. Device drivers are usually simply called "drivers"
as in Mouse driver.
!
DOS device driver file names often have a SYS, BIN, DRV, EXE,
or COM extension.
!
The device driver bridges the Application Program and Hardware
Layers by providing the equivalent functions of the BIOS and O/S
layers.
!
Device drivers are programs written to run under control of a
particular O/S. Consequently, for every foreign device the hardware
manufacturer must write a unique device driver for each O/S they
support.
MS-DOS Device Driver Implementation
The first file DOS reads during the
boot process is the system configuration file-CONFIG.SYS. One
way to provide mouse support is to place the statement DEVICE=MOUSE.SYS
in CONFIG.SYS.
!
IRQ designates a Hardware
Interrupt Request. Most I/O devices are assigned the exclusive
use of an IRQ. When the I/O receives data or has important status
information information it activates the IRQ to get the attention
of the system microprocessor.
!
INT designates is a software
interrupt; essentially a single-byte jump instruction. INTs are
used by the O/S to request various BIOS services. Device drivers
hook INTs to provide the equivalent of O/S-level services to application
programs.
!
Usually IRQs are exclusively assigned and not shared. However,
it's common practice to have several devices drivers hook the
same INT.
Norton NDIAGS, QEMM MFT. PS2 uses
IRQ12 and system board 8 pin Dinn.
The TSR-Terminate,
but Stay Resident Device Driver
An alternative mechanism to create
device drives is the TSR. For the purposes of this course the
only functional difference between a traditional device driver
and a TSR is:
!
A DEVICE= type device driver statement must be placed in the CONFIG.SYS
file. It is loaded on boot and cannot be removed without rebooting
the computer.
!
A TSR type device driver can be loaded from any batch file or
executed from the DOS command line. In the best case, a TSR can
be removed from memory, or at least, suspended.
!
Certain functions must be implemented as a DEVICE= driver in CONFIG.SYS.
Examples are memory managers, disk compression drivers, Microsoft's
NDIS network drivers, scanner drivers, and SCSI host adapter drivers.
!
Many drivers are only implemented as TSRs. Examples are Novell's
network drivers, DOS screen font drivers, and Microsoft's CD-ROM
extensions software.
!
Some software-only drivers (such as SMARTDRV) can be implemented
as either DEVICE= or TSR-type drivers. Each method has certain
advantages.
!
A Mouse driver is usually provided in two forms: A .SYS file for
CONFIG.SYS and a .COM TSR driver. The TSR driver is usually preferred
because of its flexibility.
!
Some drivers are not loaded by DOS, but rather by a specific application
program or operating environment. Drivers for Microsoft Windows,
including the mouse and video drivers, are loaded by the Windows
boot loader. These drivers are specific (modems, tape backups)
to Windows and are not accessible during DOS sessions.
TSRs go in AUTOEXEC.BAT.
LAB: Setting Up
and Verifying the Equipment
Each group will use either a desktop
or a notebook computer. The equipment is shipped in two types
of cases. The large cases contain one desktop computer and its
associated components. The smaller cases contain two identical
notebook computers and sets of associated components.
Step 1) Verify the Contents of
the Case.
If you are missing any of these components,
or you have extra components, please notify the instructor immediately.
Desktop Unit Case Check List:
Q
System Unit
Q
Keyboard
Q
LCD Display
Q
Mouse
Q
Power Cord
Q
Centronics-to-Centronics SCSI Cable
Q
Centronics SCSI Terminator
Q
Dual-Headed LapLink Cable for remote control lab
Q
Norton Rescue Diskette
Notebook Unit Case Check List:
Q
Notebook Computer with PCMCIA SCSI Adapter
Q
Toshiba AC Adapter and power cable
Q
Ball Point Mouse
Q
Black Bus Toaster or white Slim SCSI Cable
Q
External SCSI Drive and standard power cable
Q
Centronics SCSI Terminator
Q
Norton Rescue Diskette
Step 2) For Desktop Computer Setup
and Checkout
!
Place the system unit on the tabletop, insert the power cable
and connect it to the power strip.
!
Connect the keyboard.
!
Connect the mouse to the 9-pin serial port.
!
Connect the LCD display with the proprietary connector. Be careful
to ensure that the connector is properly orientated.
!
Apply power and boot the system. The brightness and contrast are
adjusted by pressing the buttons on the front of the display.
!
The system should boot DOS and display the C: prompt. There should
be a C: drive that is greater than 200-Mbytes and a D: drive that
is approximately 50Mbytes.
!
Run Windows and ensure that the mouse is functioning.
!
If the system doesn't boot properly or Windows won't run, carefully
record any symptoms or error messages and contact the instructor.
Step 3) For Notebook Computer
Setup and Checkout
!
The external SCSI hard drive and cable will not be installed until
the SCSI Lab. Please leave them in the case for now.
!
Place the notebook computer on the tabletop and open the display.
!
Connect the output of the power adapter to notebook and connect
the input of the power adapter to the power strip with the special
Toshiba power cord.
!
Snap the Microsoft Ball Point Mouse onto the QuickPort on the
right side of the notebook computer.
!
Press the power switch on the left side of the notebook for about
1 second to apply power.
!
The system should boot DOS and display the C: prompt.
!
Run Windows and ensure that the mouse is functioning.
!
If the system doesn't boot properly or Windows won't run, carefully
record any symptoms error messages and contact the instructor.
PCSup1./CS.5