Pintos is a minimal operating system for x86 hardware used primarily for instructional purposes (eg.). QEMU is an open-source hardware emulator typically used for operating system development. Debian is a linux operating system, regular style.
Step #2 – QEMU:
sudo apt-get install qemu
To test everything is working as it should at this point, you can download a small linux kernel image here (Sec: disk images). Then:
bzip2 -d linux-0.2.img.bz2 qemu linux-0.2.img
You are now running a minimal linux system on emulated x86 hardware, which is in turn running on a full-featured linux system (debian) on real (probably also x86) hardware. Press ctrl-alt to get out of the minimal linux system if you get stuck with it stealing all your keystrokes.
Step #3 – Pintos:
- 3.A – Download pintos.
- 3.B – Fix pintos to default to QEMU (rather than bochs) by applying the following diff:
Index: threads/Make.vars ======================================= @@ -4,4 +4,5 @@ -SIMULATOR = --bochs +#SIMULATOR = --bochs +SIMULATOR = --qemu Index: utils/pintos ======================================= @@ -85,7 +85,7 @@ - $sim = "bochs" if !defined $sim; + $sim = "qemu" if !defined $sim; @@ -107,8 +107,8 @@ - --bochs (default) Use Bochs as simulator - --qemu Use QEMU as simulator + --qemu (default) Use QEMU as simulator + --bochs Use Bochs as simulator
- 3.C – Compile pintos:
cd threads/ make
- 3.D – Run a test app with pintos:
cd threads/build/ ../../utils/pintos run alarm-multiple
- 3.E – You may wish to throw pintos in your default path (some of the scripts provided require it’s there). There are many ways to do this, this is my favorite:
sudo ln -s `pwd`/utils/pintos /usr/local/bin/
And that’s it! In step 3.D you finished up by running a little test app that created 5 threads that slept for varying predefined periods of time with some messaging to the console, thus testing pintos’ scheduling/threading abilities. You’re now ready to augment and enhance pintos… coffee anyone?