Merge branch 'page' of git+ssh://amsterdam.csail.mit.edu/home/am0/6.828/xv6 into page
This commit is contained in:
commit
791d81cade
7 changed files with 7 additions and 23949 deletions
2
defs.h
2
defs.h
|
@ -155,7 +155,7 @@ void uartputc(int);
|
||||||
void pminit(void);
|
void pminit(void);
|
||||||
void ksegment(void);
|
void ksegment(void);
|
||||||
void kvmalloc(void);
|
void kvmalloc(void);
|
||||||
void vminit(void);
|
void vmenable(void);
|
||||||
pde_t* setupkvm(void);
|
pde_t* setupkvm(void);
|
||||||
char* uva2ka(pde_t*, char*);
|
char* uva2ka(pde_t*, char*);
|
||||||
int allocuvm(pde_t*, char*, uint);
|
int allocuvm(pde_t*, char*, uint);
|
||||||
|
|
4
main.c
4
main.c
|
@ -41,7 +41,7 @@ void
|
||||||
mainc(void)
|
mainc(void)
|
||||||
{
|
{
|
||||||
cprintf("\ncpu%d: starting xv6\n\n", cpu->id);
|
cprintf("\ncpu%d: starting xv6\n\n", cpu->id);
|
||||||
kvmalloc(); // initialze the kernel page table
|
kvmalloc(); // initialize the kernel page table
|
||||||
pinit(); // process table
|
pinit(); // process table
|
||||||
tvinit(); // trap vectors
|
tvinit(); // trap vectors
|
||||||
binit(); // buffer cache
|
binit(); // buffer cache
|
||||||
|
@ -67,7 +67,7 @@ mpmain(void)
|
||||||
ksegment();
|
ksegment();
|
||||||
lapicinit(cpunum());
|
lapicinit(cpunum());
|
||||||
}
|
}
|
||||||
vminit(); // turn on paging
|
vmenable(); // turn on paging
|
||||||
cprintf("cpu%d: starting\n", cpu->id);
|
cprintf("cpu%d: starting\n", cpu->id);
|
||||||
idtinit(); // load idt register
|
idtinit(); // load idt register
|
||||||
xchg(&cpu->booted, 1);
|
xchg(&cpu->booted, 1);
|
||||||
|
|
|
@ -21,7 +21,6 @@ spinlock.c
|
||||||
proc.h
|
proc.h
|
||||||
proc.c
|
proc.c
|
||||||
swtch.S
|
swtch.S
|
||||||
vm.c
|
|
||||||
kalloc.c
|
kalloc.c
|
||||||
vm.c
|
vm.c
|
||||||
|
|
||||||
|
|
1
user.h
1
user.h
|
@ -21,6 +21,7 @@ int dup(int);
|
||||||
int getpid();
|
int getpid();
|
||||||
char* sbrk(int);
|
char* sbrk(int);
|
||||||
int sleep(int);
|
int sleep(int);
|
||||||
|
int uptime();
|
||||||
|
|
||||||
// ulib.c
|
// ulib.c
|
||||||
int stat(char*, struct stat*);
|
int stat(char*, struct stat*);
|
||||||
|
|
7
vm.c
7
vm.c
|
@ -369,14 +369,13 @@ kvmalloc(void)
|
||||||
|
|
||||||
// Turn on paging.
|
// Turn on paging.
|
||||||
void
|
void
|
||||||
vminit(void)
|
vmenable(void)
|
||||||
{
|
{
|
||||||
uint cr0;
|
uint cr0;
|
||||||
|
|
||||||
lcr3(PADDR(kpgdir));
|
switchkvm(); // load kpgdir into cr3
|
||||||
cr0 = rcr0();
|
cr0 = rcr0();
|
||||||
cr0 |= CR0_PE|CR0_PG|CR0_AM|CR0_WP|CR0_NE|CR0_TS|CR0_EM|CR0_MP;
|
cr0 |= CR0_PG;
|
||||||
cr0 &= ~(CR0_TS|CR0_EM);
|
|
||||||
lcr0(cr0);
|
lcr0(cr0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
BIN
xv6.pdf
BIN
xv6.pdf
Binary file not shown.
Loading…
Reference in a new issue