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
0 answers

install i386-elf-gcc on Ubuntu

I'm building cross-compilation toolchain for Ubuntu following this link (originally for MacOS). After installing a few libraries (qemu-system-x86, build-essential, gcc-multilib), I managed to use i386-elf-gcc. Then after closing previous shell, I…
Rahn
  • 4,787
  • 4
  • 31
  • 57
1
vote
1 answer

Do pushcli() and popcli() in the spinlock of XV6 need atomic?

As learning XV6's spinlock,I thought a problem and don't find answer in google. In spinlock, pushcli() and popcli() used to insure interrupt handler run currently: void pushcli(void) { int eflags; eflags = readeflags(); cli(); if…
wcyiming
  • 23
  • 4
1
vote
0 answers

xv6 lazy page allocation

While implementing lazy page allocation in xv6, I noticed while tracing back through gdb that the copyout function needs to be changed in order to make sure it is not writing to a page table entry that has not been allocated yet. Alternatively,…
genji_god
  • 11
  • 1
1
vote
1 answer

How do I check that the sys call terminated/why it terminates?

The output of the following code is just "hello!", which is confusing because when I do make qemu to start xv6 everything compiles well, but obviously something goes wrong with the function getiocounts. I am new to sys calls, so there might be…
1
vote
1 answer

How to change the preemption rate in xv6?

I need to achieve the following: Process preemption should be done in every time quantum (measured in clock ticks) instead of every clock tick In order to achieve this, I have modified the yield() function in proc.c void yield(void) { struct…
cryogene
  • 45
  • 3
1
vote
0 answers

How to know if a page table entry has been modified in XV6?

I'm trying to implement On Demand paging with NRU (not recently used) algorithm. It picks a page table entry based on two factors: If it has been referenced recently. If it has been modified at all. The former can probably be set in the walkpgdir…
Arturo
  • 191
  • 1
  • 1
  • 8
1
vote
1 answer

How to loop through all page table entries of a process in xv6?

I'm trying to loop through all pages for a process in xv6. I've looked at this diagram to understand how it works: but my code is getting: unexpected trap 14 from cpu 0 eip 801045ff (cr2=0xdfbb000) Code: pde_t * physPgDir = (void…
1
vote
1 answer

Adding illegal null derefernce to xv6

I am attempting to make dereferencing null pointers illegal in my build of xv6. In order to accomplish this, I have made the following changes to the source code: changed sz = 0 to sz = PGSIZE on exec.c:42 changed i = 0 to i = PGSIZE in the function…
1
vote
1 answer

I have a error in makefile while running xv6 in ubuntu

i have cloned the xv6-public repository in ubuntu virtual box and i have used the commands $sudo apt-get install qemu $git clone https://github.com/mit-pdos/xv6-public.git $cd xv6-public $make $make qemu-nox when i run make qemu-nox i am getting…
Gopi Sai
  • 75
  • 1
  • 7
1
vote
0 answers

if there is no data segment in userret, what does extern char userret[] stand for?

Some codes in xv6 os, I have two questions: There is no data segment(in assembly) in userret, what does ' extern char userret[] ' (in C) stand for ? For C code, if remove [], only userret , does it indicate a virtual address of userret in the…
RecharBao
  • 371
  • 2
  • 10
1
vote
0 answers

xv6 Start new process and exec user program

I'm trying to fork() a new process and exec() the the user program in newly created process. This code works in user space. I'm not sure how to do the similar thing in kernel space. As per my debugging, seems like fork() never returns 0 in kernel…
Djole Nic
  • 11
  • 2
1
vote
0 answers

Why The loader loads the xv6 kernel into memory at physical address 0x80000000?

I have read this in MIT6.828: The loader loads the xv6 kernel into memory at physical address 0x80000000. The reason it places the kernel at 0x80000000 rather than 0x0 is because the address range 0x0:0x80000000 contains I/O devices. But How do…
Shengxin Huang
  • 647
  • 1
  • 11
  • 25
1
vote
1 answer

XV6 signals clash with macOS signals

I'm trying to implement signals support on XV6-riscv version And in order to d so I defined a sigaction struct and some signals macros like SIG_IGN. The problem is that when I compile it using make clean qemu I got the following errors: In file…
Eli Zatlawy
  • 678
  • 10
  • 24
1
vote
1 answer

gdb dose not work with xv6: freeze after qemu-nox-gdb

I'm using VMware Workstation 15 Pro on Windows 10. The guest OS is Linux 18.04.5 LTS. In guest Linux, I downloaded xv6 using command: git clone git://github.com/mit-pdos/xv6-public.git. After building xv6 using make, I run make qemu-nox-gdb.…
zzzhhh
  • 319
  • 1
  • 8
1
vote
0 answers

System call to count the number of system calls in xv6

I want to create a system call which gives the number of times every system call was done, since a certain switch was tripped. I.e, I want to define a certain variable (let's name it 'counting'). When the variable 'counting' is on ('counting' is…