Any one know NachOS ??

This forums is for OS project announcements including project openings, new releases, update notices, test requests, and job openings (both paying and volunteer).
Post Reply
X-KAM-X

Any one know NachOS ??

Post by X-KAM-X »

Hi there~

Is there any one know NachOS ?

Do anyone did some project about it?

I am working with it now.

If there's any one tried it before.

Please share some experience with me. Or talk about it here. ^.^
PH
Posts: 1
Joined: Fri Oct 24, 2008 5:07 am

Re: Any one know NachOS ??

Post by PH »

I am new in Nachos and i am trying to make a ready example work.

Example: modify the main program of Nachos (main.cc) to implement a “-S” command-line flag for Nachos that invokes the semaphore selftest function.

main.cc

Code: Select all

#define MAIN
#include "copyright.h"
#undef MAIN

#include "utility.h"
#include "system.h"


// Start Changes ++++++++++++++++++++++++++++++++++
extern void SelfTest(void), Copy(char *unixFile, char *nachosFile);
// End Changes +++++++++++++++++++++++++++++++++++++
extern void ThreadTest(void), Copy(char *unixFile, char *nachosFile);
extern void Print(char *file), PerformanceTest(void);
extern void StartProcess(char *file), ConsoleTest(char *in, char *out);
extern void MailTest(int networkID);


#ifdef THREADS
ThreadTest();
#endif
for (argc--, argv++; argc > 0; argc -= argCount, argv += argCount) {
argCount = 1;
if (!strcmp(*argv, "-z"))         // print copyright
printf (copyright);

// Start Changes +++++++++++++++++++++++++++++++++++++++++
if (!strcmp(*argv, "-S"))         //we compare the string that we enter with “S”
{
SelfTest();		          //invoke the semaphore SelfTest function
continue;
}
// End Changes +++++++++++++++++++++++++++++++++++++++++++

#ifdef USER_PROGRAM

if (!strcmp(*argv, "-x")) {        // run a user program
ASSERT(argc > 1);
StartProcess(*(argv + 1));
argCount = 2;
synch.cc

Code: Select all

void
Semaphore::V()
{
Thread *thread;
IntStatus oldLevel = interrupt->SetLevel(IntOff);
thread = (Thread *)queue->Remove();
if (thread != NULL)	   // make thread ready, consuming the V immediately
scheduler->ReadyToRun(thread);
value++;
(void) interrupt->SetLevel(oldLevel);
}


// Start Changes +++++++++++++++++++++++++++++++++++++++++++++++++++
Void SelfTest()
{
Semaphore *a = new Semaphore("ping", 0);     // pointer of type semaphore pointing											// to a new semaphore “ping”													// initialized with dummy variable 0
printf ("Invoking semaphore SelfTest() function\n");
a->SelfTest();				 //the actual invoking of the SelfTest funtion
printf ("Semaphore SelfTest() function stopped\n");
}
// End Changes ++++++++++++++++++++++++++++++++++++++++++++++++++
// Dummy functions -- so we can compile our later assignments
// Note -- without a correct implementation of Condition::Wait(),
// the test case in the network assignment won't work!
Lock::Lock(char* debugName) {}
Lock::~Lock() {}
void Lock::Acquire() {}
void Lock::Release() {}
Expected Output: The two printf statements
Actual Output: a normal execution on nachos like the flag wasnt invoked at all

Where is the mistake, why cant i see those outputs?
( Could there be smth wrong with the content of main.cc synch.cc or synch.h )

Waiting for a reply
Ill be online
User avatar
xyjamepa
Member
Member
Posts: 397
Joined: Fri Sep 29, 2006 8:59 am

Re: Any one know NachOS ??

Post by xyjamepa »

HELLO...this topic was made five years ago,
look at the date man. #-o
The man who follows the crowd will usually get no further than the crowd.
The man who walks alone is likely to find himself in places
no one has ever been before.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Any one know NachOS ??

Post by Combuster »

Let alone that the author won't see *any* mails about that you replied.
Best contact him ouside the forum.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply