Questions tagged [os161]

OS/161 is a simplified operating system Harvard uses for teaching the undergraduate operating systems class. It includes a standalone kernel and a simple userland, all written in C. It runs on a machine simulator, System/161, that offers simplified but still realistic hardware devices. (Neither OS/161 nor System/161 is in any way affiliated with IBM.) [Copied with slight modification from http://www.eecs.harvard.edu/~syrah/os161/]

OS/161 is a simplified operating system Harvard uses for teaching the undergraduate operating systems class. It includes a standalone kernel and a simple userland, all written in C. It runs on a machine simulator, System/161, that offers simplified but still realistic hardware devices. (Neither OS/161 nor System/161 is in any way affiliated with IBM.)

Copied with slight modification from Harvard's Syrah homepage on OS/161.

38 questions
0
votes
1 answer

How to share one variable between 2 .c files?

Consider a variable abulo. I am trying to share abulo between 2 .c files. Here is what I did -- Created a.h . This file contains the line, extern int abulo; a.c contains a statement like this, int abulo = 0; in b.c, a.h has been included. Then…
Pavel
  • 138
  • 2
  • 4
  • 16
0
votes
2 answers

How semaphore value is checked using '==' operator?

A semaphore is declared and created like this -- static struct semaphore *done; done = sem_create("done",0); // semaphore value initialized to zero Now what happens when, if(done==NULL) { //Something done here... } the if condition is…
Pavel
  • 138
  • 2
  • 4
  • 16
0
votes
1 answer

trapframe register values for prog name and argv

I am working with os161 and I want to find register values for char *program name and char **argv to pass to execv system call from traframe structure trapframe->tf_a1 stores argv values but the datatype of all is u_int32 in trapframe How can I find…
user1079065
  • 2,085
  • 9
  • 30
  • 53
0
votes
1 answer

extern keyword shows undefined refence to my function

I have my file where I have declared functions function1 and function2 include.h in /dir1/dir2/dir3/dir4/ I have defined all the functions and variables in file include.c at path /dir1/dir2/dir3/dir5/ and I am using these functions at…
user1079065
  • 2,085
  • 9
  • 30
  • 53
0
votes
1 answer

thread_fork working on kernel

I am working on OS161 where C pthread library is not primarily supported. My current objective is to understand the sys calls and make some simple programs run. my simple function has following code: int id = 1; long id2 = 1; int ret =…
user1079065
  • 2,085
  • 9
  • 30
  • 53
0
votes
1 answer

"bmake: no system rules (sys.mk)" when trying to build OS161 on Mandriva

I'm TAing an Operating Systems class, and I'm trying to get a working install of Harvard's OS161 set up on our Mandriva lab machines. I've got the toolchain set up, but when I try to build the source with bmake, I get the following error: "bmake: no…
jmite
  • 8,171
  • 6
  • 40
  • 81
0
votes
2 answers

how to get pointer to user memory address space in Os/161 in execv

I am writing execv(char *program, char **args) call in Os/161. So, I get a copy of data user provided in program and in args in kernel space. Then I create brand new address space to which program with args is loaded. The question is how to find…
Asterisk
  • 31
  • 2
  • 3
-1
votes
2 answers

implementation of fork system call in os161

I am trying to implement fork call in os161 but after running kernel i get following error: pseudo flow of my sys_fork function: create new address space, trap frame declare new thread pointer -- ptrthread -- i have not assigned memory…
user1079065
  • 2,085
  • 9
  • 30
  • 53
1 2
3