Chapter 4

advertisement
Operating Systems – DPR355
Chapter 4
Linking the Components
4.1 Bus Lines

A bus is a ribbon-like set of parallel wires that can carry several bits at a time (i.e. power,
data, etc).

Some bus lines transmit power. Others carry instructions, data, addresses, or commands.

On some computers, a single bus might serve two or more purposes; on others data,
addresses, or commands are separate.

Computer’s internal components are linked by bus lines.
4.2 Word Size

On most systems, the internal components are designed around a common word size. For
example, on a 32-bit computer, the processor manipulates 32-bit numbers, memory and
the registers store 32-bit words, and data and instructions move between the components
over 32-bit bus lines.

A computer’s word size affects its processing speed, memory capacity, precision, and
instruction set size. Consider speed first. A 32-bit bus contains 32 wires, and thus can
carry 32 bits at a time).

The bigger the word size, the faster the computer.

Memory capacity is also a function of word size.

On a 32-bit machine, a 32-bit address can be transmitted.

The biggest 32-bit number is roughly 4 billion in decimal terms, so the process can access
as many as 4 billion different memory locations.

The bigger its word size, the more memory a computer can access.

There are 16-bit microcomputers that access considerably more than 64k bytes of memory,
if addresses are broken into two or more parts and transmitted during successive machine
cycles so memory capacity is gained at the expense of processing speed.

Next, consider the size of the numbers each machine can manipulate. Registers generally
hold one word.
The processor’s internal circuitry is usually most efficient when
manipulating numbers one word in length. A 32-bit mainframe adds 32-bit numbers; a 16bit machine adds 16-bit numbers. Clearly, the machine with the bigger word size is more
precise.

216  64k
4.3 Machine Cycle
1
Operating Systems – DPR355

It is the steps carried out by the various components of the central processing unit in single
clock cycle.

Refer to paragraph 2.3 in chapter 2 for details.

Controlling everything is the clock’s precisely timed pulse.

Adding two registers might call for a single machine cycle.

Adding memory contents to a register might take two machine cycles.

More complex instructions (such as multiplying two decimal numbers) might consume a
dozen or more.
4.4 Reduced Instruction Set (RISC) Technology

Instead of offering a complete instruction set (for example., one including binary, decimal,
floating-point, and string operations) the number of available instructions is reduced and the
hardware is optimized to execute each of them in one or two machine cycles.

Even though it is not ideal for every application, this offers advantages for compute-bound
tasks such as engineering graphics, simulation, and network management.
4.5 Architectures

This describes the relationships between a computer’s components.
4.5.1 Single-Bus Architecture

In a typical microcomputer, all the internal components are linked by a single bus line
Memory
Module (Main
memory)
Processor
Memory
Module
Bus
I/O Interface
(Keyboard,
printer,diskette)
I/O Interface
4.6 Interfaces

Interface is an electronics circuit board placed between the peripheral and the processor/
computer.

Each peripheral device has its own interface (One side of the interface communicates with
the computer, using internal code (Fig. below). The other side is device dependent,
communicating with the external device in its own terms.
2
Operating Systems – DPR355

The basic function of the interface is translation (from binary code of computer/ processor
to the peripheral unit’s electronics signals).
Translate
Computer Internal form
External form
4.7 Channels and Control Units

Microcomputers are designed for single users.

Mainframes often execute several programs concurrently. A mainframe’s basic machine
cycle is identical to microcomputer’s – its processor still fetches and execute one instruction
at a time. How can such a machine execute two or more programs concurrently? The key
is freeing the main processor from responsibility for controlling I/O.

Controlling input and output involves such logical functions as selecting the path over which
the data are to flow, counting characters, and computing memory addresses.

Most mainframes assign the task of controlling I/O to channels (Fig below). A channel is a
micro or minicomputer with its own processor. Thus it can perform logical functions in
parallel with the computer’s main processor, freeing the main processor to do other things.

On a mainframe, device-independent function is assigned to a channel, and devicedependent function is assigned to an I/O control unit.
Computer
Channel
I/O control
unit
Device A
I/O control
unit
Device B
I/O control
unit
Device C
4.8 Multiple-Bus Architecture

Single-bus architecture creates a number of problems on a multiple-user system. Channel
communication is one of the easiest to visualize.

A channel moves data between memory and a peripheral device.
3
Operating Systems – DPR355

The computer’s processor manipulates data in memory. Allowing a channel and a
processor to simultaneously access memory won’t work on a microcomputer system,
because the single-bus architecture provides only one physical data path. Simultaneous
access requires independent data paths, so most mainframes use multiple-bus architecture
(Fig. below).

Start with a channel. Typically, two bus lines link it with the computer. As an input or output
operation begins, the main processor sends a “start I/O” command over the command bus
to the channel’s processor. In response, the channel assumes responsibility for the input
or output operation, establishing a link with the external device and controlling the transfer
of data into main memory over the data bus. (Note that the channel’s memory serves as a
buffer between the peripheral device and main memory). Meanwhile, the main processor
can turn its attention to another program.

Not that both the main processor and the channel’s processor can directly access memory.

The channel is an independent, asynchronous device with its own processor. It controls
the I/O operation. Because the channel and the computer are independent, the main
processor has no way of knowing when the I/O operation is complete unless the channel’s
processor tells it, so as the last character of data flows across the channel, the channel
processor sends the main processor an electronic signal called an interrupt. When it
receives the interrupt, the main processor knows the requested I/O operation has been
completed, and can take appropriate action.
Command Bus
Processor
Channel
Bus
Main Memory
Data Bus
1. The main processor starts an I/O operation by sending a signal to the channel.
2. The channel assumes responsibility for the I/O operation, and the processor turns its
attention to another program.
3. The channel sends an interrupt to the processor to signal the end of the I/O operation.
4.9 Logical and Physical I/O

Logical I/O is the programmer’s instruction to handle the input / output operation. Whereas
the physical I/O is the actual handling/ operation of the I/O device.
4
Operating Systems – DPR355
4.9.1 Primitives

Peripheral devices are controlled by interfaces or control units that are limited to a few
primitive operations. For example, a disk interface unit can:
1. move the access mechanism to a specific track (seek),
2. read a specific sector, or
3. write a specific sector.

Because printers, tape drives, and terminals are so different, they are controlled by different
sets of primitive operations, and thus by different interfaces. Interfaces and control units
execute special programs, called I/O or channel programs, that consist of primitive
commands.
4.9.2 Open

Because computers and their peripherals are physically independent, their electronic
signals must be carefully synchronized before they can begin communicating. Often, an
initial electronic link is established by exchanging a set of prearranged protocol signals at
open time. After a device is officially opened, the computer knows it exists and knows how
to communicate with it.

Often, open involves more than simply establishing communication with a peripheral
device.
How does the system select the right program or the right data file ?

The files stored on a disk are identified by name in the disk’s directory (see Chapter 2). On
a given system, the directory is always stored in the same place (for example, track 0,
sector 2). Once initial contact with the disk drive has been established, the open logic can
issue the primitive commands to read the directory (seek track0, read sector 2). Once the
directory is in memory, the open logic can search it for the file’s name. Recorded along
with the file name is the disk address where the file begins. Given the address of a file’s
first sector, the location of its other sectors can be computed.
4.9.3 Accessing Data

A disk controller is limited to a few primitive functions, including:
1. seek to a track,
2. read a sector,
3. write a sector.

The concept of the “next” record is meaningless at this level. To find data physically on
disk, you must specify a track and issue a seek command, and then specify a sector and
issue a read command. The programmer is concerned with logical I/O. The device is
limited to physical I/O.

Often, the key is the relative record number.
5
Operating Systems – DPR355

Of course, few programmers communicate directly with peripheral devices at a primitive
level. Generally, the responsibility for translating a programmer’s logical I/O requests to
physical commands is assigned to the operating systems (Fig. below). Because there are
so many data access techniques available, some mainframe computers assign applicationdependent portions of this translation process to special subroutines called access
methods, keeping only application-independent logic in the operating system. An access
method is added to a program load module by the linkage editor, so application-dependent
I/O logic occupies memory only when the application program occupies memory. Another
option is to assign responsibility for all database access to a database management
system.
Applications
Program
Logical I/O
request

Hardware
Access
method
Operating
Systems
Primitive
physical
commands
Once a record’s physical location has been determined, the process of communicating with
the peripheral device can begin.

Typically, the access method identifies the necessary primitive commands, sets up a
channel program, and calls the operating system. The operating system then sends a
“start I/O“ signal to the channel, which accesses memory, finds the channel program, and
transfers it to the I/O control unit. Once the data have been transferred, the channel
notifies the operating system through an interrupt, and the program can resume
processing. The elements involved in this operation are summarized in below figure.
Application
Program
Access
method
Operating
Systems
1. Issue
Logical I/O
request
2. Setup
channel
program
3. Start I/O
operation
Channel
Program
7. Restart
application
program
Channel
4. Get channel
program
5. Start device
6. Interrupt
operating
Systems
Hardware
Primitive
physical
commands
I/O Control
Unit
6
Operating Systems – DPR355

Access methods were among the first system programs.

Input/output control forms the core of most modern operating system.

Operating systems is a resource manager – its job is to manage the hardware, software,
and data resources of a computer system.
___________
7
Download