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.

235 questions
17
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,421
  • 2
  • 12
  • 26
11
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
  • 334
  • 3
  • 18
10
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
  • 393
  • 1
  • 2
  • 14
9
votes
5 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
  • 6,991
  • 21
  • 84
  • 121
7
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
  • 846
  • 5
  • 13
6
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…
6
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
  • 83
  • 4
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
  • 341
  • 1
  • 3
  • 13
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…
hellofanengineer
  • 3,583
  • 6
  • 37
  • 81
5
votes
2 answers

Why is iget() hidden in xv6

I'm playing a bit with xv6, a modern implementation of Unix version 6. For my first hack, I wanted to implement the simple getcwd syscall, but I'm a bit lost as to which level of abstraction I should use. Should I use the struct file interface? Or…
NewbiZ
  • 2,218
  • 1
  • 24
  • 31
4
votes
2 answers

Pass struct to xv6 system call

I'm aware which 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
  • 257
  • 3
  • 16
4
votes
0 answers

Booting xv6 on macbook OSX High Sierra (10.13.3)

I am following the instructions in the most popular answer to the post here and when I attempt to run make TOOLCHAIN=i386-elf- qemu it refuses to run giving me the following error... *** *** Error: Couldn't find an i386-*-elf version of…
Cody Berry
  • 253
  • 3
  • 14
4
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
  • 63
  • 2
  • 7
4
votes
2 answers

xv6 KERNBASE limitation of process memory

There is a question in the xv6 book which bothers me for a long time, and I wondered if anyone would like to clarify on this KERNBASE limits the amount of memory a single process can use, which might be irritating on a machine with a full 4 GB of…
Lior Naar
  • 85
  • 1
  • 7
1
2 3
15 16