Answer:
False. In uniprogramning environment there is only one process running at any given time, so
there will be no need to "look for a place in the memory" to place the process - there
are no other processes running, so upon compilation the compiler knows where the
loading point of the process will be and is therefore able to generate the physical
addresses at compile time.
Answer:
No for static - the addresses are calculated at load time.
Yes for dynamic. For dynamic relocation you need
hardware support for base and limit/relocation registers (see Figure 9.5 in the book page 266).
Answer:
False. It states that the memory lost to fragmentation is about
50% the size of the allocated memory.
Answer:
Yes, if each process is allocated exactly the memory it asked for. But the
OS will (probably) have to maintain very small holes in the free list.
Answer:
TLB is a cache that stores [PageNo][FrameNo] pairs. You don't neet it for
correct execution of programs.
Answer:
You need a segment table and a page table. The address is represented as (seg#, poge#, offset) tripple.
Answer:
Answer:
Assume 2 frames.
In case of a stream A-B-A-C-A the LRU performes better - 1 fault - C forces B out and the last A is a hit and
FIFO is worse - 2 page faults - C forces A out and the last A is a miss (fault).
In case of a stream A-B-A-C-B the FIFO performes better - 1 fault - C forces A out and the last B is a hit and
LRU is worse - 2 page faults - C forces B out and the last B is a miss (fault).
Answer:
You need six reads.
Locate file descriptor for urs
Read file descriptor for urs
Read urs
Locate file descriptor for bin
Read file descriptor for bin
Read bin
Locate file descriptor for netscape
Read file descriptor for netscape
Read netscape
Answer:
See Lecture 21 page 4.
Answer:
Linked-list case
Read file's descriptor.
Traverse the linked list - 1000 reads
Write the pointer in the 1000th block to point to the new 1001st block
Write the 1001st block
Write - update file's descriptor with the new file size
------------------------
Total - 1001 reads and 2 writes
Multilevel index
Assume each indirect block has 1024 entries ==> block 1001 is in the 1st level indirect block.
Read file's descriptor.
Read 1st level indirect block.
Update 1st level indirect block - add the pointer to the new 1001st block.
Write the updated 1st level indirect block
Write the 1001st block
Write - update file's descriptor with the new file size
------------------------
Total - 2 reads and 3 writes