add: pgtable = (unsigned int *)0x12000;  for (i = 0; i < 1024; i++) { pgtable[i] = (i * 0x1000 + 0x400000) | DEFAULT_PAGE_FLAGS; }  pgdir[1] = (unsigned int)pgtable | DEFAULT_PAGE_FLAGS;
context: static int mmu_init(kernel_args *ka, unsigned int *next_paddr){	int i;	// allocate a new pgdir	pgdir = (unsigned int *)*next_paddr;	(*next_paddr) += PAGE_SIZE;	ka->arch_args.phys_pgdir = (unsigned int)pgdir;	// clear out the pgdir	for(i = 0; i < 1024; i++)		pgdir[i] = 0;	// make a pagetable at this random spot	pgtable = (unsigned int *)0x11000;	for (i = 0; i < 1024; i++) {		pgtable[i] = (i * 0x1000) | DEFAULT_PAGE_FLAGS;	}	// pkx: create first 4 MB one-to-one mapping	pgdir[0] = (unsigned int)pgtable | DEFAULT_PAGE_FLAGS;		// pkx: put the one-to-one mapping into the page dir.	// Get new page table and clear it out	pgtable = (unsigned int *)*next_paddr;	ka->arch_args.pgtables[0] = (unsigned int)pgtable;	ka->arch_args.num_pgtables = 1;	(*next_paddr) += PAGE_SIZE;	for (i = 0; i < 1024; i++)		pgtable[i] = 0;	// put the new page table into the page directory	// this maps the kernel at KERNEL_BASE	pgdir[KERNEL_BASE/(4*1024*1024)] = (unsigned int)pgtable | DEFAULT_PAGE_FLAGS;	// switch to the new pgdir	asm("movl %0, %%eax;"		"movl %%eax, %%cr3;" :: "m" (pgdir) : "eax");	// Important.  Make sure supervisor threads can fault on read only pages...	asm("movl %%eax, %%cr0" : : "a" ((1 << 31) | (1 << 16) | (1 << 5) | 1));		// pkx: moved the paging turn-on to here.	return 0;}