This assignment is due on Monday, 27 November, no later than 2:00 p.m.
Although you probably haven't noticed it, the simulated hardware provides programs with a luxurious 11-bit address space in which to run. Taking a 32-word disk block as the basic unit of memory management, that means a program may occupy 64 blocks. Unfortunately, user space is only 32 block long.In this assignment, you'll be modifying your operating system to let the hardware run programs larger than 32 blocks, and you'll be doing it by implementing paged virtual memory.
This assignment implements no new system calls.
This assignment modifies the invalid-address interrupt so it can determine why an invalid address occurred. A process causing an invalid-address interrupt because of a page fault should not be killed, while a process issuing an invalid address should be.
Don't forget to recompile and relink your code against the new files.
.h
files to familiarize yourself with the
virtual-memory facilities proved by the simulator. There have been
siginificant changes between the assignment 2 and assignment 3 versions of the
.h
files; you need to be aware of the differences - and understand them -
to help complete assignment 3 with a minimum of pain and suffering.
sys_base
to dev_top
- 1 (inclusive at both ends), while a valid
virtual address occupies the range vmem_base
to vmem_top
- 1
(inclusive at both ends).
fetch()
and store()
routines are accesses: mass.memory->page_table
.
This step familiarizes you with virtual memory and the page table. Because all a process's pages are pre-loaded before execution, no page faults occur during process execution and there is no paging activity.
You will need to change your invalid-address interrupt handler to let it distinguish between invalid addresses and page faults, and to let it handle the page faults. Probably the easiest way to add paging is to make a process ready to run without reading in any of its pages; when it starts to execute, the process will page fault in its first page and you're off and running.
This technique is known as pure demand paging. An alternative is to implement prefetch - a process needs its first page, so just read it in and avoid the page fault. Prefetch is more efficient than pure demand paging is, but it is also, in my opinion, harder to implement than pure demand paging is.
To get a good grade on this assignment, your os should be able to do at least this much.
pa1-bigpgms.dsk
batch disk and pa3 batch disks, modify the os to allow
user-process device i-o to work with virtual addresses.
Once this step is completed, your os should be able to run all the batch disks.
This page last modified on 29 November 2000.