3.9 Exercises
-
1.
Parse RISC-V’s device tree to find the amount of physical memory the computer has.
-
2.
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.
-
3.
Modify xv6 to use super pages for the kernel.
-
4.
Unix implementations of
exectraditionally include special handling for shell scripts. If the file to execute begins with the text#!, then the first line is taken to be a program to run to interpret the file. For example, ifexecis called to runmyprogarg1andmyprog’s first line is#!/interp, thenexecruns/interpwith command line/interpmyprogarg1. Implement support for this convention in xv6. -
5.
Implement address space layout randomization for the kernel.