This is the instructions I was given to setup xv6. This is for an operating syst
ID: 3887527 • Letter: T
Question
This is the instructions I was given to setup xv6. This is for an operating system class and I just can't get it to work. The QEMU emulator always says I'm missing files. I was hoping someone knew how to set this up properly as my instructor isn't very helpful.
xv6 is a port of a classic version of UNIX to a modern processor, Intel’s x86. It is a clean and
beautiful little kernel. The following link provides a basic introduction to xv6: http://pdos.csail.
mit.edu/6.828/2014/xv6.html. In this project, we’ll learn how to build a xv6 kernel.
1 Instructions
xv6 compiles using the GNU C compiler, targeted at the x86 using ELF binaries. xv6 can boot on real
hardware, but typically we run it using the QEMU emulator. We will install a xv6 Linux docker image
including the QEMU emulator, and then build xv6 kernel and run it on the QEMU emulator.
1.1 Installing a docker
Visit https://www.docker.com/ and check the top menu option “Get Docker”. Then follow the in-
struction to download and install a docker on your machine (either Windows, macOS).
1.2 Generating an xv6 docker process
I have created an xv6 container image shqwang/xv6 and stored it in my DockHub repository. If you
have a local username, e.g., foobar, you can run the following command to generate a container process
called xv6-projects in your local machine as this (prompt> is not a part of the command script):
prompt> docker run --name xv6-projects -v /Users/foobar/xv6:/xv6 -it shqwang/xv6 bash
You shall see the following line at the end of the output:
root@4f8a09f17d24:/#
It shows that a container process with ID 4f8a09f17d24 has been created. Most likely, you’ll see a
different ID in your environment. In the above command,
• the option --name xv6-projects is used to name the container process as xv6-projects;
• the option -v /Users/foobar/xv6:/xv6 is used to mount a local directory /Users/foobar/xv6
in the local host to the folder /xv6 in the container process. You can choose your own local
directory under /Users/foobar. With this feature, you can build xv6 inside the container process
while editing the source codes in your local machine with any of your favorite editors.
• the option -it shqwang/xv6 bash is used to download the contain image and create a container
process with a running bash shell.
Note: For Windows OS, you should run the command as follows:
prompt> docker run --name xv6-projects -v /c/Users/foobar/xv6:/xv6 -it shqwang/xv6 bash
Explanation / Answer
The latest xv6 source is available via
We also distribute the sources as a printed booklet with line numbers that keep everyone together during lectures. The booklet is available as xv6-rev8.pdf.
The xv6 source code is licensed under the traditional MIT license; see the LICENSE file in the source distribution. To help students read through xv6 and learn about the main ideas in operating systems we also distribute a textbook/commentary for the latest xv6. The line numbers in this book refer to the above source booklet.
xv6 compiles using the GNU C compiler, targeted at the x86 using ELF binaries. On BSD and Linux systems, you can use the native compilers; On OS X, which doesn't use ELF binaries, you must use a cross-compiler. Xv6 does boot on real hardware, but typically we run it using the QEMU emulator. Both the GCC cross compiler and QEMU can be found on the 6.828 tools page.
Xv6 lecture material
In 6.828, the lectures in the first half of the course cover the xv6 sources and text. The lectures in the second half consider advanced topics using research papers; for some, xv6 serves as a useful base for making discussions concrete. The lecture notes are available from the 6.828 schedule page.
Xv6 homeworks
The Xv6 homeworks consist of small programming exercises that extend xv6 in interesting ways. By getting their hands dirty with xv6, students have an opportunity to absorb xv6 and explore ideas that are not covered in the text. The homeworks are available from the 6.828 schedule page.
Unix Version 6
6.828's xv6 is inspired by Unix V6 and by:
The following are useful to read the original code:
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.