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

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

1991/0718/sys/src/9/pc/main.c:13,181991/0719/sys/src/9/pc/main.c:13,19 (short | long | prev | next)
1991/0716    
void 
1991/0702    
main(void) 
1991/0625    
{ 
1991/0719    
	a20enable(); 
1991/0711    
	machinit(); 
	confinit(); 
1991/0703    
	screeninit(); 
1991/0718/sys/src/9/pc/main.c:19,241991/0719/sys/src/9/pc/main.c:20,26
1991/0716    
	printinit(); 
1991/0711    
	mmuinit(); 
1991/0718    
	trapinit(); 
1991/0719    
	kbdinit(); 
1991/0718    
	clockinit(); 
	faultinit(); 
1991/0716    
	procinit0(); 
1991/0718/sys/src/9/pc/main.c:31,371991/0719/sys/src/9/pc/main.c:33,38
1991/0716    
	swapinit(); 
	pageinit(); 
	userinit(); 
1991/0717    
print("user inited\n"); 
1991/0711    
 
1991/0716    
	schedinit(); 
1991/0712    
} 
1991/0718/sys/src/9/pc/main.c:52,581991/0719/sys/src/9/pc/main.c:53,59
1991/0716    
	active.machs = 1; 
1991/0625    
} 
 
1991/0718    
long useless; 
1991/0719    
ulong garbage; 
1991/0718    
 
1991/0716    
void 
init0(void) 
1991/0718/sys/src/9/pc/main.c:64,721991/0719/sys/src/9/pc/main.c:65,70
1991/0716    
	u->p->state = Running; 
	u->p->mach = m; 
1991/0712    
 
1991/0716    
	spllo(); 
1991/0718    
print("interrupts on\n"); 
1991/0712    
                 
1991/0716    
	/* 
	 * These are o.k. because rootinit is null. 
	 * Then early kproc's will have a root and dot. 
1991/0718/sys/src/9/pc/main.c:75,871991/0719/sys/src/9/pc/main.c:73,91
1991/0716    
	u->dot = clone(u->slash, 0); 
1991/0712    
 
1991/0716    
	chandevinit(); 
1991/0718    
print("going to user\n"); 
1991/0716    
 
1991/0718    
	/* 
	 *  fault in the first executable page 
1991/0719    
	 *  fault in the first executable page and user stack 
1991/0718    
	 */ 
	useless = *((ulong *)UTZERO); 
1991/0719    
	print("text is %lux\n", *((ulong *)(UTZERO+32))); 
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/0718/sys/src/9/pc/main.c:104,1141991/0719/sys/src/9/pc/main.c:108,119
1991/0716    
	/* 
	 * Kernel Stack 
1991/0717    
	 * 
	 * N.B. The -4 for the stack pointer is important.  Gotolabel 
	 *	uses the bottom 4 bytes of stack to store it's return pc. 
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/0717    
	p->sched.sp = USERADDR + BY2PG - 4; 
1991/0719    
	p->sched.sp = USERADDR + BY2PG - 12; 
1991/0716    
	p->upage = newpage(1, 0, USERADDR|(p->pid&0xFFFF)); 
 
	/* 
1991/0718/sys/src/9/pc/main.c:182,1941991/0719/sys/src/9/pc/main.c:187,199
1991/0711    
	 *  the last 128k belongs to the roms 
	 */ 
	conf.npage1 = (i)*1024/4; 
	conf.base1 = 1024/4; 
1991/0719    
	conf.base1 = 1024*1024; 
1991/0711    
 
	conf.npage = conf.npage0 + conf.npage1; 
1991/0717    
	conf.maxialloc = (conf.npage0*BY2PG-PGROUND((ulong)&end)); 
1991/0711    
 
	mul = 1; 
	conf.nproc = 20 + 50*mul; 
1991/0719    
	conf.nproc = 20 + 20*mul; 
1991/0711    
	conf.npgrp = conf.nproc/2; 
	conf.nseg = conf.nproc*3; 
	conf.npagetab = (conf.nseg*14)/10; 
1991/0718/sys/src/9/pc/main.c:275,2781991/0719/sys/src/9/pc/main.c:280,282
1991/0717    
{ 
	return c; 
} 
                 


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