Plan 9 from Bell Labs 1999-02-16
1 files changed, 9 insertions(+), 1 deletions(-) M pc/mmu.c
M pc/mmu.c => pc/mmu.c +9 -1
@@ 42,7 42,7 @@ taskswitch(ulong pdb, ulong stack) void mmuinit(void) { ulong x; ulong x, *p; ushort ptr[3]; m->tss = malloc(sizeof(Tss)); @@ 65,6 65,14 @@ mmuinit(void) ptr[2] = (x>>16) & 0xFFFF; lidt(ptr); /* make kernel text unwritable */ for(x = KTZERO; x < (ulong)etext; x += BY2PG){ p = mmuwalk(m->pdb, x, 2, 0); if(p == nil) panic("mmuinit"); *p &= ~PTEWRITE; } taskswitch(PADDR(m->pdb), (ulong)m + BY2PG); ltr(TSSSEL); }