(Disk/Net) Suppose Catbert has a computer that allows him to seek to any disk page in 10 ms, and transfer 1 page/ms thereafter.  He can also access a RAMdisk across a network with a 1 ms latency and 3 ms/page transfer rate.  Catbert wishes to implement a virtual memory subsystem for an application that is essentially random in its access patterns.  Which would be faster?  Why?

 

It takes more hardware to implement pages than segments, yet most computers use pages to implement virtual memory instead of segments.  Why?

 

Circle all of the scheduling algorithms that can exhibit starvation
Round Robin                      First Come First Serve          
Shortest Job Next            Baby Comes Next

 

Suppose that it takes 100 ns to access a location in RAM assuming the translation is in the TLB (the MMU's cache).  Further, it takes 200 ns to load the TLB using a normal page table.  The TLB hit rate is 99.9%.  How long does the average memory access take?

 

 

Kobe Bryant (a better player than any Pacer) wants to store and then access repeatedly a zillion small objects (12 bytes each).  Which will cause fewer page faults, a 10M hash table accessed randomly, or a 10M array accessed linearly?  He can only afford 5M of RAM.

 

 

 

My computer has 4K byte pages.  I have 1,000 memory allocations to do.  My total RAM size is a gigabyte.  Average memory allocation size is 100K, but allocations vary greatly in size.  What amount of memory is wasted due to external fragmentation?  _____________ What amount do to internal fragmentation? _____________  Does everything fit into the RAM available?

 

I have a program that has 100K of executable code, and needs 50K to store data.  I want to run 10 copies of this program on an operating system using virtual memory, like Linux or Windows.  I'd like everything to fit into RAM, with no swapping or paging.  How much RAM do I need?

 

Looking at a page table, what does it mean if the  'dirty bit' is set?

 

The factory contains many hundreds of devices with requirements like "Must get the correct command with 20 milliseconds or the currently assembled box of twinkies will contain extra twinkies.", and a few machines that say "Must receive the correct command with 40 ms.  Failure to receive the correct comand in the correct timeframe will result in destruction of the machine's motor assembly."

  1. The operating system must be hard real time
  2. The operating system can be soft real time

Suppose a normal process using TwinkyOS runs the following code.  Remember that TwinkyOS uses a one-level page table.  Is the address a virtual or physical address?

setToTwelve() {
   char *wrapper = 0123456;
   *wrapper = 12;
}

 

TwinkyOS 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?

My operating system uses the one handed clock algorithm.  The page table is shown below, and the 'hand' is about to examine the first entry.  What page do I replace, and do I need to write it to disk?  Finally, show the page table after the page has been replaced.

     Page to replace __________  Write to Disk? _______________

Physical Page Number

2

3

4

7

6

Dirty

Y

Y

N

N

Y

Referenced

Y

Y

Y

N

N