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
0
votes
1 answer

How to modify the user space and kernel space in xv6?

XV6 has 2 GB for user space and 2 GB for kernel space. If I want to change it to 3 GB for user space and 1 GB for kernel space. How should I implement this modification? I tried modify KERNBASE + PHYSTOP in memlayout.h and then modify the start…
0
votes
0 answers

C XV6 avoid Zombie in forks without wait() or pipes

I have an Assignment (yes I know everyone loves homework questions), in which I'm supposed to be allowing the CPU scheduler pick which of two forked processes it runs next. Essentially, I fork(), then pass a number to an exec() in each fork that…
user3066571
  • 1,381
  • 4
  • 14
  • 37
0
votes
1 answer

Can't do cd in xv6 while using emulator QEMU

I installed qemu emulator with os xv6. I trying to compile a project that written in c that includes: makefile, 2 c files, and header. I opened the qemu terminal and I trying to change directory with the command cd to get to the files and it said…
oron cohen
  • 85
  • 2
  • 9
0
votes
2 answers

How to get pgdir in xv6?

I'm trying to add a system call to xv6 that provides the translated physical address given a virtual address. Combining the following function definitions, I have written a system call. Functions used: static pte_t * walkpgdir(pde_t *pgdir, const…
0
votes
1 answer

How to make a file appear to 'ls' in xv6 QEMU?

I'm messing around with xv6 in QEMU, and I made a new file in the directory I'm in, and when I'm in QEMU and type ls the file isn't listed. In fact, lots of files aren't listed, and I can't figure out why it lists the ones it does. It seems to…
user3066571
  • 1,381
  • 4
  • 14
  • 37
0
votes
0 answers

assigning char array a value in xv6

I made a system call in xv6 and am trying to change the process name. The name of process exists in the proc struct shown below: // Per-process state struct proc { uint sz; // Size of process memory (bytes) pde_t* pgdir; …
0
votes
1 answer

How big (how much memory) can a process get (allocate) in xv6?

Suppose I want to use malloc() to allocated some memory in the process for(i = 0; i < SOME_NUM; ++i) int *x = malloc(sizeof(int *)); What is the biggest number that I can set SOME_NUM to?
K.Wu
  • 3,553
  • 6
  • 31
  • 55
0
votes
0 answers

How to call a function dynamically in c

I am working in the kernel module of XV6. I need to make a dynamic call like this: proc->tf->eax = hashTable[index]->name(); But getting an error: error: called object is not a function or function pointer
0
votes
2 answers

Unix (in C) trying to write tail for XV6

Hi stackoverflow(ers)! I'm learning Unix using the XV6 OS (documentation found here) and have been trying to write a tail function in C. The expected output of: tail is to give the last 10 lines of the file tail - is to give the last of lines…
0
votes
2 answers

Implementing a syscall in xv6

I am trying to implement a syscall, called getprocs() which returns the number of actual processes. I have already implemented all the necessities to add a new syscall. What this syscall does is get the processes in the table and copies them to an…
David
  • 217
  • 4
  • 14
0
votes
0 answers

gdb not hitting breakpoint in kern/entry.S

I am trying to get gdb to break at the part where paging gets enabled in the kernel (kern/entry.S), I set a breakpoint at the address the disassembler showed (as in kernel.asm) but its not getting hit. Can someone help me understand why this is the…
foo_bar
  • 41
  • 2
  • 4
0
votes
1 answer

Having trouble passing array of structs from user space to kernel space and then back again

I am trying to create a simple top utility xv6. To do this, I have created a system call that will allow me to to access the kernel space. I have followed many guides on how to create system calls and my code compiles without issues. My problem…
user4332327
0
votes
1 answer

Globally static int in self calling module

(Disclamer: This is homework) I am creating a shell program, lets call it fancysh. I am trying to add PATH (and other env vars) functionality to my shell, so far all is good. My naive approach was to store all these variables as static variables in…
Callback Kid
  • 708
  • 5
  • 22
0
votes
1 answer

xv6 boot loader memory range

From book-rev8(DRAFT as of September 3, 2014 Page 95), it says: "The boot loader itself is at 0x7c00 through 0x7d00", but 0x7d00 - 0x7c00 is 256 bytes, not 512 byes(The BIOS reads 512 bytes from disk). So, I think the boot loader itself is at 0x7c00…
Color
  • 875
  • 9
  • 11
0
votes
1 answer

Why all of physical memory must be mapped for initializing the free pages list?

The companion book says at page 32 that There is a bootstrap problem: all of physical memory must be mapped in order for the allocator to initialize the free list, but creating a page table with those mappings involves allocating page-table…
Giuseppe Crinò
  • 486
  • 3
  • 15