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 tosbrk
and 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
exec
traditionally 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, ifexec
is called to runmyprog
arg1
andmyprog
’s first line is#!/interp
, thenexec
runs/interp
with command line/interp
myprog
arg1
. Implement support for this convention in xv6. -
5.
Implement address space layout randomization for the kernel.