3.10 Exercises
-
1.
Parse RISC-V’s device tree to find the amount of physical memory the computer has.
-
2.
Write a user program that grows its address space by one byte by calling
sbrk(1). Run the program and investigate the page table for the program before the call tosbrkand after the call tosbrk. How much space has the kernel allocated? What does the PTE for the new memory contain? -
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.