OS Concepts Chapter 1 Exercises Part 3
OS Concepts Chapter 1 Exercises Part 3
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