git
, see http://git-scm.com/book
. Make sure to read sections 1-3 to get a good understanding of its operation.
apt-get install qemu
should do it. On a mac, install Macports, then port install qemu
.
apt-get install git
. Then fetch the version of the xv6 source tree that is hosted at UIC:
git clone http://bits.cs.uic.edu/git/xv6.gitThis creates a directory
xv6
which contains all the sources. To build xv6, you need a toolchain: compiler, linker, and such. To get the basics, apt-get install build-essential
. Now, you should be ready to build and run xv6 under qemu: make qemu
.
note: If you are using a Linux machine to build xv6, and a Windows or OS X machine to run xv6 within qemu, there is an extra step involved. First build xv6 make xv6.img
, then run it on your machine. On OS X, say qemu-system-i386 -m 512 -hdb fs.img xv6.img
. Not sure how it goes on Windows, but should be quite similar.
git checkout -b hw1
.
ls
and cat
. You are to create a new program, uptime
, which outputs the number of hours, minutes and seconds that xv6 has been running, in the format hours:minutes:seconds
. There is a handy wrapper function uptime()
for the uptime system call, which you may use.
The program should be called uptime.c
, and typing make qemu
should automatically build the uptime
binary just like it builds the other binaries. Running the command uptime
in qemu should produce an output like:
current uptime is 00:03:43
git add Makefile uptime.c
, and commit your staged files git commit -m "Homework 1, first attempt"
.
git checkout master
, then apply your patch git apply hw1.patch
and try it out by building and running: make qemu
and finally running your uptime
program from inside xv6. When you've verified that all is well, git reset
to clean up your temporary changes to the master branch.
Once you have a correct patch file, send this file as an attachment to srogha2@uic.edu
. Submission is due before beginning of class, Tuesday Sept 2. Copyright 2016 The Board of Trustees of the University of Illinois.webmaster@cs.uic.edu |
WISEST Helping Women Faculty Advance Funded by NSF | ![]() | ![]() |