Merge branch 'page' of git+ssh://amsterdam.csail.mit.edu/home/am0/6.828/xv6 into page

This commit is contained in:
Frans Kaashoek 2010-08-30 17:28:39 -04:00
commit 791d81cade
7 changed files with 7 additions and 23949 deletions

2
defs.h
View file

@ -155,7 +155,7 @@ void uartputc(int);
void pminit(void);
void ksegment(void);
void kvmalloc(void);
void vminit(void);
void vmenable(void);
pde_t* setupkvm(void);
char* uva2ka(pde_t*, char*);
int allocuvm(pde_t*, char*, uint);

4
main.c
View file

@ -41,7 +41,7 @@ void
mainc(void)
{
cprintf("\ncpu%d: starting xv6\n\n", cpu->id);
kvmalloc(); // initialze the kernel page table
kvmalloc(); // initialize the kernel page table
pinit(); // process table
tvinit(); // trap vectors
binit(); // buffer cache
@ -67,7 +67,7 @@ mpmain(void)
ksegment();
lapicinit(cpunum());
}
vminit(); // turn on paging
vmenable(); // turn on paging
cprintf("cpu%d: starting\n", cpu->id);
idtinit(); // load idt register
xchg(&cpu->booted, 1);

View file

@ -21,7 +21,6 @@ spinlock.c
proc.h
proc.c
swtch.S
vm.c
kalloc.c
vm.c

1
user.h
View file

@ -21,6 +21,7 @@ int dup(int);
int getpid();
char* sbrk(int);
int sleep(int);
int uptime();
// ulib.c
int stat(char*, struct stat*);

7
vm.c
View file

@ -369,14 +369,13 @@ kvmalloc(void)
// Turn on paging.
void
vminit(void)
vmenable(void)
{
uint cr0;
lcr3(PADDR(kpgdir));
switchkvm(); // load kpgdir into cr3
cr0 = rcr0();
cr0 |= CR0_PE|CR0_PG|CR0_AM|CR0_WP|CR0_NE|CR0_TS|CR0_EM|CR0_MP;
cr0 &= ~(CR0_TS|CR0_EM);
cr0 |= CR0_PG;
lcr0(cr0);
}

BIN
xv6.pdf

Binary file not shown.

23941
xv6.ps

File diff suppressed because it is too large Load diff