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.
Questions tagged [xv6]
326 questions
1
vote
2 answers
Register pointer in creating threads in xv6
I want to create a thread in xv6 by using a system call "clone()", but I am confused about the stack creation, since if I want to create a thread, I need to create the corresponding register pointer such like ebp, esp, eip. But I don't know how to…

zyz
- 83
- 1
- 3
- 10
1
vote
2 answers
How to get the page directory of a pointer in xv6
Here is my 'translate()' in proc.c
I want to get the physical address given the virtual address of a pointer, but I don't know how to get the pointers pgdir(page directory)...
int translate(void* vaddr)
{
cprintf("vaddr = %p\n",vaddr);
int…

zyz
- 83
- 1
- 3
- 10
1
vote
3 answers
Compile XV6 on MAC
Before compile XV6, I have read this page to build my own compiler toolchain. And the result is similar.
➜ xv6-public git:(master) ✗ i386-jos-elf-objdump -i
BFD header file version (GNU Binutils) 2.27
elf32-i386
(header little endian, data little…

icecity96
- 1,177
- 12
- 26
1
vote
1 answer
Program statically linked to newlib failed to run in xv6
I encountered some problems when running newlib-linked programs in xv6. (This is the newlib port I have used)
I used this toolchain to compile the newlib. There aren't any problems in compiling and I do get libc.a, libm.a and other library…

u855697021
- 21
- 4
1
vote
0 answers
Xv6 stack frame - return value of eip getting mangled?
I have the following code attempting to run in xv6:
void handle_signal(siginfo_t info)
{
printf(1, "Caught signal %d...\n", info.signum);
if (info.signum == SIGFPE)
printf(1, "TEST PASSED\n");
else
printf(1, "TEST FAILED:…

Mikey Chen
- 2,370
- 1
- 19
- 31
1
vote
1 answer
Race Condition in xv6
I am a newbie in the field of OS and trying to learn it by hacking into xv6.My doubt is can we decide before making a call to fork whether to run parent or child using system calls.i,e i can have a function pass an argument to kernel space and…

user3274335
- 85
- 7
1
vote
1 answer
Executing a Stopped Process in XV6
I wrote two new system calls and add them to the xv6 OS kernel. So using one system call I can save process state and using the other one I can reload the previous state and continue.
the problem is in the reloading section.
is it enough to reload…

Mohammad Mahdi KouchakYazdi
- 1,318
- 2
- 21
- 28
1
vote
1 answer
Process Migration in xv6 OS
I want to write a program that can save a process's state when it exits in a file and another program to reload this process's state and run it from were it left in xv6 OS. Something like keeping processes' state when you are changing among…

Sparrow7000
- 79
- 1
- 11
1
vote
1 answer
xv6 operating system - Implementation of triple indirection
The xv6 mkfs.c file declare the variables:
int nblocks = 985;
int nlog = LOGSIZE;
int ninodes = 200;
int size = 1024;
That declaration should work properly with inode that have 12 direct blocks and 1 indirect block, what i don't understand is why…

avivar
- 25
- 2
1
vote
1 answer
XV6 crashes when trying to implement triple indirection in xv6 operating system
The original xv6-rev7 operating system contains:
12 directed blocks
1 indirect blcok(points to 128 blocks)
This means we have 140 blocks.
Each block's size is 512KB ==> 512 * 140 = 71,680 ~= 70KB is the limit of file's size in xv6.
I want to…

E235
- 11,560
- 24
- 91
- 141
1
vote
1 answer
qemu request for a disc image
I am trying to get qemu up and running with xv6 but I am having some trouble with compiling xv6. what are the types of disc images that qemu accepts. for instance does Qemu accept .ISO files? I tried loading FreeBSD but I am getting the error from…

TEddyBEaR
- 137
- 1
- 9
1
vote
1 answer
Understanding code block from XV6 makefile
I'm trying to understand the following code block from XV6 makefile :
ULIB = ulib.o usys.o printf.o umalloc.o
_%: %.o $(ULIB)
$(LD) $(LDFLAGS) -N -e main -Ttext 0 -o $@ $^
$(OBJDUMP) -S $@ > $*.asm
$(OBJDUMP) -t $@ | sed '1,/SYMBOL…

SyndicatorBBB
- 1,757
- 2
- 26
- 44
1
vote
1 answer
Context Switching and Timer Interrupts in xv6
I am trying to modify the scheduling policy in xv6 in which Parent runs first after forking.
childPid = fork();
if (childPid < 0)
{
printf("fork() is failed\n");
}
else if (childPid == 0) // child
{
printf("…

MIXAM
- 41
- 1
- 4
1
vote
1 answer
How to implement a system call that has structure parameter?
I want to implement a system call where I pass in a reference to a structure variable, then I would like display the values in the same file.
For example I have the following structure.
struct procInfo{
int processID[64]; // the PID of each…

Ammar
- 1,203
- 5
- 27
- 64
1
vote
2 answers
When killing a process, can I use its' `eax` to save exit status?
I'm taking OS class and we need to extend XV6's exit() to support exit status, thus we're writing exit2(int).
I thought of two candidates for the purpose of saving the exit status of the killed process.
The first option was to add a variable to…

Quaker
- 1,483
- 3
- 20
- 36