taizhi10777
taizhi10777

Reputation: 31

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 address in the linker script kernel.ld. But it failed.

Upvotes: 0

Views: 1324

Answers (1)

m-bat
m-bat

Reputation: 619

Your approach is not wrong. Are you running xv6 using QEMU? If so, modify the Makefile and increase the memory to 4GB or more. There are place where memory is set using the -m option around line 215 of the file. The default is 512 GB.

QEMUOPTS = -drive file=fs.img,index=1,media=disk,format=raw -drive file=xv6.img,index=0,media=disk,format=raw -smp $(CPUS) -m 512 $(QEMUEXTRA)

Then modify the memlayout.h and the kernel.ld file. Probably it should work. If xv6 does not work, please tell me the part that failed. Please also show the modified memlayout.h and kernel.ld file.

Upvotes: 1

Related Questions