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
23
votes
3 answers

Page number and offset

I am learning the different types of memory management. I don't understand the point of having an offset bits in a virtual address. And also why page sizes are made power of 2? My primary confusion is: give me an example of an offset being used in…
user1493786
  • 325
  • 1
  • 3
  • 13
19
votes
2 answers

Why one page table per process

At first I thought there is only one page table for the whole system. But there are actually one page table per process? What is the point of having multiple page table instead of one page table. I am implementing part of os161
user308553
  • 1,238
  • 4
  • 18
  • 32
17
votes
3 answers

System calls overhead

I just started studying about system calls. I would like to know what causes overhead when a system call is made. For example, if we consider getpid(), when a system call is made to getpid() my guess is that if the control is…
3
votes
2 answers

C programming - threads, and what is void (*func)(void*, unsigned long)

I'm looking at modifying a toy OS system and I'm just trying to learn some of the code and what it does. I have been given a "Thread" structure which has as a member a "pcb" structure, which is a process control block that interfaces the thread to…
JDS
  • 16,388
  • 47
  • 161
  • 224
2
votes
1 answer

os161 parent and child thread pid

Is anyone familiar with os/161 and can answer a few questions for me? How exactly does child pid, parent pid works. I know that when you call thread_fork() you are creating another thread base on the current thread, the new thread should have a…
user308553
  • 1,238
  • 4
  • 18
  • 32
2
votes
0 answers

How does this code from OS161 for finding a colon work?

From here: /* * Set bootfs_vnode. * * Bootfs_vnode is the vnode used for beginning path translation of * pathnames starting with /. * * It is also incidentally the system's first current directory. */ int vfs_setbootfs(const char *fsname) { …
StackExchange123
  • 1,871
  • 9
  • 24
2
votes
1 answer

Pointers Accessing Incorrect Addresses OS161

I'm using OS161, and I have a piece of code that looks like this in process.c: void process_exit(int exit_code) { splhigh(); curthread->p_process->exited_flag = 1; // Process exited curthread->p_process->exit_code = exit_code; …
Ruby
  • 413
  • 1
  • 4
  • 16
2
votes
1 answer

How does threads sleep with interrupt disabled?

I am trying to understand how the code below works. This is straight out of my profs lecture slides. This P() and V() function is the part of semaphore implementation in the OS that we use in class (OS161). I think you might need understanding of…
1
vote
1 answer

OS161 : TLB miss on Load

I have a TLB miss on load error when I run the fork test , I understand this is due to passing wrong stackptr to mips_usermode , my implementation seems to revolve around few suggestions over here, would be grateful if I get corrected her. My code…
gsb
  • 41
  • 1
  • 5
1
vote
0 answers

Unable to build and install binutils in Kali linux

I was trying to install OS 161 KALI LINUX version 2020.3 64bit. The first step was to build and install binutils. The procedure I followed is shown in this . I configured the binutils and got this output https://pastebin.com/iXjFq3Zu but upon…
Digzsudi
  • 11
  • 2
1
vote
1 answer

What is the use of the type userptr_t in os161?

I'm trying to complete an assignment for an operating systems course, Here. I had a question from the assignment: What is the purpose of userptr_t? When I searched the source code for userptr_t, Here, I found this: /* * Define userptr_t as a…
StackExchange123
  • 1,871
  • 9
  • 24
1
vote
1 answer

What is the meaning of file-static out-of-line, global out-of-line and no out-of-line copy of function in inlining

I was reading the source code of OS/161 and encountered inline support code. I am not able to understand the comment provided. The comment is :- /* …
1
vote
3 answers

synchronisation primitives for increment

i am a begineer studying threads, i have a homework to solve a mutual exclusion problem with os161, to counts from 0 to 10000 by starting several threads that increment a common counter. i have no ideas how to use synchronisation primitives to…
user688550
  • 11
  • 1
1
vote
0 answers

good debugger for os161 like IntelliJ IDEA

I'm using os161 and I don't find beautiful debugger like IntelliJ IDEA Have you some idea? I have tried gdb, ddd and gdb with emacs but they are not good as IntelliJ
Lilli
  • 91
  • 1
  • 8
1
vote
2 answers

Makefile Errors - "***missing separator" & "***recipe commences before first target"

I am trying to build the userland for os161. When I type make in the command line I get the following error: Makefile 24: ***missing separator (did you mean TAB instead of 8 spaces?). Stop. I checked the Makefile at line 24 and tried adding a TAB…
cloudy_eclispse
  • 313
  • 4
  • 16
1
2 3