OS/Pintos Project

[pintos setup 2번째 방법] Installing PintOS on Linux Ubuntu 10

Binceline 2014. 4. 14. 05:06

http://knowledgejunk.net/2011/05/03/installing-pintos-on-linux-ubuntu-10/


I guess the title is a little bit misleading and I think you can do this in any kind of Linux distribution you can find. However, I tried this method in Ubuntu 10 and it works perfectly. Also, although I state this as installing PintOS on Ubuntu 10, what I’m doing is rather installing PintOS on a Boschs virtual machine on Linux. But since that will be a long-ass title, I think this is simpler.

Anyway, let’s get busy! PintOS is actually a small operating system with limited functionalities. Perhaps the reason for using such crappy OS is to make yourself acquaintance with how OS really works by implementing synchronization, memeory management, scheduler, and other things that an OS does. I will try to post a sample problem concerning operating system if I have time, but now, let’s focus on how to get it done.

1. Downloading PintOS

Well of course you have to download it first to get this done. If you don’t know how to find one, you can use the link I provide you with:

http://courses.mpi-sws.org/os-ss11/assignments/pintos/pintos.tar.bz2

Untar the file and put in the directory of your choice. In this case I use/home/kazasou/workspace-os.

2. Installing Bochs

Boschs is a virtual machine that is suitable for running PintOS. You can actually can use other virtual machine such as Qemu or VMware Player, but in this case, I think I will use Boschs. The assignment that was given instructed to use the binary version of Bochs but I guess for simplicity, I like it to just install the Boschs application. So, in your terminal, type:

sudo apt-get install bochs

You might also required a Bochs-x installation for the GUI of the Boschs virtual machime so let’s do that also:

sudo apt-get install bochs-x

If you are done with your Bochs installation, let’s proceed to the next part.

3. Configuring environment for PintOS

Next part is to direct the Bochs application to your PintOS and create a bash script so you can run PintOS command on your terminal. Make sure you have the tcsh command for your terminal. If not, then you can just simply install tcsh by typing:

sudo apt-get install tcsh

Once you have the tcsh command, type:

tcsh

to go to a tcsh shell and create a file .tcshrc in your home directory (/home/kazasou). You can use vi or vim to edit the .tcshrc script but I personally love to use vim:

sudo apt-get install vim

vim .tcshrc

In the .tschrc file, put this line:

set path = (/home/kazasou/workspace-os/pintos/src/utils $path)

Notice that the path of the PintOS directory should resemble the directory of PintOS you have put into. If you have put the line, save the file and invoke source command to compile the .tcshrc script:

source .tcshrc

Now, exit the .tcshrc shell to return to your bash shell. Edit the .bashrc script on your home directory:

vim .bashrc

Run along to the end of the line and add the following line in the .bashrc file:

export PATH=”/home/kazasou/workspace-os/pintos/src/utils:$PATH”

Notice also that the PATH has to point to the directory of PintOS you have put in. If you are done, then you have successfully have a running PintOS at your disposal.

4. Running PintOS

Preferably, I like to install build-essential just to make sure I can compile the source file in the PintOS directory:

sudo apt-get install build essential

But if you are able to already compile PintOS source or C file then I guess you are okay to go. So, let’s try to run alarm-multiple test in the PintOS directory. Go to the../pintos/src/thread/ and run make command. Then, run the alarm-multiple by typing:

pintos — run alarm-multiple

If this brings you to a Bochs interface and run the alarm-multiple, then PintOS has successfully run in your system. Congratulation!

반응형