miércoles, 23 de noviembre de 2011

NachOS: 3rd Practical Assignment

In this post we will explain how it that we fix the execution errors in the NachOS network module.

In our third theoretical presentation we explain the three task than you need to run correctly the NachOS network module:

FIRST: you must have correctly implemented the first phase of the project, that means, the part of synchronization.
This is because NachOS needs to synchronize the input and output data operations through the network, the synchronization is implemented in the file "synchlist.h". We share to you our files, you can download at the following link.

Synch Files

SECOND: run the network module with the correct command, we look the code and read the notes in the header of each file and we conclude that the correct way is with the following command:

./nachos -m 1 -o 0 & ./nachos -m 0 -o 1 &


  • First we can see how NachOS open the 2 threads, obviously each one with different PID.
  • Next, NachOS open two sockets, an then the comunication start.
  • Each thread send 2 messages, one "question" and an "answer" 
  • The next block is the NachOS System Info, you can see that the system makes 2 Disk reads an each one receive and send two packets.
  • Finally, the clean up and close the sockets.
  • The two threads finish well. 
We see that many of you tried to run the module with a single call, such as:

./nachos -m 1 -o 0 &

which is not quite right because you have to call two instances of the program to communicate with each other.

Others tried to run 2 instances in different terminals, it also was not possible with the normal way, if you want to comunicate 2 instances of NachOS in different terminals you need fisrt call the Ubuntu sockets, this could be done by including the file, and use the socket functions defined in "sysdep.h".

Other exception that we receive it when NachOS tried to delete the swap file, that error ocurred because when we run 2 instances of the system, the first instance, at the end of the execution, delete the swap file and then the second don't have anything to delete.
We correct this exception verifying first if the swap file is still existing at the end of the execution of each thread, and if that is true, well, delete the file. 

That was all that we did, we hope that this information be useful to you.


2 comentarios:

  1. Me quedaba duda con la forma de ejecutar el programa de prueba de network; en mi caso cuando intentaba desde dos terminales diferentes, y aunque tenia errores en la implementación, lograba ver en la ejecución que se lograban comunicar antes de que se quedaran colgados los dos procesos, bueno para explicarme mejor lo que hacía era, ejecutar el comando desde un terminal 1 (./nachos -m 0 -o 1 &), luego en un terminal 2 ejecutaba el otro comando (./nachos -m 1 -o 0 &), y lo que lograba era una respuesta del terminal 2 en el terminal 1. Ahora he probado con su método y también me ha funcionado. Concluyo que es posible de las dos formas, porque inclusive el mismo código de nettest.cc dice como es la ejecución y lo indica mediante dos terminales.