In this post we will explain how it that we fix the execution errors in 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.
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 &Results:
- 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.