Getting this to work (I am using Ubuntu for this) was really very simple. You will need to have QEMU installed before beginning.
|
|
To download, build, and run Xv6, do this:
|
|
Next, you will probably have to remove all the occurrences of -Werror
in the repo for it to compile. If you are using an old enough complier it may work as-is. But since Xv6 is frozen in time, a historically accurate rewrite of 1970s Unix for educational use, and modern compilers expect different (more modern) coding practices, this flag will probably need to be removed before you can make Xv6.
So, use a text editor (I used Visual Studio Code) to remove all the occurrences of -Werror
. There were four in total, two in the Perl script called cuth
and two in the Makefile
.
After that, Xv6 magically built and started running!
|
|
⚠️ NOTE: Xv6 is really minimal! The very basic shell doesn’t even have pwd
, nor does it keep track of what directory you are in. There are only about 15 commands and they are all in the root directory.
There are only 9031 lines of actual code (counting C, Assembly, and C/C++ Header files), plus 1055 lines of comments, plus 1229 blank lines in the entire OS!
|
|
That is really not much!
It seems that anything much I want to do with it, I will have to add it. I guess that is the point of a super-minimal teaching OS.