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

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

1991/0905/sys/src/9/pc/main.c:7,171991/0906/sys/src/9/pc/main.c:7,16 (short | long | prev | next)
1991/0716    
#include	"ureg.h" 
#include	"init.h" 
1991/0629    
 
1991/0716    
char	user[NAMELEN] = "bootes"; 
extern long edata; 
1991/0711    
 
1991/0906    
char	user[NAMELEN] = "bootes"; 
1991/0905    
 
                 
1991/0716    
void 
1991/0702    
main(void) 
1991/0625    
{ 
1991/0905/sys/src/9/pc/main.c:23,281991/0906/sys/src/9/pc/main.c:22,28
1991/0827    
	print("%ludK bytes of physical memory\n", (conf.base1 + conf.npage1*BY2PG)/1024); 
1991/0711    
	mmuinit(); 
1991/0718    
	trapinit(); 
1991/0906    
	mathinit(); 
1991/0719    
	kbdinit(); 
1991/0718    
	clockinit(); 
	faultinit(); 
1991/0905/sys/src/9/pc/main.c:52,581991/0906/sys/src/9/pc/main.c:52,57
1991/0716    
	memset(m, 0, sizeof(Mach)); 
	m->machno = n; 
	m->mmask = 1<<m->machno; 
	m->fpstate = FPinit; 
	active.machs = 1; 
1991/0625    
} 
 
1991/0905/sys/src/9/pc/main.c:90,971991/0906/sys/src/9/pc/main.c:89,94
1991/0716    
	User *up; 
	KMap *k; 
1991/0905    
 
	setvec(Coprocvec, coprocintr); 
1991/0711    
                 
1991/0716    
	p = newproc(); 
	p->pgrp = newpgrp(); 
	p->egrp = newegrp(); 
1991/0905/sys/src/9/pc/main.c:99,1041991/0906/sys/src/9/pc/main.c:96,102
1991/0716    
 
	strcpy(p->text, "*init*"); 
	p->fpstate = FPinit; 
1991/0906    
	fpoff(); 
1991/0716    
 
	/* 
	 * Kernel Stack 
1991/0905/sys/src/9/pc/main.c:224,2511991/0906/sys/src/9/pc/main.c:222,298
1991/0711    
} 
 
1991/0716    
/* 
1991/0906    
 *  math coprocessor error 
 */ 
void 
matherror(Ureg *ur) 
{ 
	postnote(u->p, 1, "math: 837 error", 0); 
} 
 
/* 
 *  math coprocessor emulation fault 
 */ 
void 
mathemu(Ureg *ur) 
{ 
	switch(u->p->fpstate){ 
	case FPinit: 
		fpinit(); 
		u->p->fpstate = FPactive; 
		break; 
	case FPinactive: 
		fprestore(&u->fpsave); 
		u->p->fpstate = FPactive; 
		break; 
	case FPactive: 
print("emu actv 0x%lux\n", getcr0()); 
		postnote(u->p, 1, "math: emulation", 0); 
		break; 
	} 
} 
 
/* 
 *  math coprocessor segment overrun 
 */ 
void 
mathover(Ureg *ur) 
{ 
	postnote(u->p, 1, "math: segment overrun", 0); 
} 
 
void 
mathinit(void) 
{ 
	setvec(Matherrorvec, matherror); 
	setvec(Mathemuvec, mathemu); 
	setvec(Mathovervec, mathover); 
} 
 
/* 
1991/0716    
 *  set up floating point for a new process 
 *	BUG -- needs floating point support 
 */ 
1991/0703    
void 
1991/0716    
procsetup(Proc *p) 
1991/0703    
{ 
1991/0716    
	p->fpstate = FPinit; 
	m->fpstate = FPinit; 
1991/0906    
	fpoff(); 
1991/0705    
} 
 
1991/0712    
/* 
1991/0716    
 * Save the part of the process state. 
 *	BUG -- needs floating point support 
1991/0906    
 *  Save the mach dependent part of the process state. 
1991/0712    
 */ 
1991/0705    
void 
1991/0716    
procsave(uchar *state, int len) 
1991/0705    
{ 
1991/0906    
	if(u->p->fpstate == FPactive){ 
		fpsave(&u->fpsave); 
		u->p->fpstate = FPinactive; 
	} 
1991/0712    
} 
 
/* 
1991/0716    
 *  Restore what procsave() saves 
 *	BUG -- needs floating point support 
1991/0712    
 */ 
1991/0716    
void 
procrestore(Proc *p, uchar *state) 
1991/0905/sys/src/9/pc/main.c:258,2641991/0906/sys/src/9/pc/main.c:305,313
1991/0716    
	panic("firmware"); 
1991/0712    
} 
 
                 
1991/0906    
/* 
 *  make noise, blink lights 
 */ 
1991/0716    
void 
buzz(int f, int d) 
1991/0712    
{ 
1991/0905/sys/src/9/pc/main.c:268,2741991/0906/sys/src/9/pc/main.c:317,322
1991/0716    
lights(int val) 
{ 
1991/0702    
} 
1991/0803    
                 
 
/* 
 *  special stuff for 80c51 power management and headland system controller 


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