Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
2004/10/31 (Sun.)
Chapter 1 Introduction
1. What is the main advantage of multiprogramming?
Multiprogramming makes use of the CPU by overlapping the demands for the CPU and its I/O
devices from various users. It attempts to increase CPU utilization by always having something for
the CPU to execute.
2. What are the main differences between operating systems for mainframe computers and PCs?
The design goals of operating systems for those machines are quite different. PCs are inexpensive, so
wasted resources like CPU cycles are inconsequential. Resources are wasted to improve usability and
increase software user interface functionality. Mainframes are the opposite, so resource use is
maximized, at the expensive of ease of use.
3.
(a) Stealing or copying ones programs or data; using system resources (CPU, memory, disk space,
peripherals) without proper accounting.
(b) Probably not, since any protection scheme devised by humans can inevitably be broken by a
human, and the more complex the scheme, the more difficult it is to feel confident of its correct
implementation.
4.
Describe the differences between symmetric and asymmetric multiprocessing. What are three
What is the main difficulty that a programmer must overcome in writing an operating system
the entire system it is running. Therefore when writing an operating system for a real-time system,
the writer must be sure that his scheduling schemes dont allow response time to exceed the time
constraint.
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 two or more components need to exchange data, and the components
perform transfers at different 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 devices. 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 it: (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.
Mechanism and policy must be separate to ensure that systems are easy to modify. No two system
installations are the same, so each installation may want to tune the operating system to suit its needs.
With mechanism and policy separate, the policy may be changed at will while the mechanism stays
unchanged. This arrangement provides a more flexible system.
Chapter 4 Processes
1.
MS-DOS provided no means of concurrent processing. Discuss three major complications that
concurrent processing adds to an operating system.
(a) A method of time sharing must be implemented to allow each of several processes to have
access to the system. This method involves the preemption of processes that do not voluntarily
give up the CPU (by using a system call, for instance) and the kernel being reentrant(so more
than one process may be executing kernel code concurrently.)
(b) Processes and system resources must have protections and must be protected from each other.
Any given process must be limited in the amount of memory it can use and the operations it can
perform on devices like disks.
(c) Care must be taken in the kernel to prevent deadlocks between processes, so processes arent
waiting for each others allocated resources.
2.
The correct producer-consumer algorithm in Section 4.4 allows only n-1 buffers to be full at
any one time. Modify the algorithm to allow all buffers to be utilized fully.
Please refer to Section 7.1