Questions tagged [nachos]

Educational machine and OS simulator

Nachos is a machine and OS simulator that runs as a UNIX user process. It is useful as an educational operating system for OS design.

41 questions
0
votes
1 answer

problems compiling and running Nachos

First issue: I am trying to import stdlib.h in order to use functions like malloc() and rand(). I am working in threadtest.cc , folder threads. This is the error I get after #include In file included from…
Madrugada
  • 1,261
  • 8
  • 24
  • 44
0
votes
1 answer

Creating a thread in NachOS using a C++ class

class Producer { public: Producer(){ } void Shout(){ for(int i=0;i<10;i++){ printf("I am a producer!!\n"); } } }; void ThreadTest() { void (Producer::* ptfptr) () = &Producer::Shout; Producer prod; (prod.*ptfptr) (); …
0
votes
1 answer

How to get return value using Fork() in NachOs?

This is my code: void playerproc(int player) { switch(player) { case 1: move=(numSticks+4)%5; return move; break; case…
0
votes
4 answers

Referencing a C++ class from another file

I am having a hard time linking a C++ class that I wrote with the a separate "test" C++ file. So I have these three files: threadtest.cc, Elevator.h, and Elevator.cc. In Elevator.h I define two classes: Passenger and Elevator. When I try to…
wmarquez
  • 147
  • 1
  • 1
  • 8
0
votes
1 answer

NachOS timer.cc constructor

I am trying to create a new class in NachOS called alarmclock. In it, I need to create a timer object to use to trigger interrupts. In timer.cc, the constructor is Timer::Timer(VoidFunctionPtr timerHandler, int callArg, bool doRandom) Can someone…
Irtza
  • 33
  • 1
  • 6
0
votes
1 answer

Countdown latch with semaphores as the only synchronization primitive

Can anyone explain how to program Countdown latch with semaphores as the only synchronization primitive which are permitted to use.? Thanks.
0
votes
1 answer

Write and test sub func

I'm trying to write sub func for nachOS but when I combines it doesn't work. Don't know the reason. Details: In ../userprog/syscall.h Add : #define SC_Sub 11 int Sub(int a, int b); In ../test/ .globl Sub .ent Sub Sub: addiu $2,$0,SC_Sub …
Dzung Nguyen
  • 9,152
  • 14
  • 65
  • 104
0
votes
1 answer

an easy explanation of where to and how to use condition variables?

I have searched google for nearly 2 hours to get an idea of what are the situations of using condition variables. But I have found nothing but a bunch of irritating code snippets harder to realize. So I need clear conception regarding this.
Md. Arafat Al Mahmud
  • 3,124
  • 5
  • 35
  • 66
-1
votes
1 answer

Compiling in C: undefined reference to `memcpy'

I am working on a school project with Nachos and I am receiving some strange error. You can see my code here: just the c file, lemme know if you need more The output from the console looks like this: ../gnu/gcc -G 0 -c -I../userprog -I../threads…
Jonathan Allen Grant
  • 3,408
  • 6
  • 30
  • 53
-2
votes
2 answers

What causes a synchronization lock to get stuck?

I have this simple code, it's simply a testing case try { synchronized(this) { while(number != 4) { System.out.println("Waiting..."); this.wait(); } number = 4; …
-2
votes
1 answer

How to create random number every minute

I have a question. "random number of customers arriving for a check out is between 5 and 10 every minute." I need to put these customers in a list based on their order of their arrival time. I don't know how to generate a random numbers of…
meme
  • 3
  • 3
1 2
3