Chapter 1: Computer System Overview
Chapter 1: Computer System Overview
20. What is the purpose of interrupts? What are the differences between a trap and an
interrupt? Can traps be generated intentionally by a user program? If so, for what
purpose?
An interrupt is purposed to deal with the cause of the interrupt; control is then returned to the
interrupted context and instruction. A trap is a software-generated interrupt. An interrupt can
be used to signal the completion of an I/O to obviate the need for device polling. A trap can
be used to call operating system routines or to catch arithmetic errors.
21. Direct memory access (DMA) is used for high-speed I/O devices in order to avoid
increasing the CPU’s execution load.
a. How does the CPU interface with the device to coordinate the transfer?
CPU sets up DMA registers with pointers to the source and destination of the transfer along
with counter of the transferred bytes, then the DMA controller takes charge of the transfer to
the bus while CPU returns to accomplish other tasks.
b. How does the CPU know when the memory operations are complete?
When the operation completed the DMA, controller send an interrupt to the CPU.
c. The CPU is allowed to execute other programs while the DMA controller is transferring
data. Does this process interfere with the execution of the user programs? If so, describe
what forms of interference is caused.
The CPU and the DMA might compete for cycles on a shared bus. Some systems are using
switch rather than bus; therefore, multiple tasks can be performed simultaneously.
22. Give two reasons why caches are useful. What problems do they solve? What
problems do they cause? If a cache can be made as large as the device for which it is
caching (for instance, a cache as large as a disk), why not make it that large and
eliminate the device?
Caches are useful when more components need to exchange data where the transfer speeds
are much faster when using caches. Next, caches can get data faster that getting it from main
memory. If we want to make cache large, it will be very expensive.
23. Define the essential properties of the following types of operating systems:
a. Batch - Jobs with similar needs are batched together and run through the computer as a
group by an operator
b. Interactive - This system is composed of many short transactions where the results of the
next transaction may be unpredictable.
c. Time sharing - This system uses CPU scheduling and multiprogramming to provide
economical interactive use of a system.
d. Real time - Used in a dedicated application. This system reads information from sensors
and must respond within a fixed amount of time.
e. Network - Provides OS system features across a network such as file sharing.
f. Parallel - Used in symptoms where there are multiple CPU’s each running the same copy
of OS.
g. Distributed – This handle jobs which are serviced by multiple CPUs.
h. Clustered – Composed of two or more individual systems that are coupled as a single unit
i. Handheld – Designed to use less memory and require fewer resources.
24. List five services provided by an OS that are designed to make it more convenient
for users to use the computer system. In what aces it would be impossible for user-level
programs to provide these services? Explain.
i. Program Execution
It allows the user to execute programs by providing convenient environment
for development and execution of programs.
A user level program cannot properly allocate CPU time.
ii. I/O operations
The operating system provides an environment to handle I/O operations.
A user level program cannot control the I/O devices directly.
iii. File-system manipulation
A user need not to know the details of secondary storage system. All a user
can see is that his task is accomplished.
User made programs cannot be made to allocate free blocks when available
and deallocate the blocks after deletion.
iv. Communications
There are times when a process needs to communicate with other process. All
this is taken care by operating system.
Communication takes place in the form of data packets and they need access
to the network device but user level programs cannot provide that.
v. Error detection