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
2 answers

NACHOS C++: Thread Fork to create data structures

I have a program that runs perfectly well when I have declare and initialize my List data structure at the top and then call my function generateID . It also works if I declare the List at the top and initialize the List inside the function. However…
krikara
  • 2,395
  • 10
  • 37
  • 71
0
votes
1 answer

What does the DEBUG statement do?

I am studying nachos for a university project and can't understand what the DEBUG(...) statement in the below code is doing. void ThreadTest1() { DEBUG('t', "Entering ThreadTest1"); Thread *t = new Thread("forked thread"); …
Ashish Agarwal
  • 14,555
  • 31
  • 86
  • 125
0
votes
2 answers

How to make classes in NACHOS (C++)

I am trying to implement a player class, so I created two files in my threads folder, player.cc and player.h player.h goes like this : #ifndef PLAYER_H #define PLAYER_H #include "utility.h" class Player() { public: …
krikara
  • 2,395
  • 10
  • 37
  • 71
0
votes
1 answer

Is it possible to pass a struct pointer to an int argument of a function?

I am working on the Nachos Operating System as part of my coursework. While modifying the codebase of the OS, I encountered the following comment for a member function that allows you to run a function inside a newly forked thread (in this OS,…
braceletboy
  • 98
  • 2
  • 7
0
votes
1 answer

Installing Nachos 3.4 Error cast from void* to int loses precision

I'm trying to install Nachos 3.4, I'm using Linux 64 bit and I have a problem, the error is casting from void* to int loses precision [-fpermissive]. I have searched many times and tried many ways such: using intptr_t, long, ,static_cast and so…
0
votes
1 answer

How to check if String has a Dot, but not in front or in the end?

I'm currently practicing for my Java Practicum Exam, most importantly NachOS, here is my trouble right now. I'm stuck at developing this right now Ask the user to input file name. The file name must contain dot (‘.’). Dot must not be in front of or…
0
votes
1 answer

expected initializer before ‘*’ token in nachos experiments

here's the definition of class Alarm:(I've made some changes to the question) //Alarm.h #pragma once #include "system.h" #include "list.h" //#include "../machine/timer.h" //void timerhandler(int dummy); void check(int which); class Alarm { public:…
Jeremy
  • 21
  • 4
0
votes
0 answers

How to write getch() in NACHOS (Java)?

So I am learning to create my own SerialConsole in nachos (Java). I learned using Semaphore.P() and Semaphore.V() to wait for user input. Everything is going well until I tried to make a function like getch() in C's conio.h. The problem is, whenever…
0
votes
0 answers

gmake all permission denied on fedora core 3 - Nachos project

I'm working on a nachOS project in Operating System Course. What I'm facing here is that I ran terminal with admin privilege but still got permission denied error when trying to build nachOS again (first time was ok, second time was when I added a…
Pearly
  • 1
  • 1
  • 1
0
votes
1 answer

NACHOS virtual memory and cache implementation

I am doing NACHOS phase 3 project (Caching and Virtual Memory) in java. I have some confusions in implementing the function given below: /** * Restore the state of this process after a context switch. Called by * UThread.restoreState() */ public…
0
votes
1 answer

Implementing KThread class in NACHOS OS

I am trying to implement the KThread.join() method in nachos OS. My sample code fragment is as follows: private KThread toJoin = null; public void join() { Lib.debug(dbgThread, "Joining to thread: " + toString()); Lib.assertTrue(this !=…
user5520111
  • 23
  • 3
  • 9
0
votes
4 answers

C++ no match for 'operator=' in my custom object array

I have a class called KernelLock, and I am creating an array of KernelLocks called myLockArray. I declare it like this: KernelLock myLockArray[150]; When I try to add a new KernelLock to myLockArray, I get the aforementioned error. Here is the exact…
Jonathan Allen Grant
  • 3,408
  • 6
  • 30
  • 53
0
votes
0 answers

Getting Elements of a Char** from an address

I'm working on Kernel programming (Nachos), and having some trouble passing an array of arguments from a userprogram into kernel land. Similar to argc, argv in C, C++, the user program passes: char *args into a syscall. In the kernel, I only get an…
Jesavino
  • 149
  • 2
  • 11
0
votes
1 answer

segmentation fault when working with threads

I get this segmentation fault. It will run the first method, and then the printf line of the 2nd method and then goes directly to a segmentation fault. I don't understand why... I deallocated the previous allocation. The moment my second method…
monkey doodle
  • 690
  • 5
  • 12
  • 22
0
votes
1 answer

error: ANSI C++ forbids implicit conversion from `void *' in assignment

I get this error message, and I don't seem to understand it. What does it mean by ANSI C++ forbids implicit conversion from `void *' in assignment? . And the Fork function only takes the function name and a number Thread::Fork(VoidFunctionPtr func,…
monkey doodle
  • 690
  • 5
  • 12
  • 22