How to install Pintos on QEMU

Linux, Pintos August 3rd, 2008

Just wanted to share my experience of installing Pintos on Qemu.

First of all install Qemu. In Ubuntu it is available in Universe repository. It is also available in Fedora repositories.

Ubuntu users can install qemu by typing in:

$ sudo apt-get install qemu

and Fedora users can install Qemu by typing in the following command as root user:

# yum install qemu

Note: Fedora 9 users need to make some extra changes as mentioned by Mukund in his comments to the post.

Now we are ready to install Pintos. Download Pintos from here. Extract it in some directory say ~/cs342/

Copy the perl scripts ‘backtrace’ , ‘pintos’, ‘pintos-gdb’, ‘pintos-mkdisk’ from ~/cs342/pintos/src/utils to a directory in PATH. I have added ~/bin into PATH. so i copied these scripts in ~/bin

Now open the script ‘pintos-gdb’ (the one you copied in the ~/bin) in any text editor. Find the variable GDBMACROS and set it to point to ‘~/cs342/pintos/src/misc/gdb-macros’. Now you have installed pintos-gdb.

Next go back to ~/cs342/pintos/src/utils and compile the rest Pintos utilities by typing make.

$ cd ~/cs342/pintos/src/utils

$ make

Copy the script ’squish-pty’ in the ~/bin folder or wherever you saved scripts mentioned above.

Compile pintos :

$ cd ~/cs342/pintos/src/threads/

$ make

Now open the file ~/cs342/pintos/src/threads/Make.vars in any text editor. change the last line to:

SIMULATOR = --qemu

Next open the file ~/bin/pintos (the one you copied in the PATH) in any text editor and edit the following lines:

Line no.24: replace ‘os.dsk’  with  ‘~/cs342/pintos/src/threads/build/os.dsk’

Note: Replace ~ with absolute path as perl doesnt identify ~ (Thanks to Kholu :) )

Line no.88 :    $sim = “qemu” if !defined $sim;

Line no.110:    --qemu (default) Use QEMU as simulator

Line no.111:  --bochs Use bochs as simulator

This is all. Now you are ready to run pintos. Check your installation by typing in the terminal:

$ pintos run alarm-multiple

This will create 5 threads and sleep for some predefined times. You can see all these messages in the terminal as well as in a Qemu terminal. Now you are ready to implement changes and enhance pintos.

Happy Coding !!