Answers to Exercises

Total Page:16

File Type:pdf, Size:1020Kb

Answers to Exercises

Answers to Exercises NOTE: One reason, we’ve included many open-ended questions as well as paper-and-pencil exercises in the Exercises that are listed before the Advanced Exercises, is to give students a chance to explain their understanding of the inner workings of an operating system. A second reason is that with the ubiquitous Internet resources available (including unauthorized downloaded answers to these exercises), other types of questions require less original thought.

If you (as instructor) have suggestions or comments on these exercises, or other aspects of the text, please pass them along. This textbook has benefited immensely over the past 20 years, as a direct result of your collective feedback.

Ann McIver McHoes ([email protected], [email protected])

Research Topics– Chapter 1 Answers will vary. Good sources of information are IEEE Computer Journal, Communications of the ACM, and other computer journals and magazines that have articles comparing new operating systems. Be sure to emphasize the need for credible sources, especially with regard to wikis and blogs on the Internet.

Exercises – 1 1. Name five current operating systems and the computers or configurations each operates.

This answer can vary greatly but good answers could include the following: iPhone OS Propriety software written by Apple to run its iPhone. PS2 OS A proprietary operating system written by Sony to run its PS2 gaming system. HP-UX HP’s proprietary version of UNIX for use on Hewlett Packard workstations and servers. Solaris Created by Sun Microsystems to run on computers serving as hosts or workstations. VAX VMS Created by DEC (Digital Equipment Corporation), a proprietary operating system designed to run only on the VAX minicomputer hardware. OS/2 A proprietary operating system first marketed by IBM to run on its PS/2 microcomputers. Minix An open source operating system written by Andrew Tanenbaum as an alternative to UNIX. For more answers and details, see the table that begins on page 398.

2. Name the five key concepts about an operating system that you think a user needs to know and understand.

This answer can vary greatly but good answers could include:

 What an operating systems is, and why it is important.

 The key role that the operating systems software plays regarding all other software on the computer or system.  The key role that operating systems software plays regarding all hardware interactions on the computer or system.

 That operating systems evolve as hardware capability evolves.

 The trade-offs that an operating system might make to increase efficiency.

 The role of the sub managers: memory manager, process manager, device manager, file manager, and network manager.

 That every computer, even cell phones and games, rely on an operating system.

3. Explain the impact of the evolution of computer hardware and the accompanying evolution of operating systems software.

These answers will vary. The goal of this question is to explore the synergistic relationship between advances in hardware design and advances in OS design. Look for some original discussion here.

4. In the recent past, has Moore’s Law been a mere predictor of chip design, or a motivator for chip designers? Explain your answer.

Even experts disagree about this relationship, whether Moore’s Law has set an expectation that is achieved by chip designers, or whether the technology naturally moves in this direction and it is indeed a mere predictor of the trend. Look here for thoughtful independent, original explanation of the answer.

5. Explain the fundamental differences between interactive, batch, real-time, and embedded systems.

Interactive systems allow multiple users run their programs at the same time and share use of the system resources such as memory, processors, file, devices, and network access. This successful sharing often includes some interrupt capability so one job does not monopolize one system resource.

In a batch system, programs to be run are run in their entirety, one after the other, without interruption by any other program. They are run as a “batch.”

Real-time systems are used in time critical environments such as vehicle control or patient monitoring where failures in the system could lead to loss of life or major destruction of property. They are usually considered dedicated systems that spend most of the time on a single job. Work such as laboratory experiment monitoring, or environment control within buildings requires continuous processing, with little opportunity to use the computer for unrelated purposes.

Embedded systems are those that are dedicated to a single use and are often located in the device they operate. Embedded systems include computers in cars, aircraft, electronic toys, etc.

6. List three situations that might demand a real-time operating system and explain why. Classic examples of the need for real-time systems are aircraft fly-by-wire computers, hospital patient data management systems, control room software, emergency response systems, and military/defense situations. There can be many more.

7. Give an example of an organization that might find batch-mode processing useful and explain why.

Batch mode would favor an environment without much interruption by outside influences. Routine data backup would be one such application, as would massive database searches, late-night archival of system status indicators, or inventory or census recording.

8. List three tangible (physical) resources of a computer system.

This question is designed to help beginning students differentiate between hardware and software resources.

Tangible resources would include the processor, memory, printer, monitor, keyboard, mouse, disk drives, sound card, etc. It does not include files, data, or software.

9. Briefly compare active and passive multiprogramming.

In this chapter, we discussed methods the OS can use to interrupt a job that’s I/O bound. This subject is discussed in depth in Chapter 4.

When the operating system has the capability of interrupting the processing of a job, it’s called active multiprogramming. When the system does not have that capability but instead relies on the job to release the resource that it’s monopolizing, then it’s called passive multiprogramming.

10. Give at least two reasons why a regional bank might decide to buy six server computers instead of one supercomputer.

Among the many answers to this question are:

 Several servers are less likely to become unavailable at one time than a single powerful computer.

 Servers are less expensive to purchase.

 Technical support for servers is less expensive.

 More banking applications are written for servers than for supercomputers.

 Servers can be located at several sites for increased availability in a weather-related disaster.

11. Select one of the following professionals: an insurance adjuster, a delivery person for a courier service, a newspaper reporter, a doctor (general practitioner), or a manager in a supermarket. Suggest at least two ways that such a person might use a handheld computer to work more efficiently. Answers here can range widely. This question is designed to encourage students to creatively explore ways in which handheld devices can help people in their everyday work.

Advanced Exercises Advanced Exercises are appropriate for students who have or want a deeper understanding of operating systems. These exercises may require knowledge that’s more advanced than the concepts that are included in this book. For students who are new to operating systems concepts, you may want to pass these by.

12. Compare the development of two operating systems described in Chapters 13-16 of this text, including design goals and evolution.

These answers will vary. This question is designed to encourage students to explore two operating systems in detail and perhaps learn more about an operating system outside of their expertise. You may want include other system not described in Part 2 of this book, to further their exploration.

13. Draw a system flowchart illustrating the steps performed by an operating system as it executes the instruction to back up a disk on a single-user computer system. Begin with the user typing the command on the keyboard and conclude with the display of the result on the monitor.

The pseudo code for the flowchart is below:

1. User issues command to BACKUP via the User Interface 2. User Interface interprets command - awakens File Manager 3. File Manager resolves address of file to be backed up - awakens Device Manager 4. Device Manager opens access path to drive from where files are to be backed up - reads file (or portion of it) into I/O buffer - awakens Memory Manager 5. Memory Manager allocates memory for file in I/O buffer - awakens Processor Manager 6. Processor Manager loads file from I/O buffer to memory - awakens File Manager 7. File Manager resolves address of file to be copied to new disk - awakens Processor Manager 8. Processor Manager copies file from memory to I/O buffer - awakens Device Manager 9. Device Manager opens access path to drive where file will be copied - reads file from I/O buffer to new disk - awakens File Manager 10. File Manager determines if file is completely copied - if yes, writes Trailer Label - jump forward to step 11 - if no, resolves address of next section of file to be backed up - awakens Device Manager returns to step 4 11. File Manager determines if this is the last file to be backed up - if no, awakens Processor Manager - Processor Manager activates user interface - sends File N has been backed up message to user - jump back to step 3 - if yes, awakens Processor Manager - Processor Manager activates user interface - sends “All files have been backed up” message to user - Continue with other functions

14. Identify the clock rates or processors that use 8 bits, 16 bits, 32 bits, and 64 bits. Discuss several implications scheduling the CPU in a multiprocessing system.

The clock rates and processors change as technology advances. The faster processors more easily accommodate multiprocessing because they can quickly move data into and out of secondary storage. This question is designed to explore the implications of faster clock rate speed including: increased processing speed, improved throughput, reduced overhead cost.

15. In a multiprogramming and time-sharing environment, several users share the system simultaneously. This situation can result in various security problems. Name two such problems. Can we ensure the same degree of security in a time-share machine as we have in a dedicated machine? Explain your answers.

The only secure computing environment is one that is not networked and is dedicated to only a single task or a single user. Among the security issues that arise in a shared processing environment are:

 inadvertent or intentional access to user ids and passwords  unauthorized access to private data  unauthorized access to, or alteration of, the operating system software  inadvertent or intentional spreading of viruses and other malware

16. Give an example of an application where multithreading gives improved performance over single- threading.

Answers will vary but two examples are web browsing and database searching.

17. If a process terminates, will its threads also terminate or will they continue to run? Explain your answer.

Recommended publications