4.8 Exercises

  1. 1.

    The functions copyin and copyinstr walk the user page table in software. Set up the kernel page table so that the kernel has the user program mapped, and copyin and copyinstr can use memcpy to copy system call arguments into kernel space, relying on the hardware to do the page table walk.

  2. 2.

    Implement lazy memory allocation.

  3. 3.

    Implement COW fork.

  4. 4.

    Is there a way to eliminate the special TRAPFRAME page mapping in every user address space? For example, could uservec be modified to simply push the 32 user registers onto the kernel stack, or store them in the proc structure?

  5. 5.

    Could xv6 be modified to eliminate the special TRAMPOLINE page mapping?

  6. 6.

    Implement mmap.