100% found this document useful (1 vote)
271 views2 pages

OS Concepts Chapter 1 Exercises Part 3

This document contains answers to exercises about computer systems concepts. It discusses: - How network computers differ from PCs in relying on a centralized computer for services. Network computers are preferable where administrative costs are high and resource sharing is efficient. - The purpose of interrupts is to change control flow in response to hardware events, while traps are software-generated interrupts used to call OS routines or catch errors. - DMA allows high-speed I/O without burdening the CPU by having a controller directly access memory; the CPU coordinates via registers and is notified on completion.

Uploaded by

Alfred Fred
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
271 views2 pages

OS Concepts Chapter 1 Exercises Part 3

This document contains answers to exercises about computer systems concepts. It discusses: - How network computers differ from PCs in relying on a centralized computer for services. Network computers are preferable where administrative costs are high and resource sharing is efficient. - The purpose of interrupts is to change control flow in response to hardware events, while traps are software-generated interrupts used to call OS routines or catch errors. - DMA allows high-speed I/O without burdening the CPU by having a controller directly access memory; the CPU coordinates via registers and is notified on completion.

Uploaded by

Alfred Fred
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Solution to Exercises

1.21 How are network computers different from traditional personal computers? Describe
some usage scenarios in which it is advantageous to use network computers.
Answer:
A network computer relies on a centralized computer for most of its services. It can therefore
have a minimal operating system to manage its resources. A personal computer on the other hand
has to be capable of providing all of the required functionality in a standalone manner without
relying on a centralized manner. Scenarios where administrative costs are high and where sharing
leads to more efficient use of resources are precisely those settings where network
computers are preferred.
1.22 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?
Answer:
An interrupt is a hardware-generated change-of-flow within the system. An interrupt
handler is summoned 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.
1.23 Direct memory access is used for high-speed I/O devices in order to avoid increasing the
CPUs execution load.
a. How does the CPU interface with the device to coordinate the transfer?
b. How does the CPU know when the memory operations are complete?
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 are caused.
Answer:
The CPU can initiate a DMA operation by writing values into special registers that can be
independently accessed by the device. The device initiates the corresponding operation once it
receives a command from the CPU. When the device is finished with its operation, it interrupts
the CPU to indicate the completion of the operation. Both the device and the CPU can be
accessing memory simultaneously. The memory controller provides access to the memory bus in
a fair manner to these two entities. A CPU might therefore be unable to issue memory operations
at peak speeds since it has to compete with the device in order to obtain access to the memory
bus.

1.24 Some computer systems do not provide a privileged mode of operation in hardware. Is it
possible to construct a secure operating system for these computer systems? Give arguments

both that it is and that it is not possible.


Answer:
An operating system for a machine of this type would need to remain in control (or
monitor mode) at all times. This could be accomplished by two methods:
a. Software interpretation of all user programs (like some BASIC, Java, and LISP systems, for
example). The software interpreter would provide, in software, what the hardware does not
provide.
b. Require meant that all programs be written in high-level languages so that all object code is
compiler-produced. The compiler would generate (either in-line or by function calls) the
protection checks that the hardware is missing.
1.25 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?
Answer:
Caches are useful when two or more components need to exchange data, and the
components perform transfers at differing speeds. Caches solve the transfer problem by
providing a buffer of intermediate speed between the components. If the fast device finds the
data it needs in the cache, it need not wait for the slower device. The data in the cache
must be kept consistent with the data in the components. If a component has a data value change,
and the datum is also in the cache, the cache must also be updated. This is especially a problem
on multiprocessor systems where more than one process may be accessing a datum. A
component may be eliminated by an equal-sized cache, but only if:
(a) the cache and the component have equivalent state-saving capacity (that is, if the component
retains its data when electricity is removed, the cache must retain data as well), and
(b) the cache is affordable, because faster storage tends to be more expensive.

You might also like