xx
This commit is contained in:
parent
4d972493b6
commit
ac090078c6
3 changed files with 4 additions and 4 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);
|
||||||
|
|
2
main.c
2
main.c
|
@ -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);
|
||||||
|
|
4
vm.c
4
vm.c
|
@ -369,11 +369,11 @@ 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_PG;
|
cr0 |= CR0_PG;
|
||||||
lcr0(cr0);
|
lcr0(cr0);
|
||||||
|
|
Loading…
Reference in a new issue