Answer few Operating systens and general computers related questions
Examples: Give Sample example of any one while bidding
1. Suppose we add the following instruction to MARIE's instruction set:
This instruction uses indirect addessing mode, goes to address Operand first, then uses the value at Operand as the actual address and stores the content of the AC in the memory location with the actual address. Show how this instruction would be written using RTN (register transfer notation).
2. (*) Suppose a two-lane road converges to one lane to pass through a tunnel. To coordinate the use of the tunnel, the following signal system has been installed:
A car entering either end of the tunnel causes red lights above the tunnel entrances to be turned on. As the car exits the tunnel, the lights are turned off. If an approaching car finds a red light on, it waits until the light is turned off before entering the tunnel.
What is the flaw in this system?
First in first out .... for cars intering
3. (*) Quote from the optional textbook:
"Analysis of deadlock has revealed that it cannot occur unless all three of the following conditions are satisfied.
1. There is competition for non-shareable resources.
2. The resources are requested on a partial basis; that is, having received some resources, a process will return later to request more.
3. Once a resource has been allocated, it cannot be forcibly retrieved."
Suppose the following solutions have been proposed for removing the deadlock that occurs on a single-lane bridge when two cars meet. Identify which condition for deadlock given in the text is removed by each solution
a. Do not let a car onto the bridge until the bridge is empty.
b. If cars meet, make one of them back up.
c. Add a second lane to the bridge.
4. (**) When a user program makes a system call to read or write a disk file, it provides an indication of which file it wants, a pointer to the data buffer, and the count. Control is then transferred to the operating system, which calls the appropriate driver. Suppose that the driver starts the disk and terminates until an interrupt occurs. In the case of reading from the disk, obviously the caller will have to be blocked (because there are no data for it). What about the case of writing to the disk? Need the caller be blocked awaiting completion of the disk transfer? Why?
5. (**) A system has four processes and five allocatable resources. The current allocation and maximum needs are as follows
Available Maximum Allocated
0 0 x 1 2 1 1 2 1 3 1 0 2 1 1 Process A
2 2 2 1 0 2 0 1 1 0 Process B
2 1 3 1 0 1 1 0 1 0 Process C
1 1 2 2 1 1 1 1 1 0 Process D
What is the smallest value of x for which this is a safe state (i.e., no deadlock would occur)? Why?
6.(**) What is the difference between a physical address and a virtual address of the main memory?
(*) Note: These questions are from the optional textbook with minor changes.
(**) Note: These questions are from the book "Modern Operating Systems", second edition, by Andrew Tanenbaum.