The Motorcycle OS Test

 

 1) Assume we’re talking about a big mainframe.  Which of the following instructions should only run in privileged mode (monitor mode)?
  a) Change the interrupt table.
  b) Disable interrupts.
  c) Change the memory map page table.
  d) Change the spark plugs.
  e) Power down the machine.
  f) None of these.

 

2)      Suppose my computer does not have privileged instructions.  Instead it has the OS burned into ROM so that it is protected.  Can this method work to make a secure operating system?|
a) Yes sir!
b) No ma’am!

 

 

3)      Which of the following things are shared by any two threads that came from the same process?
   Code                File Descriptors                  Page Table
   Data                  Allocated RAM                 Interrupt tables

         local variables   global variables               None of these

 

4) Beyond the time delay, what does a process notice when it loses the scheduler takes the CPU and then later gives it back?
    a) The CPU registers have changed.
    b) The stack has changed.
    c) The memory for this process has changed.
    d) None of these

5) Who does scheduler aging help?
   a) Low priority processes
   b) High priority processes

6) Suppose I’m using priority scheduling.  I want to minimize the total time all processes have to wait for the CPU.  In what order should I set the priorities to do this?





7) Suppose I have a priority scheduler.  While a low priority task has the CPU, a higher priority task becomes available.  What do I do?
   a) Continue the low-priority task

   b) Run the high priority task

   c) If you are preemptive run the high one; if you are not preemptive continue the low one.

8) I’m using round-robin scheduling.  If I set the time slice size to 1 million per second, what might I notice.
   a) The system is very responsive, with little delay between input and answer.
   b) The system is very slow, and seems almost locked up at times.
   c) Round Robin doesn’t have time slices.

 

9)      (3 points) The Motorcycle Assembly Machine (Mam) ) is a very old machine.  It does not use interrupts to tell the mainframe when the box has been sealed, and a new box may be sent.  Instead, there is a memory location that has the value "1" when the machine is ready for a new box, and "0" when the machine is busy.  The OS checks the memory location periodically, and sends a box when the value is "1".
This is not called interrupt driven IO.  It's normally called ____________________________________________
List an advantage of this technique over interrupt-driven I/O

List a disadvantage of this technique over interrupt-driven I/O

 

10)  My OS uses a normal one-level paging scheme, with 32 bit addresses and 4K pages.  If a process requests 17K of RAM, how many entries in it's page table?

a.       4

b.      5

c.       (2 ^ 32) / (4 * 1024)

d.      2 ^ 32

11)   My OS wants to use virtual memory and swap space so that it can run programs that seem to use more memory that the mainframe really has.  The designers seem to have two choices on where to store their paged-out ram.

They can store it on the hard drive.  The hard drive can answer any request in 10 ms, and has a bandwidth of 40 megabytes/second.

The Ethernet-Based-Storage-Device can answer any request in 1 ms, and has a bandwidth of 10 megabyes/second.

The page size is 4K.  Which device can answer requests faster?  (BTW, these are semi-realistic numbers.)

12)  Consider the following set of processes.  Which one runs at time twenty using round robin without aging with preemption with a timeslice of 2?

Process

Time Needed

A

3

B

2

C

4

D

1

13)  My OS has allocated 1000 memory allocations totaling 4000 pages each of 4K.  How much memory is wasted in internal fragmentation? ________  How much memory is wasted in external fragmentation?  ________

14)  My OS has allocated 1000 memory allocations totaling 16,000K.  How much memory is wasted in internal fragmentation? ________  How much memory is wasted in external fragmentation?  ________

14) Which of the following should be done on every system call. (Circle all that apply.)

                                                               i.      Transfer control to the kernel.

                                                             ii.      Check arguments (if any) for validity.

                                                            iii.      Create/fork a new process to handle the request.

                                                           iv.      Write console error message.

                                                             v.      Reboot computer if day-of-week = Sun.

15) (T/F) A process waiting for an I/O operation to complete but otherwise ready to run is in the READY queue?

16) Which of the following algorithms is subject to starvation?  (choose all that apply).

      • First Come First Serve
      • Round robin
      • Shortest Job Next
      • Highest Priority Next
      • Multilevel feedback queue without aging

17) (T/F) Suppose two processes are each waiting for a lock held be the other.  Process A will wait 10 minutes for the desired lock, and process B will wait 10 seconds.  Are these processes in a deadlock?

18) Why would a page table have a page entry that does not give any of read, write or execute permissions?




19) When a process is finished waiting for an I/O to complete, it normally moves to the

      • Run Queue
      • Ready Queue
      • Wait Queue
      • Willing-and-able queue.
      • Exit(terminate) queue.
      • All or none of the above

20) What is a TLB (Translation Lookaside Buffer) (chose ONE)

      • A cache onto normal RAM for faster access.
      • A cache onto the segment registers for a segmented memory scheme.
      • A cache onto the page table for a page-based memory scheme.
      • A cache onto device registers for faster access.
      • All or none of the above.

 

            21)On a machine with 32 bit addresses and a page table containing 2^20 pages, how large is each page?  _______________________

22)One problem with the Least Recently Used page replacement algorithm is ... (choose ONE)

      • Is not the proveably optimal strategy like the frequency based approaches.
      • Requires perfect knowledge of the future like Belady's Min.
      • Has a common worst case.
      • Can be unfair to processes that need lots of CPU time.
      • None of the above.
      • All of the above except that choice containing the word "none".

            23)The clock algorithm chooses as pages suitable for replacement (choose ONE)

Pages that have not been used for a while (like LRU)
Pages that belong to low-priority processes (like process-based schemes)
Pages of the operating system's code
Pages that were brought in longest ago (like FIFO).