Reputation: 1807
As far as I know, in XV6, PHYSTOP should be 1GB.
If so, PHYSTOP should be 0x40000000 (1GB) and not 0xE000000 (224MB) as appear in http://pdos.csail.mit.edu/6.828/2014/xv6/xv6-rev8.pdf :
0203 #define PHYSTOP 0xE000000 // Top physical memory
Further more, in XV6, a process might be mapped from 0 to 0x80000000(KERNBASE). That is, a process might use 2GB address space. How is it possible if PHYSTOP isn't 2GB?
What am I missing?
Upvotes: 4
Views: 2294
Reputation: 1046
PHYSTOP
is a constant defined as 0xE000000 for performance reasons.
if PHYSTOP
is set higher, you will need to map all of that free memory using mappages
. OSes today map free pages on the fly, however on xv6 we map them on OS initialisation. mapping 2GB is slow.
note that you could change this value before compilation for a bigger virtual memory.
Upvotes: 5