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

why fields like limit and base is separately stored in gdt in os?

rt, for example, in xv6 code mmu.h, segdesc is designed like this struct segdesc { uint lim_15_0 : 16; // Low bits of segment limit uint base_15_0 : 16; // Low bits of segment base address uint base_23_16 : 8; // Middle bits of segment base…
minglotus
  • 83
  • 6
1
vote
1 answer

How to add a system call to get the count of a particular system call when process invokes it in XV6 OS

Can some one help me in adding a system call called getcount(system call) to XV6? which has an argument system call. when ever a system call is made by the process it should increase the count and should keep track of the count. after the completion…
user3342616
  • 21
  • 1
  • 5
1
vote
0 answers

Scheduler in xv6

I am trying to implement mixture of MLFQ and lottery scheduler in xv6. The problem I am encountering is I am making a function which calculates the total number of processes with high priority in a queue and the sum of their tickets. When I print…
Anmol Yousaf
  • 65
  • 1
  • 13
1
vote
0 answers

how make a new scheduler in xv6?

i am new to XV6 so be patient with me :D . i want to make a new scheduler and it is a mix of two scheduler the multi-level feedback queue (MLFQ) and another one the lottery scheduler. The basic idea is simple: Build a two-level scheduler which…
Halawa
  • 1,171
  • 2
  • 9
  • 19
1
vote
2 answers

How two virtual address spaces can be mapped to the same physical address range?

I think that they might override each other's data. I understand that two same virtual address spaces can be mapped to physical memory.
Sharon182
  • 100
  • 1
  • 3
  • 10
1
vote
1 answer

xv6 Scheduler - proc never != 0

Basically, I'm implementing a scheduler for the xv6 kernel that is implementing a multilevel priority queue. I'm having a serious issue I do not understand, the TAs for my course do not understand, and I've missed the deadline for this project, so…
katiea
  • 223
  • 1
  • 5
  • 19
1
vote
1 answer

Implementing vfork() in xv6

If I want to add my system call vfork(copy on write) what exactly need to be edited in syscall.c? Where would I add my fragment of vfork's code. In short, how would I implement vfork in xv6?
ahmad
  • 11
  • 1
1
vote
2 answers

a recursive function to manipulate a given path

I am working on modifying the didactic OS xv6 (written in c) to support symbolic links (AKA shortcuts). A symbolic link is a file of type T_SYM that contains a path to it's destination. For doing that, i wrote a recursive function that gets a path…
Eyal
  • 1,748
  • 2
  • 17
  • 31
0
votes
0 answers

c6.s081 lab1 xargs:I don't know why the program below can't get the answer?

when I was finishing the c6.s081(2021) lab1 xargs, I found a function from other person which is below: #include "kernel/types.h" #include "kernel/param.h" #include "user/user.h" #define STDIN_FILENO 0 #define MAXLINE 1024 int main(int argc, char…
0
votes
0 answers

In RISC-V, when will an interrupt be handled?

I learned that every core in RISC-V can handle an interrupt. So when one core is running in u-mode, will it trap into s-mode and handle the interrupt? Or only in s-mode core can handle this interrupt? I tried debug xv6 os, seems like every uart…
Kevin
  • 1
  • 1
0
votes
0 answers

MMIO address unmatched in Xv6 operating system?

I recently found some problems while working on the Xv6 kernel. When the kernel booting up, it initializes the PLIC to receive interrupt signals from the UART, but I found that the address used here is different from definitions in SiFive_U…
0
votes
0 answers

How to Track References in Copy-On-Write VM Mappings

I'm trying to modify xv6-riscv to perform a copy-on-write mapping when executing fork(). Most sources I can find online suggest to keep track of how many processes currently are able to read from a given copy-on-write page in the PTE. Once that…
VanceR
  • 1
  • 1
  • 1
0
votes
0 answers

Forking system calls

#include "kernel/types.h" #include "kernel/stat.h" #include "user.h" #include "kernel/fs.h" int main(int argc, char *argv[]) { int i; int pid1 = fork(); if (pid1 < 0 || argc < 2) { fprintf(2, "Fork failed.\n"); …
0
votes
0 answers

xv6 stack dynamic memory management

I'm trying to implement a new dynamic memory logic (malloc/free) in xv6, which has the following behavior. The main point is that memory blocks will follow LIFO concept, meaning that free() can only free the last block allocated in memory. when…
galyoss
  • 21
  • 3
0
votes
0 answers

Program doesn't finish well after mapping new shared memory pages in xv6

The problem is parent process in xv6 system doesn't enter the exit() function after waiting child to execute. I also made a change to exec() where I mapped the shared structures so that parent and child process points to same page directory (share…
xyz
  • 1
  • 2