October 31, 2011

September 14, 2011

Assignment 1 - Practical Part

Screenshots of the code and its execution in the terminal. At the end I put the same code, but I can't show whit syntax highligther because the Internet in the UANL is very bad, and I need to modify the HTML code.

File synch.cc.


File threadtest.cc with our code.




We don't have any error after compile.


Screenshot of Producer-Consumer execution with semaphores.


Screenshot of Producer-Consumer execution with locks.


Some code:
Lock * L = new Lock("Lock");
void ConsumerLock(int which) {
  while (1) {
    if (disponibles > 0) {
      L->Acquire();
      disponibles--;
      printf("Thread %d >> Consumidor >> disponibles %d\n",
              which, disponibles);
      L->Release();
    }
    if (disponibles == 0) {
      currentThread->Finish();
    }
    currentThread->Yield();
  }
}
void ProducerLock(int which) {
  while (1) {
    if (disponibles < 15) {
      L->Acquire();
      disponibles++;
      printf("Thread %d >> Productor >> disponibles %d\n",
              which, disponibles);
      L->Release();
    }
    if (disponibles == 15) {
      currentThread->Finish();
    }
    currentThread->Yield();
  }
}
void ThreadTestLocks() {
  DEBUG('t', "Entra al ThreadTestLocks");
  printf("Locks\n");
  
  Thread *t = new Thread("Consumer");
  t->Fork((VoidFunctionPtr)ConsumerLock, (void *)1);

  Thread *tr = new Thread("Productor");
  tr->Fork((VoidFunctionPtr)ProducerLock, (void *)1);

  ProducerLock(0);
}

September 12, 2011

Assignment 1 - Theoretical Part

Here are the slides from our presentation.
Assigntment 1 Theoretical
Ver más presentaciones de Saul Gausin

August 24, 2011

How to compile NachOS on Ubuntu 10.10

Before starting it is recommended make a folder called nachos,once we will open the folder and type the following instructions to download NachOS source code and MIPS cross-compiler.
NachOS source code :

MIPS cross-compiler :

Or you can download directly from this server:
If you already download those files,now we will extract the files.
Extracting NachOS code

Extracting MIPS cross-compiler, you will need to be in super mode.

Now before execute NachOS and compiler to check that all be correct.We have to check if our architecture of  32 bits or in another case could be 64 bits,if we have an architecture of 64 bits, we have to follow a brief tutorial,in this moment if you don't know the architecture of yours computer you could check with the following command:

If the print is "x86_64" your architecture is 64 bits.
If the print is "i686" or  "i386" your architecture is 32 bits(like the picture).
If your architecture is 32 bits, skip the next two pictures,in another case, if your architecture is 64 bits follow this brief tutorial:
The first thing to do is go to the code's folder,if you are there, open the file "Makefile.dep" to comment the following:

After that, let's uncomment the following:

We will type the next command to compile NachOS from code's folder:

If is already compiled in the terminal, you will see something like this:

To check if this run correctly,we will open the folder /threads/ from code's folder, and we will type the next commands :

Must appears this:

To check if this really works our MIPS cross-compiler type the following commands:

And must print this:



This is all ,if you have a problem tell us and may be can help you to find a solution.
Link reference:

August 11, 2011

Team OS

We are the "Team OS", this semester we will work with Nachos.

The version that we use is 3.4
And the language of our choice is C++

Team members are:
Esteban González
Saúl Gausin