Ch01 - How Hardware and Software Works Together

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 49

Chapter 1

How Hardware and


Software Work Together
You Will Learn…

How BIOS and device


How system resources
How hardware and drivers are used to
help hardware and
software interact send instructions to
software communicate
hardware

How different
The steps involved in
operating systems
booting your computer
work
Hardware and Software
Interaction: An Overview
• Software
• Intelligence of the computer
• Determines what hardware is present
• Decides how hardware is configured and used
• Uses hardware to perform tasks
• Consists of programs that instruct computers to perform
specific tasks
Hardware and Software
Interaction
Operating System (OS)

Software that controls a Communicates with hardware


computer using system resources
Manages hardware Does not relate directly with hardware; uses
Runs applications BIOS or device drivers for the interface
Provides user interface
Stores, retrieves, and manipulates files
Categories of PC Software

BIOS (BASIC OPERATING SYSTEM (OS) APPLICATION SOFTWARE


INPUT/OUTPUT SYSTEM)
AND DEVICE DRIVERS
Categories of BIOS (Firmware)
Programs

System BIOS Startup BIOS CMOS setup


To control I/O devices To control startup of To change setup
computer information
Device Drivers

• Small programs stored


on hard drive that tell
computer how to
communicate with an I/O
device
• Necessary for
communication between
OS and more complex
devices
Operating
System (OS)
Works with system
BIOS and device
drivers to provide
instructions to
hardware to
perform tasks
System Resources

Tools used by hardware or software All four types depend on certain


to communicate with the other: lines on a bus on the motherboard.
Memory addresses
I/O addresses
Interrupt request numbers (IRQs)
Direct memory access (DMA) channels
System Resources
The 8-bit and 16-bit ISA Slots

• 8-bit ISA bus had a limited number of system


resources available to it
• Number was increased with invention of 16-bit ISA
bus
• Each line on a bus can perform several functions
(multiplexing)
Interrupt Request Number
(IRQ)
• Line on a bus that a device uses to alert the CPU
that it needs servicing
• Interruptions to CPU are called hardware interrupts
• Polling is an alternative to an interrupt
Difference between Interrupt and
Polling
Interrupt Polling
In interrupt, the device notices the CPU that Whereas, in polling, CPU steadily checks
it requires its attention. whether the device needs attention.
An interrupt is not a protocol, its a hardware Whereas it isn’t a hardware mechanism, its
mechanism. a protocol.
In interrupt, the device is serviced by While in polling, the device is serviced by
interrupt handler. CPU.
Interrupt can take place at any time. Whereas CPU steadily ballots the device at
regular or proper interval.
In interrupt, interrupt request line is used as While in polling, Command ready bit is
indication for indicating that device requires used as indication for indicating that device
servicing. requires servicing.
In interrupts, processor is simply disturbed On the opposite hand, in polling, processor
once any device interrupts it. waste countless processor cycles by
repeatedly checking the command-ready
little bit of each device.
Common Uses for Some IRQs
16/32-bit ISA/PCI standard IRQ
IRQ Bus Type Typically used by
00 None Non-maskable Interrupt (NMI); system timer
01 None Keyboard port
Programmable Interrupt Controller (PIC); cascade to
02 None
IRQ 09
03 8/16-bit Communications Port 2 (COM2:)
04 8/16-bit Communications Port 1 (COM1:)
05 8/16-bit Sound card; printer port (LPT2:)
06 8/16-bit Floppy disk controller
07 8/16-bit Printer port (LPT1:)

An 8-bit ISA slot contains physical IRQ lines only for IRQ 02 through IRQ 07 because IRQ 00 and IRQ 01 are reserved for system
functions. A 16-bit ISA slot contains physical IRQ lines for IRQs 03 through 07, 09 through 12, 14, and 15. IRQ 09 is mapped to
IRQ 02, allowing 8-bit ISA cards to recognize IRQ 09 as IRQ 02. IRQs 00, 01, 02, 08, and 13 are not present in any slot, and so
cannot be assigned to devices.
16/32-bit ISA/PCI standard IRQ cont..
IRQ Bus Type Typically used by
08 None System CMOS/real-time clock
09 8/16-bit Redirected from IRQ 02; network interface
10 16-bit Network interface; USB host controller
11 16-bit Video adapter; SCSI host adapter
12 16-bit PS/2 mouse port
13 none Numeric data processor (math coprocessor)
14 16-bit Primary IDE interface
15 16-bit Secondary IDE interface
An 8-bit ISA slot contains physical IRQ lines only for IRQ 02 through IRQ 07 because IRQ 00 and IRQ 01 are reserved for system
functions. A 16-bit ISA slot contains physical IRQ lines for IRQs 03 through 07, 09 through 12, 14, and 15. IRQ 09 is mapped to
IRQ 02, allowing 8-bit ISA cards to recognize IRQ 09 as IRQ 02. IRQs 00, 01, 02, 08, and 13 are not present in any slot, and so
cannot be assigned to devices.
IRQs

• Preconfigured assignments make it


easier to configure devices and avoid
conflicts with other devices
• COM1 and COM2 (for serial devices
such as modems)
• COM1 was where the mouse
traditionally went. It was usually a 9-pin
port on the chassis, where as COM2 was
usually a 25-pin port. Most "modem
cables" came as 25-pin cables.
IRQs
LPT (line print terminal) is the
usual designation for a parallel
port connection to a printer or
other device on a personal
computer. Most PCs come with
one or two LPT connections
designated as LPT1 and LPT2.
Some systems support a third,
LPT3. Whatever the number,
LPT1 is the usual default.
IRQs
Use Device Manager to See
How IRQs Are Assigned
Use Device Manager to See
How IRQs Are Assigned
How to check?
Windows

IRQs Device Manager


• msinfo32.exe • Windows + X
• Hardware Resource • Device Manager
• IRQs • Or Control Panel
Memory Addresses

• Hexadecimal numbers, often written in


segment/offset form, assigned to RAM and ROM
so that the CPU can access both
How Memory Addresses
Are Assigned
• CPU has fixed number of memory addresses,
determined by CPU and the bus it is using
• They can be assigned to any type of physical memory
in the system that needs to be addressed by the CPU
• Once addresses have been assigned (usually during
boot process), CPU sees physical memory as a single
list that can be accessed using memory addresses
• Number of memory addresses partly depends on size
of memory bus
Division of Memory

Windows

Mac OS
Shadowing ROM

• Process of copying programs from ROM to RAM


for execution
• If ROM programs are executed directly from ROM
chips, memory addresses are assigned to this ROM
• If programs are first copied to RAM, and then executed,
the same memory addresses are assigned to this area of
RAM
• Also called shadow RAM
I/O Addresses

• Numbers the CPU can use to access hardware


devices, in much the same way it uses memory
addresses to access physical memory
• Also called port addresses or ports
DMA Channels

• Provide shortcut method so an I/O device can send


data directly to memory, bypassing the CPU
• A chip on the motherboard contains DMA logic
and manages the process
• Each channel requires two lines to manage it:
• One for DMA controller to request clearance from CPU
• One used by CPU to acknowledge that DMA controller
is free to send data over data lines without interference
from CPU
DMA Channels
Booting up Your Computer

• Refers to the computer bringing itself up to an


operable state without user intervention
• Hard boot (cold boot)
• Involves initially turning on power with on/off switch
• More stressful than soft boot because of initial power
surge through equipment
• Soft boot (warm boot)
• Uses OS to reboot
• Faster than hard boot
Plug and Play (PnP) Standard

• Simplifies installation of hardware devices


• Rather than having to reset DIP switches and jumpers,
OS and/or startup BIOS automatically configures
hardware devices to reduce or eliminate conflicting
requests for system resources
• Applies to OS, BIOS on the motherboard, and
BIOS on devices
Functions Performed
During the Boot
1. Startup BIOS tests essential hardware
components (power-on self test or POST)
2. Setup information is used to configure both
hardware and software
3. Hardware components are assigned system
resources they will later use for communication

continued…
Functions Performed
During the Boot
4. Startup BIOS finds the OS, which is loaded,
configured, and executed
5. Hardware devices are matched up with the BIOS
and device drivers that control them
6. Some application software may be loaded and
executed
Startup BIOS Controls the
Beginning of the Boot
• Startup BIOS is in control for first three steps and
beginning of the fourth, where control is turned
over to the OS
Steps in the Boot Process

• Step 1: POST
• Step 2: ROM BIOS startup program searches for
and loads an OS (most often from logical drive C
on the hard drive)
• Step 3: OS configures the system and completes its
own loading
• Step 4: User executes application software
Boot Step 1: POST
Boot Step 2: How BIOS
Finds/Loads the OS
Boot Step 3: Loading the
MS-DOS Core of Windows 9x
Autoexec.bat

• Stands for automatically executed batch program


• Lists OS commands that are executed
automatically each time OS is loaded
Typical Commands in
Autoexec.bat File
• Path command (eg, PATH C:\;C:\PCTOOLS;)
• Directs OS to look in two different directories for
program files
• Restart command (Restart.com)
• Causes system to reboot

continued…
Typical Commands in
Autoexec.bat File
• Set command
• Appends a path to Path command without editing
existing Path command line itself
(eg, SET PATH=%PATH%;C:\VERT)
• Creates and assigns a value to an environmental variable
that can later be read by an application (eg, SET
MYPATH=C:\VERT)
Chapter Summary

• How hardware and software work together


• What happens when a PC is turned on OS is loaded
• System resources
• Interrupt request number (IRQ)
• Memory addresses
• I/O addresses
• DMA channels
• Booting up the computer

You might also like