Questions tagged [xv6]

xv6 is a small Unix-like teaching operating system made by MIT for its 6.828 OS course. It is inspired by Unix Version 6.

326 questions
18
votes
2 answers

C Function Explanation

Can someone please explain to me the syntax of this function? where SYS_fork is some constant and sys_fork is a function. static int (*syscalls[])(void) = { [SYS_fork] sys_fork, [SYS_exit] sys_exit, [SYS_wait] sys_wait, [SYS_pipe] …
15
votes
3 answers

how do i add a system call / utility in xv6

Can any one tell me/ point me any references to how to add a system call / utility in XV6 exhaustive search on google was futile and hacking the hard way also was not productive so far . the reference book also did not have any hello world example…
sashank
  • 1,531
  • 2
  • 13
  • 26
14
votes
2 answers

Debugging user-code on xv6 with gdb

I'm doing an OS class that's based on xv6 and I wrote a program that needs to run on it. I know that I can debug kernel code with make qemu-gdb but I'm not sure how to debug my own user program. Lets say I want to debug cat, how would I go about…
Nathan Dortman
  • 406
  • 1
  • 7
  • 20
13
votes
1 answer

How to pass a value into a system call function in XV6?

I am attempting to create a simple priority based scheduler in XV6. To do this, I also have to create a system call that will allow a process to set its priority. I have done everything required to create the system call as discussed here and…
bertmoog
  • 483
  • 1
  • 3
  • 14
10
votes
6 answers

How to compile and run xv6 on windows?

We are being taught xv6 in our course. Currently we use to login to linux server of our school using putty in windows. There we make changes in source of xv6 (using vim), then compile and run it in qemu simply make clean make make qemu-nox It is…
SMUsamaShah
  • 7,677
  • 22
  • 88
  • 131
9
votes
2 answers

What is trap frame? And what is difference between trap frame and task_struct?

task_struct is used to store the status of CPU and trap frame does the same thing so how they differ? And trap frame is a data struct or a just and concept?
Tarak Patel
  • 113
  • 1
  • 2
  • 7
9
votes
1 answer

How to use GDB to debug QEMU with SMP (symmetric multiple processors)?

I am in a graduate operating systems class, and we are emulating our kernel using QEMU, and debugging it using gdb. Debugging has been straight-forward enough.. up until now. How can I connect gdb to the other CPUs I have running in QEMU? Our…
vasia
  • 1,093
  • 7
  • 18
7
votes
1 answer

ERROR: Couldn't find a working QEMU executable

I am following MIT operating system engineering lectures.. I have installed Qemu and ran it successfully, I can use these commands within that folder "make clean" "make" and "make qemu" . There is also a separate folder for Labs... according to…
7
votes
3 answers

Close qemu from a process in xv6

I started learning xv6 recently and was trying to implement a shutdown mechanism in xv6 and i was able to kill all the process running gracefully and wait for some of them to finish and then terminate them. But i am not able to close qemu from the…
Abhay smith
  • 73
  • 1
  • 3
7
votes
2 answers

What does the declaration“extern struct cpu *cpu asm("%gs:0");” mean?

When I'm reading the xv6 source code, I'm confused about the syntax of the declaration below. Can anyone explain it to me? extern struct cpu *cpu asm("%gs:0");
xiaoma
  • 73
  • 4
6
votes
2 answers

Booting xv6 with qemu

I am trying to boot xv6 with qemu but whenever I run make qemu , I am getting the following error usertests.c: In function ‘sbrktest’: usertests.c:1461:13: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=] 1461 | …
Sihat Afnan
  • 742
  • 7
  • 14
6
votes
3 answers

Pass struct to xv6 system call

I'm aware that we are not able to pass parameters to xv6 system call directly and we are forced to use it's built in methods. But all examples and questions in this site is about how to send integer to system call. Which it's answer is using…
Ramtin Mousavi
  • 332
  • 1
  • 5
  • 17
6
votes
1 answer

XV6 - usys.s what does this code it do?

I have never seen this assembly syntax. #include "syscall.h" #include "traps.h" #define SYSCALL(name) \ .globl name; \ name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ …
ALW122
  • 61
  • 1
  • 3
6
votes
1 answer

Access current running processes in xv6?

So I'm trying to think of a possible way to access a list of the current running processes in xv6. My thought process is to gain access to the ptable, so I can loop through it and increment a counter for all that are running. However, if I'm making…
Phlex
  • 401
  • 2
  • 6
  • 17
5
votes
1 answer

What is `x/24x $esp` mean?

I'm running xv6 - operating system made from MIT. I'm running gdb to check the stack pointer(?). And I'm running gdb to see the value of stack pointer registers. My professor said "Let's look at the stack" then typed x/24x $esp. Question: What is…
merry-go-round
  • 4,533
  • 10
  • 54
  • 102
1
2 3
21 22