New Semester
Started
Get
50% OFF
Study Help!
--h --m --s
Claim Now
Question Answers
Textbooks
Find textbooks, questions and answers
Oops, something went wrong!
Change your search query and then try again
S
Books
FREE
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Tutors
Online Tutors
Find a Tutor
Hire a Tutor
Become a Tutor
AI Tutor
AI Study Planner
NEW
Sell Books
Search
Search
Sign In
Register
study help
engineering
computer engineering
Operating Systems 3rd edition Gary Nutt - Solutions
Microprocessor chips often do not include floating-point operations in their hardware instruction set. Floating-point instructions must then be implemented either by using software functions or via the inclusion of a supplementary floating-point chip to be used with the microprocessor chip.a. Using
Assume it takes an average of 2.5 clock cycles to execute an instruction in a one address machine language (that is, each individual instruction can reference at most one memory location). Estimate the number of clock cycles it would take to execute the C loop that follows if the code is compiled
Maintaining a system clock that can be read by any user program requires only that the operating system read a physical device (keeping physical time) and then write the time into a globally readable variable. Suppose the time to read the physical clock and to update the variable is 100
C++ type hierarchies could be used to define device drivers by encoding standard operations for all devices in a base class and then refining the behavior for various devices with derived classes. Describe a type hierarchy, including member functions and data, for a keyboard, display, mouse, serial
Using C-like pseudo code, describe a device driver, interrupt handler, and device status table to implement the following:a. get-block (device, buffer)b. put-block (device, buffer)Because this specification of the problem ignores many details of a real system, you will need to make some assumptions
Conventional high-level programming languages rely on sequential semantics for their operation. In particular, when programmers write a code segment such as.read (io-port, &buffer, length);x = f (buffer[i]);.they expect the assignment statement will not be executed until the read statement has
Describe a new read function, xRead ( ) , along with other functions that could enable one to write programs in a high –level language such that the application can continue processing after the xRead ( ) call, but can block itself before using data in the process of being read.
Serial asynchronous communication ports are widely used in contemporary computers to connect a terminal (keyboard and display) or a printer to the computer. The signaling protocol typically employs 1 or 2 start bits and a single stop bit to encapsulate each byte. A transmitter sends start bits to
Consider the performance specifications for a contemporary desktop computer given in Section 4.6. What component is likely to be the performance bottleneck in such a computer? Why?
The Itsy computer incorporates a two-axis accelerometer that is intended to measure movement of the entire machine. This device reports the change in orientation of the entire computer in two dimensions. The designers thought this might be useful for tracking the user’s physical gestures. What
Suppose a computer with a pipelined functional unit contains a 4-stage pipe, with the time for each stage to execute being 50 μs. What is the maximum number of instructions that can be executed by the machine in one second?
Provide the detailed steps involved in performing an output operation in a system that uses interrupts. Use the explanation of the input instruction in Section 5.1 as a pattern for your answer.
Suppose three processer, p1, p2, and p3, are attempting to use a machine with interrupt-driven I/O concurrently. Suppose p1 has tcompute = 20 and tdevice = 50, p2 has tcompute = 30 and tdevice =10, and p3 has tcompute = 15 and tdevice = 35. Assuming that no two processes can be using any device or
Refer to hardware double buffering (Figure below) and explain the effect of buffering on the runtime of the process if the process is I/O-bound and requests characters at a much higher rate than the device can provide them. What is the effect if the process is compute-bound and rarely requests
Should magnetic disk controllers include hardware buffers? Explain your answer.
System designers distinguish between the physical blocks read by the driver and the logical blocks presented to the application process. Explain how this distinction might be useful on a system that has floppy and hard disk drives.
Suppose that a driver is configured with 8 disk block buffers. What is the best possible read performance improvement of a program that uses this driver (compared to one that uses no buffering)? What are the conditions under which the performance is the best?
One of the ways magnetic disk drive manufacturers increase the capacity of a disk is by adding more surfaces. Does this change the device driver interface for the device? If not, why not?
Is it necessary for an operating system to have a driver-kernel interface in a system that does not use reconfigurable device drivers? Explain your answer.
Explain why a serial communications port that manages a terminal keyboard does not normally use the same optimization techniques as a serial communications port that manages a printer.
Identify some optimization techniques you would consider for a device driver for a magnetic tape drive. Justify each technique.
Suppose the read/write head is at track 97, moving toward track 199 (the highest numbered track on the disk) and the disk request queue contains read/write requests for sectors on tracks 84, 155, 103, 96, and 1978, respectively.a. What is the total number of head movements needed to satisfy the
Construct a scenario in which a disk optimization algorithm other than SSTF requires fewer steps to satisfy all requests for disk I/O. Use a 300-track disk with a maximum 100-track traversal time for any seek operation.
Overlapped execution semantics for read and write functions were defined in Section 5.2. How could you implement this in a conventional C program (using the stdio library)?
Section 5.5 describes CD-ROM devices. Notice that a CD-ROM recording track is a single helix coiling from the inside to the outside instead of a set of concentric rings like a magnetic disk. How can these devices support a seek command efficiently?
Explain why all processes in a thread block when any one of them blocks in a user space thread implementation. Why is this not true in a kernel thread implementation?
Does the hardware process described in Section 6.2 have a process descriptor? Does the initial process have a process descriptor? Explain your answers.
Each process is created with an address space that defines access to every memory-mapped resource in the process. Explain how a process can refer to objects that are not in its address space (for example, a file or another process).
Many operating systems allocate a static array of process descriptors, meaning that there is a fixed, maximum number of processes that can exist in the OS. Provide some arguments for why the kernel does not use a dynamic data structure to allow a variable number of process descriptors to exist.
Below is a list of fields from a classic process descriptors. In a modern process model with threads and processes, say whether each field should be implemented in the process or thread descriptor.a. User nameb. Stack bottomc. Resources blocking med. Primary memory allocated to mee. Files allocated
When a new process moves from the ready state to the running state ( in Figure), each register in the CPU must be set either to initial values or to the values the process had when it was last interrupted. Explain why the PC register is typically the last register loaded for the new process. Show a
Suppose an OS was designed so that processes could be in any of the following states:a. Running: Currently using the CPU.b. Ready: Waiting for the CPU.c. Blocked for Interrupt: Waiting for an interrupt handler to finish, then resume running.d. Blocked for reusable resource: Waiting for a consumable
Suppose a process is defined to behave as described in Figure. Design and implement a resource manager for reusable resources. When multiple processes are blocked on a resource and one or more units become available, call a policy function to select the process to receive resources. Implement any
During processor multiplexing using interrupts and the interval timer, the processor receives a timer interrupt when the interrupt request flag (interruptRequest) is set to TRUE by the interval timer device. In the discussion, it is assumed that the interrupt software will reset interruptRequest to
Suppose a new process in a system arrives at an average of six processes per minute and each such process requires an average of 8 seconds of service time. Estimate the fraction of time the CPU is busy in a system with a single processor.
Assume you have the following jobs to execute with one processor, with the jobs arriving in the order listed here: a. Suppose a system uses FCFS scheduling. Create a Gantt chart illustrating the execution of these processes. b. what is the turnaround time for process p3? c. What is the average
Using the process load in the previous problem, suppose a system uses SJN schedulinga. Create a Gantt chart illustrating the execution of these processes.b. What is the turnaround time for process p4?c. What is the average wait time for the processes?
Suppose a system uses priority scheduling (under the following process load), where a small integer means a high priority. a. Create a Gantt chart illustrating the execution of these processes. b. What is the turnaround time for process p2 under priority scheduling? c. What is the average wait
Assume you have the following jobs to execute with one processor: Suppose a system uses RR scheduling with a quantum of 15. a. Create a Gantt chart illustrating the execution of these processes. b. What is the turnaround time for process p3? c. What is the average wait time for the processes?
Assume you have the following jobs to execute with one processor: Suppose a system uses preemptive SJN scheduling. Create a Gantt chart illustrating the execution of these processes.
Assume the context switch time is five time units with RR scheduling.a. Create a Gantt chart illustrating the execution of these processes.b. What is the turnaround time for the processes p3?c. What is the average wait time for the processes?
Assume you have the following jobs to execute with one processor: The jobs are assumed to arrive at the same time. Using priority scheduling, do the following: a. Create a Gantt chart illustrating the execution of these processes. b. What is the turnaround time for process p1? c. What is the
What is the effect of increasing the time quantum to an arbitrarily large number for RR scheduling?
Linux Version 2.2 supports kernel threads, so its scheduler operates on threads instead of processes. Do you think it would be necessary to completely redesign the Version 2.0 (or Version 1.0 scheduler described in Section 7.5) for Version 2.2? Or could the process scheduler algorithm be easily
The BSD UNIX priority values actually range from 0 through 127, rather than from 0 through 31 (corresponding to the run queue number). Speculate why the designers decided not to incorporate 128 run queues in the scheduler.
Suppose processes P0 and P1 share variable V2, processes P1 and P2 share variable V0, and processes P2 and P3 share variable V1.a. Show how the processes can use enableInterrupt ( ) and disableinterrupt ( ) to coordinate access to V0, V1, and V2 so that the critical section problem does not
Enabling and disabling interrupts to prevent timer interrupts from invoking the scheduler is one way to implement semaphores. This technique can influence I/O scheduler is one way to implement semaphores. This technique can influence I/O because it makes the interrupt handler wait until the
The following solution is alleged to be a solution to the critical section problem. Argue for its correctness or show a case in which it fails.shared int turn;shared boolean flag[2];proc(int i) { while (TRUE) { compute; /* Attempt to enter the critical section
Dijkstra posed each of the following solutions as a potential software solution to the critical section problem and then explained why they failed [Dijkstra, 1968]. Provide your explanation about why they failed.a. proc(int i) {while (TRUE) {compute;while (turn != i);critical_section;turn = (i+1)
In the solution to the bounded buffer problem (Figure), consider the ordering of the first two P operations in the producer and the consumer. Suppose the order of the p(full) and the p(mutex) instructions were reversed in the consumer. Would this solution still becorrect?
Assume the writepending semaphore was omitted from Figure. Describe a simple sequence of reader and writer activity that causes the solution to fail for the second readers-writerspolicy.
Two processes, P1 and P2, have been designed so that P2 prints a byre stream produced by P1. Write a skeleton for the procedures executed by P1 and P2 to illustrate how they synchronize with one another using P and V.
The following is alleged to be a solution to the critical section problem. Argue for its correctness or show a case in which it fails.shared int turn; /* shared variable to synchronize operation */boolean flag[2];
In Chapters 4 and 5, you learned how device driver software synchronizes its behavior with device controller hardware (using the busy and done flags in the controller’s status register). In the generic schema shown in Figure, the driver starts the device in operation, writes the I/O details to
The sleepy Barber problem [Dijkstra, 1968]. A barbershop is designed so that there is a private room that contains the barber chair and an adjoining waiting room with a sliding door that contains N chairs (see Figure). If the barber is busy, the door to the private room is closed and arriving
Provide a scenario in which a process executing the V procedure in Figure will detect when s. value is less than or equal to 0 and s. hold is TRUE.
Suppose a machine’s instruction set includes an instruction names swap that operates as follows (as an indivisible instruction):swap (boolean *a, Boolean *b){boolean t;t = *a;*a =*b;*b = t;}Show how swap can be used to implement the P and V operations.
Semaphores are not implemented in older versions of UNIX, but processes with stdout of one process dirtected into stdin must synchronize their operation in a manner similar to that required in problem 7. Write a program, Source, that copies a file to stdout and another program, sink, that reads
Suppose processes P0 and P1 share variable V2, processes P1 and P2 share variable V0, and processes P2 and P3 share variable V1. In addition, P0, P1, and P2 run concurrently. Write a code fragment (similar to those in the figures in this chapter) to illustrate how the processes can use monitors to
Suppose process P0 uses variables V0 and V1 at the same time, process P1 uses variables V1 and V2 at the same time, and process P2 uses variables V2 and V0 at the same time. Further, P0, P1, and P2 run concurrently. Write a code fragment using the simultaneous semaphore operations to
Construct a monitor that implements semaphores. This will demonstrate that a monitor can be used any place a semaphore can be used.
Suppose that you had created an OS facility that implemented monitors, but not condition variables. Show how to implement condition variables using Dijkstra semaphores.
Create a pseudo code solution for problem 4 using POSIX semaphores.
Create a pseudocode solution for problem 4 using Windows synchronization primitives.Suppose that you had created an OS facility that implemented monitors, but not condition variables. Show hoe to implement condition variables using Dijkstra semaphores.
The sleepy Barber Problem. A barbershop is designed so that there is a private room that contains the barber chair and an adjoining waiting room with a sliding door that contains N chairs (see Figure in Chapter 8). If the barber is busy, the door to the private room is closed and arriving customers
Give an example of a concurrent application in which a sender process could use an asynchronous rather than a synchronous send ( ) operation. Provide another scenario in which the sender should use a synchronous send ( ) operation in order for the application to operate properly.
Explain why a concurrent application written using non-blocking message receive ( ) operations could require less real time to execute than if it were written using blocking receive ( ) operations. Also explain why the approach requiring less real time may be complex to construct.
Programmer-scheduled thread packages allow the programmer to control when each thread is executed and when it must wait. Calls to the thread package (executed by a thread) allow the programmer to schedule other threads. Explain how this type of control mechanism can be used to approximate the
The Mach C threads and POSIX C threads libraries incorporate thread creation operations to create a new thread within a process’s address space. Read the documentation on either package and compare the thread creation operation with the UNIX fork ( ) operation. Explain how threads synchronize
Construct a C/C++ program for a UNIX environment to use the trapezoidal rule to approximate the integral ofƒ(x) = 1/(x+1)for the interval [0,2]. In quadrature (numerical integration), the value of the integral is approximated by partitioning the x-axis into n equal-sized segments. If xi and xi+1
Solve the quadrature problem in the previous exercise using your local (C or POSIX) threads library. You will have to read online documentation for the thread package on your host OS, where you will find that the thread primitives are quite similar to the process primitives introduced in Section
Draw a model like the one shown in Figure, for each of the following situations. Indicate whether or not there is deadlock in the situation. Assume that there is only one unit of each resource type. a. Process 1 is holding Resource 1 and requesting Resource 2; Process 2 is holding Resource 2 and
Provide a scenario in which two threads in different processes are deadlocked, and another scenario in which two threads in the same process are deadlocked. Try to use instances of concrete (real) resources like files.
Suppose three people are in a line waiting for a department store to open for “the big sale.” When the door opens, all three rush the door, bur the door is not big though for all of them to pass through at once. Describe a solution for addressing this deadlock that will allow all three people
In a music CD warehouse, sometimes orders become deadlocked because two different orders want the last two different CDs. For example, two people might simultaneously order “More Themes for Young Lovers: by Percy Faith, and “Super Natural” by Carlos Santana when there is only one copy of each
Reconsider the state diagram in Figure below. Suppose that instead of one resource type with two units of the resource, suppose the two processes shared two resource types with one unit of each type. Draw the state diagram for this system (using the same resource management model used in the
Identify safe, unsafe, and deadlock states in the state diagram shown in Figurebelow.
Assume a system with four resource types, C = , and the maximum claim table shown in Figure below. The resource allocator is considering allocating resources according to the table shown in Figure. Is this state safe?
Reconsider the state-transition diagram in Figure. Describe, in words or with a diagram, a similar state-transition diagram for a system with three processes and a single resource type with two units of the resource. How many deadlock states are in thegraph?
Based on what you studied in this chapter, explain how to change the code fragment in Figure so that deadlock cannotoccur.
Using the prevention strategy for invalidating the circular wait (Section 10.3), suggest a heuristic for avoiding the nested monitor call problem explained in Section 9.2.
A system is composed of four processes, {P1, P2, P3, P4}, and three types of serially reusable resources, {R1, R2, R3}. The number of units of the resources are C = <3, 2, 2>.a. Process P1 holds one unit of R1 and requests one unit of R2. b. P2 holds two units of R2 and requests one unit
A system is composed of four process, {P1, P2, P3, P4}, and three types of consumable resources, {R1, R2, R3}. There is one unit each of R1 and R3 available.a. P1 request one unit of R1 and one unit of R3.b. P2 produces R1 and R3 and requests one unit of R2.c. P3 requests one unit each of R1 and
A system is composed of four processes, {P1, P2, P3, P4}, two types of serially reusable resources, {S1, S2}, and two types of consumable resources, {C1, C2}. S1 has two units and S2 has three units. C1 and C2 each have one available unit.a. P1 produces C1 and is requesting two units of S2.b. P2
What is the distinction between a process address space and the primate memory addresses?
Redraw Figure using the names of the Linux/UNIX system tools used to prepare a set of C program modules-filel.c,file2.c, and file3.c- for execution. Explicitly label stdio and the C library, libc. a, in the diagram. Use the default names for relocatable object modules and absoluteprograms.
In Linux/UNIX, is it possible for the link editor to combine relocatable object modules created from compilers for different programming languages? Explain why or why not.
A memory manager for a variable-sized region strategy has a free list of blocks size 600, 400, 1000, 2200, 1600, and 1050 bytes.a. What block will be selected to honor a request for 1603 bytes using the best-fit policy?b. What block will be selected to honor a request for 949 bytes using the
A memory manager can sort the free list according to any criteria it chooses.a. How would the free list be organized for the best-fit policy?b. How would the free list be organized for the worst-fit policy?c. How would the free list be organized for the first-fit policy?d. How would the free list
A certain OS supports four different address spaces for each process, called Sa, Sb, Sc, and Sd. Suppose the memory manager loads the four address spaces into physical memory as shown: What is the physical address of each of the following process addresses? a. 0?00456789 in Sa.? b. 0?0000089a in
Suppose a variant of UNIX provides a system call that returns a pointer to a block of memory in the system address space capable of being read from and written to by any process. Explain how a UNIX user process could use such a facility to define a block of sharable memory to be used by two or more
If the operating system kept swap images-direct images of the program as it is stored in primary memory for execution – the images would have to be relocated when they were loaded back into primary memory at a different location than the one from which they were retrieved. Explain why an analysis
If a computer system does not have relocation hardware yet it implements swapping, then the memory manager will have to use a loader to recomputed the executable image from the absolute image. Would it be possible for the swapping system to reload the data and stack segments? Explain how such a
Consider the code sequence shown in Figure below for a machine with the arrangement of segment relocation registers shown in Figure. Assuming the code segment register is loaded with 0100 when the instruction in relative address 0100 is executed, from what address will the control unit fetch the
Figure is the simplified process state diagram with running, ready, and blocked states. Modify the diagram so that it includes new states to represent when a process is swapped out. Show the transitions to represent when the process is swapped due to its becoming blocked and when the memory manager
Suppose a system has a disk with 2KB disk blocks and the average access time on a block is 20 milliseconds. A process holding 40KB of memory changes from the running state to the blocked state due to a resource request. How long must the process remain blocked to justify swapping it out?
Construct a C/C++ program for a UNIX environment to use the trapezoidal rule to approximate the integral off(x) = 1/(x + 1)for the interval [0, 2]. Construct your solution so that you compute the areas of n small trapezoids by N individual worker processes. The master process should spawn N worker
Why are the page size, the number of pages in the virtual address space, and the number of page frames in the physical address space all a power of 2 in binary machine?
Suppose a paging system has 2g+h virtual addresses and uses 2h+k locations in primary memory for integers g, h, and k. Write an expression for the implied page size of the system. How many bits are required to store a virtual address?
Suppose the page size in a computing environment is 1KB. Give the page number and the offset for the following:a. 899 (a decimal number)b. 23456 (a decimal number)c. 0x3F244 (a hexadecimal number)d. 0x0017C (a hexadecimal number)
Showing 400 - 500
of 586
1
2
3
4
5
6
Step by Step Answers