MODERN OPERATING SYSTEMS
ANDREW S. TANENBAUM
Vrije Universiteit Amsterdam, The Netherlands
UPPER SADDLE RIVER, NJ 07458
SOLUTIONS TO CHAPTER 1 PROBLEMS 1. An operating system must provide the users with an extended (i.e., virtual) machine, and it must manage the I/O devices and other system resources. 2. Multiprogramming is the rapidswitching of the CPU between multiple processes in memory. It is commonly used to keep the CPU busy while one or more processes are doing I/O. 3. Input spooling is the technique of reading in jobs, for example, from cards, onto the disk, so that when the currently executing processes are ﬁnished, there will be work waiting for the CPU. Output spooling consists of ﬁrst copying printable ﬁles todisk before printing them, rather than printing directly as the output is generated. Input spooling on a personal computer is not very likely, but output spooling is. 4. The prime reason for multiprogramming is to give the CPU something to do while waiting for I/O to complete. If there is no DMA, the CPU is fully occupied doing I/O, so there is nothing to be gained (at least in terms of CPUutilization) by multiprogramming. No matter how much I/O a program does, the CPU will be 100 percent busy. This of course assumes the major delay is the wait while data are copied. A CPU could do other work if the I/O were slow for other reasons (arriving on a serial line, for instance). 5. Second generation computers did not have the necessary hardware to protect the operating system from malicious userprograms. 6. It is still alive. For example, Intel makes Pentium I, II, and III, and 4 CPUs with a variety of different properties including speed and power consumption. All of these machines are architecturally compatible. They differ only in price and performance, which is the essence of the family idea. 7. A 25 × 80 character monochrome text screen requires a 2000-byte buffer. The 1024 × 768pixel 24-bit color bitmap requires 2,359,296 bytes. In 1980 these two options would have cost $10 and $11,520, respectively. For current prices, check on how much RAM currently costs, probably less than $1/MB. 8. Choices (a), (c), and (d) should be restricted to kernel mode. 9. Personal computer systems are always interactive, often with only a single user. Mainframe systems nearly always emphasizebatch or timesharing with many users. Protection is much more of an issue on mainframe systems, as is efﬁcient use of all resources. 10. Every nanosecond one instruction emerges from the pipeline. This means the machine is executing 1 billion instructions per second. It does not matter at all how many stages the pipeline has. A 10-stage pipeline with 1 nsec per
PROBLEM SOLUTIONS FORCHAPTER 1
stage would also execute 1 billion instructions per second. All that matters is how often a ﬁnished instructions pops out the end of the pipeline. 11. The manuscript contains 80 × 50 × 700 = 2.8 million characters. This is, of course, impossible to ﬁt into the registers of any currently available CPU and is too big for a 1-MB cache, but if such hardware were available, the manuscript couldbe scanned in 2.8 msec from the registers or 5.8 msec from the cache. There are approximately 2700 1024-byte blocks of data, so scanning from the disk would require about 27 seconds, and from tape 2 minutes 7 seconds. Of course, these times are just to read the data. Processing and rewriting the data would increase the time. 12. Logically, it does not matter if the limit register uses a virtualaddress or a physical address. However, the performance of the former is better. If virtual addresses are used, the addition of the virtual address and the base register can start simultaneously with the comparison and then can run in parallel. If physical addresses are used, the comparison cannot start until the addition is complete, increasing the access time. 13. Maybe. If the caller gets...
Leer documento completo
Regístrate para leer el documento completo.