qemu-img convert -O vmdk xv6.img xv6.vmdk
and the same for fs.img. Then create a VMWare VM, and replace any disks (including CD-ROM's) with these two images. xv6.vmdk first, then fs.img. Start the VM, and xv6 should boot up.
To try a new version, first shut down the VMWare VM. Then make
your updated sources, convert the images as per above, and start the VM back up.
The lock implementations will be tested using programs starting with race
. The first program that actually uses locks is race2.c. It includes the header file "multilock.h". By changing #define spinlock
to #define waitlock
etc, you can switch the lock type used.
(I tried to do this more elegantly with the ## operator and defines passed in from the Makefile, but failed. Suggestions welcome!)
xchg
operator to implement a basic spinlock. The functions spinlock_init, spinlock_acquire and spinlock_release have empty definitions in uspinlock.h. Implement real versions of these functions in uspinlock.c.
xadd
) operation is used instead of a compare and exchange. When entering acquire, take a ticket by incrementing a queue count. Then wait until your number comes up on a dequeue count. Upon release, increment the dequeue count. Fill in ticketlock.c and ticketlock.h.
Copyright 2016 The Board of Trustees of the University of Illinois.webmaster@cs.uic.edu |
WISEST Helping Women Faculty Advance Funded by NSF | ![]() | ![]() |