Tutorial Week 10

Questions

Virtual Memory

Q1: What effect does increasing the page size have?


Q2: Why is demand paging generally more prevalent than pre-paging?


Q3: Describe four replacement policies and compare them.

Q4: Translate the following virtual addresses to Physical Addresses using the TLB. The system is a R3000. Indicate if the page is mapped, and if so if its read-only or read/write.

The EntryHi register currently contains 0x00000200.

The virtual addresses are 0x00028123, 0x0008a7eb, 0x0005cfff,0x0001c642, 0x0005b888, 0x00034000.

TLB
EntryHiEntryLo
0x000282000x0063f400
0x000342000x001fc600
0x0005b2000x002af200
0x0008a1000x00145600
0x0005c1000x006a8700
0x0001c2000x00a97600

Q5: Describe programmed I/O and interrupt-driven I/O in the case of receiving input (e.g. from a serial port). Which technique normally leads to more efficient use of the CPU? Describe a scenario where the alternative technique is more efficient.

Q6: A device driver routine (e.g. read_block() from disk) is invoked by the file system code. The data for the filesystem is requested from the disk, but is not yet available. What do device drivers generally do in this scenario?

Q7: An example operating system runs its interrupt handlers on the kernel stack of the currently running application. What restriction does this place on the interrupt handler code? Why is the restriction required?