W4118 OPERATING SYSTEMS I

Fall 2013 -- Junfeng Yang

Class Virtual Machine setup instructions

We prepared a class virtual machine (VM) to make it simpler for
you to work on the programming assignments. The VM runs Ubuntu 12.04.
It comes with necessary tools such as git. Download the
compressed
VM here
and uncompress it. Since the VM is large, we recommend you download
the VM with your machine plugged into the CS wired network.

Once the VM boots, please login with user name w4118 and
password w4118.

QEMU setup instructions

QEMU is a modern and
fast PC emulator. Unfortunately, QEMU's debugging facilities, while
powerful, are somewhat immature, so we highly recommend that you use
version of QEMU patched by MIT folks instead of the stock version
that may come with your distribution. To download and build your own
patched version of QEMU on CLIC machines:

The prefix argument specifies where to install QEMU; without it
QEMU will install to /usr/local by default. For your convenience,
set PFX to be inside your home directory. The target-list argument
simply slims down the architectures QEMU will build support
for.

Run make && make install

You may also install QEMU on your host machine. On Linux, you may
need to install the SDL development libraries to get a graphical VGA
window. On Debian/Ubuntu, this is the libsdl1.2-dev package. You can
find more information about the version of QEMU we're using
here.

Running xv6 with make

The Makefile provided with xv6 has several phony targets for running the
system:

make qemu
Build everything and run xv6 with QEMU, with a VGA console in a new window
and the serial console in the terminal where you typed this command. Close
the VGA window or press Ctrl-C or
Ctrl-A X to stop.

set print pretty
Print arrays and structs in a pretty easy-to-read format.

QEMU monitor

QEMU itself has a built-in monitor available to inspect and modify
the machine state. Press Ctrl-A C in the
terminal running QEMU to get into the monitor. Refer to the
QEMU Manual for a complete instruction of QEMU monitor.

Some commands are pariticularly useful:

xp/Nx paddr
Dump in hex N words starting at physical address
paddr.

info registers
Display a full detailed dump of registers.

info mem
Display the page table in a compact form.

info pg
Display the current page table structure. Different from info mem, this
command distinguishes between PDE and PTE. Unbroken sequences of PDE's
or PTE's with identical permissions are compressed into a single line.
This command is added by MIT folks.

Remote access

You can work remotely by connecting to a machine via SSH. If
you desktop runs Linux or MacOS, you should be able to instal an SSH
client easily. For example, on Ubuntu, run

$ sudo apt-get install openssh-client

If your desktop runs Windows, you'll need to install two
programs. First, you need an SSH client, such as the
putty
SSH client or Cygwin with
the OpenSSH package. To get the GUI window working on your
desktop, you also need an X server, such as the
Xming X
Server or the
XWin32
Server. Configure your SSH client to forward
X11 streams.

Git

Git is a distributed version
control software. We use git to distributed all kernel program
assignments. To learn about Git, take a look at
the Git
user's manual, or, if you are already familiar with other
version control systems, you may want to read
this Git
overview.