plan 9 kernel history: overview | file list | diff list

1991/0821/pc/mmu.c (diff list | history)

1991/0801/sys/src/9/pc/mmu.c:102,1081991/0821/sys/src/9/pc/mmu.c:102,108 (short | long | prev | next)
1991/0719    
void 
1991/0703    
mmuinit(void) 
{ 
1991/0717    
	int i, n, nkpt; 
1991/0821    
	int i, nkpt, npage, nbytes; 
1991/0717    
	ulong x; 
	ulong y; 
 
1991/0801/sys/src/9/pc/mmu.c:124,1351991/0821/sys/src/9/pc/mmu.c:124,137
1991/0716    
	 */ 
 
1991/0719    
	/*  allocate and fill low level page tables for kernel mem */ 
	nkpt = ROUNDUP(conf.npage, 4*1024); 
	nkpt = nkpt/(4*1024); 
1991/0717    
	kpt = ialloc(nkpt*BY2PG, 1); 
1991/0719    
	n = ROUNDUP(conf.npage, 1024); 
1991/0718    
	for(i = 0; i < n; i++) 
1991/0821    
	npage = (1024*1024)/BY2PG + conf.npage1; 
	nbytes = PGROUND(npage*BY2WD);		/* words of page map */ 
	nkpt = nbytes/BY2PG;			/* pages of page map */ 
	kpt = ialloc(nbytes, 1); 
	for(i = 0; i < npage; i++) 
1991/0718    
		kpt[i] = (i<<PGSHIFT) | PTEVALID | PTEKERNEL | PTEWRITE; 
1991/0821    
 
print("%d low level pte's, %d high level pte's\n", npage, nkpt); 
1991/0717    
 
	/*  allocate page table for u-> */ 
	upt = ialloc(BY2PG, 1); 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)