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

1991/0720/pc/main.c (diff list | history)

1991/0719/sys/src/9/pc/main.c:65,701991/0720/sys/src/9/pc/main.c:65,73 (short | long | prev | next)
1991/0716    
	u->p->state = Running; 
	u->p->mach = m; 
1991/0712    
 
1991/0720    
print("go low\n"); 
	spllo(); 
 
1991/0716    
	/* 
	 * These are o.k. because rootinit is null. 
	 * Then early kproc's will have a root and dot. 
1991/0719/sys/src/9/pc/main.c:74,911991/0720/sys/src/9/pc/main.c:77,85
1991/0712    
 
1991/0716    
	chandevinit(); 
 
1991/0718    
	/* 
1991/0719    
	 *  fault in the first executable page and user stack 
1991/0718    
	 */ 
1991/0719    
	print("text is %lux\n", *((ulong *)(UTZERO+32))); 
1991/0720    
print("going to user\n"); 
delay(1000); 
1991/0718    
 
1991/0719    
	/*  fault in the first stack page 
	 */ 
	print("stack is %lux\n", *((ulong *)(USTKTOP-4))); 
	*((ulong *)(USTKTOP-4)) = 0xdeadbeef; 
	print("stack is %lux\n", *((ulong *)(USTKTOP-4))); 
	delay(5000); 
                 
1991/0716    
	touser(); 
1991/0712    
} 
 
1991/0719/sys/src/9/pc/main.c:110,1191991/0720/sys/src/9/pc/main.c:104,112
1991/0717    
	 * 
1991/0719    
	 * N.B. The -12 for the stack pointer is important. 
	 *	4 bytes for gotolabel's return PC 
	 *	8 bytes for optional sp and ss pushed during interrupts 
1991/0716    
	 */ 
	p->sched.pc = (ulong)init0; 
1991/0719    
	p->sched.sp = USERADDR + BY2PG - 12; 
1991/0720    
	p->sched.sp = USERADDR + BY2PG - 4; 
1991/0716    
	p->upage = newpage(1, 0, USERADDR|(p->pid&0xFFFF)); 
 
	/* 


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