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
1
vote
1 answer

adding exit code to processes in xv6

I'm trying to add exit status code to processes in XV6. I've made the following changes: 1) to sysproc.c: int sys_exit(int status) { exit(status); return 0; // not reached } 2) to defs.h: ... void exit(int); ... 3) to…
chendoy
  • 155
  • 1
  • 2
  • 12
1
vote
2 answers

What is XV6 operating system used for?

I have been taking online courses on Operating systems, and I heard them say, that XV6 operating system can be used learn implementation of operating systems, thats all.But after I searched on the internet there aren't enough resources, which would…
Sadaf Shafi
  • 1,016
  • 11
  • 27
1
vote
0 answers

Different instructions coming up on stepping through the code vs dumping memory contents in GDB

I'm using gdb to inspect the boot process of xv6. More specifically, I'm running xv6 using qemu with gdb support in a terminal. And in another terminal, I'm running gdb remotely connected to the qemu stub. Now, stepping through the boot process with…
Sumit Ghosh
  • 1,033
  • 10
  • 29
1
vote
2 answers

How to modify process preemption policies (like RR time-slices) in XV6?

Right now it seems that on every click tick, the running process is preempted and forced to yield the processor, I have thoroughly investigated the code-base and the only relevant part of the code to process preemption is below (in trap.c): // Force…
mgh
  • 377
  • 2
  • 4
  • 14
1
vote
1 answer

System call to count number of children in a process

I've done all the steps to create a system call, and then created a user program and run it: proc.c int countChildren (int pid) { struct proc *p; int count = 0; acquire(&ptable.lock); for(p = ptable.proc; p < &ptable.proc[NPROC];…
mgh
  • 377
  • 2
  • 4
  • 14
1
vote
1 answer

Error while compiling xv6 in Ubuntu(Makefile:124: recipe for target 'kernel' failed)

I just tried to complie xv6 in my Ubuntu 18.04.3 using make qemu-nox It failed with the following error. Can you give me some information about this error? ld -m elf_i386 -T kernel.ld -o kernel entry.o bio.o console.o exec.o file.o fs.o ide.o…
2nebin
  • 125
  • 3
  • 9
1
vote
1 answer

implementing spinlock functionality in xv6 to be able to use APIs from user level

xv6 has spinlock.c file for creating spinlock for kernel usage. But I need to implement spinlock APIs to be used at user level. For example I will implement, sp_create() to create a spinlock at user level. Or call sp_acquire(int id) to get the lock,…
aky
  • 83
  • 8
1
vote
1 answer

what does this code mean in xv6 entrypgdir?

I'm currently delving into the xv6 operating system. I have a question for the below code snippet. I know entrypgdir is an array of pde_t type with size of NPDENTRIES. But what does "[0] = (0) | PTE_P | PTE_W | PTE_PS" mean? Thanks in…
1
vote
1 answer

Passing Constant String Value to Register

I am rewriting the boot sector for the xv6 OS as an assignment and am attempting to execute a simple frame that does not output correctly to QEMU. This is using the QEMU simulator (system i386) with the Linux Subsystem for Windows (using Ubuntu…
user3658679
  • 329
  • 1
  • 2
  • 8
1
vote
1 answer

I kill process "A" in XV6 , what happens to child processes of "A"

On a normal day , when a process is killed , all its child processes must be attached to 'init' process (Great Grand-Daddy of all processes). Strangely , the XV6 doesn't seem to do so. Below is the code of 'kill' function in proc.c file in XV6 int…
Daksh
  • 31
  • 1
  • 7
1
vote
0 answers

How to catch or send ctr + p in c to a process, sending ctr + p to qemu with kill

I am writing an test program to test my Xv6 on Qemu, and i want to send to Qemu the ctr + p shortcut key bind that executed a function in Xv6. I don't know what is actually ctr + p, i assume its a signal since the shell also support this…
Adam Jensen
  • 49
  • 1
  • 5
1
vote
0 answers

How to add delay in xv6?

Problem: I need to reboot xv6 after a particular amount of time. However, delay() and sleep() do not work. How can I add delay of specific time in sysproc.c
atta
  • 21
  • 1
1
vote
1 answer

Installing xv6 on macOS

I'm trying to install the xv6 OS on my macOS (version 10.14.3) following the instructions of this site, only with the newest versions of the needed files and when I'm getting at the binutils configuration stage I'm getting from my…
Roy Ash
  • 1,078
  • 1
  • 11
  • 28
1
vote
0 answers

Does every process has its own page directory?

I know that each process has its own page table for VPN to PPN mapping. But do they have separate page directory also?
anandthegreat
  • 61
  • 1
  • 9
1
vote
0 answers

How can I return a string from a system call in XV6?

I was wondering if I could return a string from a XV6 system call since all the system call functions have the prototype int sys_xxx(void) in sysproc.h. I know different types of parameters can be passed using argint, argptr. Is there any such…