Skip to content

8 - XV6 Exercise of Choice

Potential XV6 Exercises:

Processes and Threads

(5) Find the code implementing the shell

  1. Discuss how the shell works, e.g., make a flow diagram for a single shell command; how does one add "commands" to the shell?
  2. Find the code the implements directy change, i.e., the cd shell command; why does it have to be built directly into the shell?
  3. Discuss how scripting could be added to the shell
  4. Discuss if the shell is part of the operating system. Should it be?

Scheduling

(1) Find the code for the scheduler of XV6.

  1. Is the scheduler preemptive or cooperative? Is that a good or bad design decision?
  2. Explain how the scheduler works, in particular, how does XV6 choose the next process to run?
  3. Discuss the scheduling policy: what are the advantages and disadvantages, is it a good choice for a desktop OS? What does "good choice" mean?
  4. Discuss how to implement a different scheduler, e.g., a fixed priority scheduler that always picks the process with the highest priority.

Memory Management

(1) Find the code that defines the memory layout of XV6

  1. Explain the memory layout of XV6.
  2. Find and explain the code that sets up memory layout for processes in XV6, i.e., memory layout for users of XV6.

(2) Find the code that handles the virtual memory of XV6

  1. Explain the format for virtual addresses used in XV6.
  2. Find and explain the code for converting between "real" and virtual addresses.
  3. Explain how segments are used in the kernel.
  4. Find and explain the implementation of XV6's page tables.
  5. How are page tables organised (how many levels)?
  6. How big (potentially) is a page table?

Paged Memory

(1) Find the code that handles the virtual memory of XV6

  1. Explain the format for virtual addresses used in XV6.
  2. Find and explain the code for converting between "real" and virtual addresses.
  3. Explain how segments are used in the kernel.
  4. Find and explain the implementation of XV6's page tables.
  5. How are page tables organised (how many levels)?
  6. How big (potentially) is a page table?

Last update: May 31, 2019