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 hw1
.
ls
and cat
. You are to create a new program, divide
, which takes two integer arguments on the command line, and prints out the value of the first argument divided by the second argument.
Name the program divide.c
, and make sure that typing make qemu
automatically builds the divide
binary just like it builds the other binaries. For a correct implementation, running divide
in qemu should produce an output like:
100 / 5 is 20
4 / 5 is 0.8
2 / 3 is 0.66
As shown, output up to two decimals, but no trailing zeroes.
If you install the package expect
, you can test your solution by running make test
.
git add Makefile divide.c
, and commit your staged files git commit -m "Homework 1, first attempt"
.
git push turn-in hw1:hw1
to push your local hw1 branch up to the turn-in repository.
alternative push methods
If you used a different name for your local branch, or forgot to use a branch altogether, you could also do:
git push turn-in anotherbranch:hw1
or
git push turn-in HEAD:hw1
to push whatever local branch you currently have checked out.
make test
to check that your divide program works correctly.
Copyright 2016 The Board of Trustees of the University of Illinois.webmaster@cs.uic.edu |
WISEST Helping Women Faculty Advance Funded by NSF | ![]() | ![]() |