• Home
  • Textbooks
  • Computer Science - An Overview
  • Operating Systems

Computer Science - An Overview

Glenn Brookshear, Dennis Brylow

Chapter 3

Operating Systems - all with Video Answers

Educators


Chapter Questions

01:12

Problem 1

List four activities of a typical operating system.

Hubert Agamasu
Hubert Agamasu
Numerade Educator
01:37

Problem 2

What led to the development of the interactive operating system?

Hubert Agamasu
Hubert Agamasu
Numerade Educator
02:12

Problem 3

Suppose three items $R, S,$ and $T$ are placed in a queue in that order. Then one item is removed from the queue before a fourth item, $X,$ is placed in the queue. Then one item is removed from the queue, the items $Y$ and $Z$ are placed in the queue, and then the queue is emptied by removing one item at a time. List all the items in the order in which they were removed.

Emily Anderson
Emily Anderson
Numerade Educator
01:50

Problem 4

What is the significance of the window manager in current GUI shells?

Adam Conner
Adam Conner
Numerade Educator
01:54

Problem 5

What is a real-time operating system?

Adam Conner
Adam Conner
Numerade Educator
01:39

Problem 6

If you have a $\mathrm{PC}$, identify some situations in which you can take advantage of its multitasking capabilities.

Hubert Agamasu
Hubert Agamasu
Numerade Educator
01:31

Problem 7

On the basis of a computer system with which you are familiar, identify two units of application software and two units of utility software. Then explain why you classified them as you did.

Hubert Agamasu
Hubert Agamasu
Numerade Educator
01:12

Problem 8

a. What is the role of the user interface of an operating system?
b. What is the role of the kernel of an operating system?

Hubert Agamasu
Hubert Agamasu
Numerade Educator
01:13

Problem 9

What is the use of the process table in program execution?

Adam Conner
Adam Conner
Numerade Educator
01:38

Problem 10

Give some examples of functions that are provided by the Python module "os".

Adam Conner
Adam Conner
Numerade Educator
00:59

Problem 11

What is the Linux or UNIX command for creating new processes?

Adam Conner
Adam Conner
Numerade Educator
01:22

Problem 12

What is the difference between a process that is ready and a process that is waiting?

Hubert Agamasu
Hubert Agamasu
Numerade Educator
01:12

Problem 13

What is the difference between virtual memory and main memory?

Hubert Agamasu
Hubert Agamasu
Numerade Educator
02:10

Problem 14

Suppose a computer contained $512 \mathrm{MB}(\mathrm{MiB})$ of main memory, and an operating system needed to create a virtual memory of twice that size using pages of $2 \mathrm{KB}$ (KiB). How many pages would be required?

Hubert Agamasu
Hubert Agamasu
Numerade Educator
02:06

Problem 15

What complications could arise in a timesharing/multitasking system if two processes require access to the same file at the same time? Are there cases in which the file manager should grant such requests? Are there cases in which the file manager should deny such requests?

Adam Conner
Adam Conner
Numerade Educator
02:21

Problem 16

How is firmware different from hardware and software? What do you mean by a firmware update?

Adam Conner
Adam Conner
Numerade Educator
01:25

Problem 17

Define load balancing and scaling in the context of multiprocessor architectures.

Hubert Agamasu
Hubert Agamasu
Numerade Educator
01:26

Problem 18

What is a context switch?

Adam Conner
Adam Conner
Numerade Educator
02:00

Problem 19

What are the flaws of privilege level control?

Adam Conner
Adam Conner
Numerade Educator
02:47

Problem 20

If you have a $\mathrm{PC}$, record the sequence activities that you can observe when you turn it on. Then determine what messages appear on the computer screen before the booting process actually begins. What software writes these messages?

Adam Conner
Adam Conner
Numerade Educator
02:09

Problem 21

Suppose a multiprogramming operating system allocated time slices of 10 milliseconds and the machine executed an average of five instructions per nanosecond. How many instructions could be executed in a single time slice?

Adam Conner
Adam Conner
Numerade Educator
03:39

Problem 22

If a typist types 60 words per minute (where a word is considered five characters), how much time would pass between typing each character? If a multiprogramming operating system allocated time slices in 10 millisecond units and we ignore the time required for process switches, how many time slices could be allocated between characters being typed?

Adam Conner
Adam Conner
Numerade Educator
02:17

Problem 23

Suppose a multiprogramming operating system is allotting time slices of 50 milliseconds. If it normally takes 8 milliseconds to position a disk's read/write head over the desired track and another 17 milliseconds for the desired data to rotate around to the read/write head, how much of a program's time slice can be spent waiting for a read operation from a disk to take place? If the machine is capable of executing 10 instructions each nanosecond, how many instructions can be executed during this waiting period? (This is why when a process performs an operation with a peripheral device, a multiprogramming system terminates that process's time slice and allows another process to run while the first process is waiting for the services of the peripheral device.)

Adam Conner
Adam Conner
Numerade Educator
02:17

Problem 24

What is the drawback of using the set and clear flag system while allocating devices?

Adam Conner
Adam Conner
Numerade Educator
01:19

Problem 25

A process is said to be $I / O$ -bound if it requires a lot of I/O operations, whereas a process that consists of mostly computations within the CPU/memory system is said to be computebound. If both a compute-bound process and an I/O-bound process are waiting for a time slice, which should be given priority? Why?

Adam Conner
Adam Conner
Numerade Educator
01:34

Problem 26

Would greater throughput be achieved by a system running two processes in a multiprogramming environment if both processes were I/O-bound (refer to problem 25) or if one were I/O-bound and the other were compute-bound? Why?

Adam Conner
Adam Conner
Numerade Educator
01:20

Problem 27

Write a set of directions that tells an operating system's dispatcher what to do when a process's time slice is over.

Adam Conner
Adam Conner
Numerade Educator
01:43

Problem 28

What are the various functions of the memory manager in an operating system?

Adam Conner
Adam Conner
Numerade Educator
01:30

Problem 29

Identify a situation in a multiprogramming system in which a process does not consume the entire time slice allocated to it.

Adam Conner
Adam Conner
Numerade Educator
01:38

Problem 30

What is meant by an interrupt handler in multiprogramming systems and what is its significance?

Adam Conner
Adam Conner
Numerade Educator
01:08

Problem 31

Answer each of the following in terms of an operating system that you use:
a. How do you ask the operating system to copy a file from one location to another?
b. How do you ask the operating system to show you the directory on a disk?
c. How do you ask the operating system to execute a program?

Hubert Agamasu
Hubert Agamasu
Numerade Educator
01:54

Problem 32

Answer each of the following in terms of an operating system that you use:
a. How does the operating system restrict access to only those who are approved users?
b. How do you ask the operating system to show you what processes are currently in the process table?
c. How do you tell the operating system that you do not want other users of the machine to have access to your files?

Adam Conner
Adam Conner
Numerade Educator
01:09

Problem 33

Explain an important use for the test-andset instruction found in many machine languages.Why is it important for the entire test-and-set process to be implemented as a single instruction?

Adam Conner
Adam Conner
Numerade Educator
01:20

Problem 34

A banker with only $\$ 100,000$ loans $\$ 50,000$ to each of two customers. Later, both customers return with the story that before they can repay their loans they must each borrow another $\$ 10,000$ to complete the business deals in which their previous loans are involved. The banker resolves this deadlock by borrowing the additional funds from another source and passing on this loan (with an increase in the interest rate) to the two customers. Which of the three conditions for deadlock has the banker removed?

Adam Conner
Adam Conner
Numerade Educator
01:47

Problem 35

Students who want to enroll in Model Railroading II at the local university are required to obtain permission from the instructor and pay a laboratory fee. The two requirements are fulfilled independently in either order and at different locations on campus, Enrollment is limited to 20 students; this limit is maintained by both the instructor, who will grant permission to only 20 students, and the financial office, which will allow only 20 students to pay the laboratory fee. Suppose that this registration system has resulted in 19 students having successfully registered for the course, but with the final space being claimed by two students-one who has only obtained permission from the instructor and another who has only paid the fee. Which requirement for deadlock is removed by each of the following solutions to the problem?
a. Both students are allowed in the course.
b. The class size is reduced to $19,$ so neither of the two students is allowed to register for the course.
c. The competing students are both denied entry to the class and a third student is given the twentieth space.
d. It is decided that the only requirement for entry into the course is the payment of the fee. Thus the student who has paid the fee gets into the course, and entry is denied to the other student.

Adam Conner
Adam Conner
Numerade Educator
01:22

Problem 36

Since each area on a computer's display can be used by only one process at a time (otherwise the image on the screen would be unreadable $),$ these areas are nonsharable resources that are allocated by the window manager. Which of the three conditions necessary for deadlock does the window manager remove in order to avoid deadlock?

Adam Conner
Adam Conner
Numerade Educator
01:07

Problem 37

Suppose each nonsharable resource in a computer system is classified as a level $1,$ level 2 or level 3 resource. Moreover, suppose each process in the system is required to request the resources it needs according to this classification. That is, it must request all the required level 1 resources at once before requesting any level 2 resources. Once it receives the level 1 resources, it can request all the required level 2 resources, and so on. Can deadlock occur in such a system? Why or why not?

Adam Conner
Adam Conner
Numerade Educator
01:33

Problem 38

Each of two robot arms is programmed to lift assemblies from a conveyor belt, test them for tolerances, and place them in one of two bins depending on the results of the test. The assemblies arrive one at a time with a sufficient interval between them. To keep both arms from trying to grab the same assembly, the computers controlling the arms share a common memory cell. If an arm is available as an assembly approaches, its controlling computer reads the value of the common cell. If the value is nonzero, the arm lets the assembly pass. Otherwise, the controlling computer places a nonzero value in the memory cell, directs the arm to pick up the assembly, and places the value 0 back into the memory cell after the action is complete. What sequence of events could lead to a tugof-war between the two arms?

Adam Conner
Adam Conner
Numerade Educator
01:29

Problem 39

Why is disabling the interrupts in a multicore operating system not considered to be an efficient approach?

Adam Conner
Adam Conner
Numerade Educator
01:37

Problem 40

A process that is waiting for a time slice is said to suffer starvation if it is never given a time slice.
a. The pavement in the middle of an intersection can be considered as a nonsharable resource for which cars approaching the intersection compete. A traffic light rather than an operating system is used to control the allocation of the resource. If the light is able to sense the amount of traffic arriving from each direction and is programmed to give the green light to the heavier traffic, the lighter traffic might suffer from starvation. How is starvation avoided?
b. In what sense can a process starve if the dispatcher always assigns time slices according to a priority system in which the priority of each process remains fixed? (Hint:
What is the priority of the process that just completed its time slice in comparison to the processes that are waiting, and consequently which routine gets the next time slice?) How, would you guess, do many operating systems avoid this problem?

Adam Conner
Adam Conner
Numerade Educator
01:22

Problem 41

Why can't special-purpose registers restrict a process in its allotted memory area? Explain your answer.

Adam Conner
Adam Conner
Numerade Educator
02:40

Problem 42

The following is the "dining philosophers" problem that was originally proposed by E. W. Dijkstra and is now a part of computer science folklore. Five philosophers are sitting at a round table. In front of each is a plate of spaghetti. There are five forks on the table, one between each plate. Each philosopher wants to alternate between thinking and eating. To eat, a philosopher requires possession of both the forks that are adjacent to the philosopher's plate. Identify the possibilities of deadlock and starvation (see problem 40 ) that are present in the dining philosophers' problem.

Adam Conner
Adam Conner
Numerade Educator
01:38

Problem 43

What problem arises as the lengths of the time slices in a multiprogramming system are made shorter and shorter? What about as they become longer and longer?

Adam Conner
Adam Conner
Numerade Educator
01:34

Problem 44

When is it preferable to use the deadlock prevention scheme, the deadlock avoidance scheme, and the deadlock detection and recovery scheme? Can you provide scenarios where more than one of these schemes can be used?

Adam Conner
Adam Conner
Numerade Educator
01:12

Problem 45

Identity two activities that can be performed by an operating system's administrator but not by a typical user.

Adam Conner
Adam Conner
Numerade Educator
01:31

Problem 46

How is the read action different from the write action when multiple processes access the same file?

Adam Conner
Adam Conner
Numerade Educator
01:28

Problem 47

Suppose a password consisted of a string of nine characters from the English alphabet $(26$ characters). If each possible password could be tested in a millisecond, how long would it take to test all possible passwords?

Adam Conner
Adam Conner
Numerade Educator
01:01

Problem 48

Why are CPUs that are designed for multitasking operating systems capable of operating at different privilege levels?

Adam Conner
Adam Conner
Numerade Educator
00:57

Problem 49

How are privileged instructions handled in nonprivileged mode?

Adam Conner
Adam Conner
Numerade Educator
01:13

Problem 50

Identify three ways in which a process could challenge the security of a computer system if not prevented from doing so by the operating system.

Adam Conner
Adam Conner
Numerade Educator
00:54

Problem 51

What are the conditions that lead to a deadlock?

Adam Conner
Adam Conner
Numerade Educator
00:55

Problem 52

What are the policies that a user should follow to manage login passwords?

Adam Conner
Adam Conner
Numerade Educator
01:04

Problem 53

Give appropriate examples of auditing software and sniffing software.

Adam Conner
Adam Conner
Numerade Educator
01:14

Problem 54

How is security relevant in current operating systems?

Adam Conner
Adam Conner
Numerade Educator
01:35

Problem 55

How is the booting process different in embedded systems from traditional systems?

Adam Conner
Adam Conner
Numerade Educator