3.10 Exercises

  1. 1.

    Parse RISC-V’s device tree to find the amount of physical memory the computer has.

  2. 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 to sbrk and after the call to sbrk. How much space has the kernel allocated? What does the PTE for the new memory contain?

  3. 3.

    Modify xv6 to use super pages for the kernel.

  4. 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, if exec is called to run myprog arg1 and myprog ’s first line is #!/interp, then exec runs /interp with command line /interp myprog arg1. Implement support for this convention in xv6.

  5. 5.

    Implement address space layout randomization for the kernel.