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

1992/0902/pc/main.c (diff list | history)

1992/0902/sys/src/9/pc/main.c:7,161992/0903/sys/src/9/pc/main.c:7,19 (short | long | prev | next)
1991/0716    
#include	"ureg.h" 
#include	"init.h" 
1991/0629    
 
1992/0903    
/* configuration parameters */ 
1992/0902    
int mousetype; 
int pmutype; 
1992/0323    
uchar	*sp;	/* stack pointer for /boot */ 
1992/0903    
int resettype; 
1991/0711    
 
1992/0903    
uchar *sp;	/* stack pointer for /boot */ 
 
1991/0716    
void 
1991/0702    
main(void) 
1991/0625    
{ 
1992/0902/sys/src/9/pc/main.c:41,481992/0903/sys/src/9/pc/main.c:44,52
1991/0712    
} 
1991/0706    
 
1992/0902    
/* 
 *  this should be changed to describe architecture dependencies outside the 
 *  PC model 
1992/0903    
 *  This tries to capture architecture dependencies since things 
 *  like power management/reseting/mouse are outside the hardware 
 *  model. 
1992/0902    
 */ 
1991/0716    
void 
1991/1210    
ident(void) 
1992/0902/sys/src/9/pc/main.c:49,641992/0903/sys/src/9/pc/main.c:53,67
1991/1210    
{ 
	char *id = (char*)(ROMBIOS + 0xFF40); 
 
	/* check for a safari (tres special) */ 
1992/0902    
	if(strncmp(id, "AT&TNSX", 7) == 0){ 
		mousetype = MousePS2; 
		pmutype = PMUnsx20; 
1992/0903    
		resettype = Resetheadland; 
1992/0902    
	}else if(strncmp(id, "NCRD.0", 6) == 0){ 
		mousetype = MousePS2; 
		pmutype = PMUother; 
1992/0903    
		resettype = Reset8042; 
1992/0902    
	}else{ 
		mousetype = Mouseserial; 
		pmutype = PMUother; 
	} 
1991/1210    
} 
 
1992/0902/sys/src/9/pc/main.c:184,1891992/0903/sys/src/9/pc/main.c:187,194
1992/0323    
 	int i, ac; 
	uchar *av[32]; 
	uchar **lsp; 
1992/0903    
	char *cp = BOOTLINE; 
	char buf[64]; 
1992/0323    
 
	sp = (uchar*)base + BY2PG - MAXSYSARG*BY2WD; 
 
1992/0902/sys/src/9/pc/main.c:190,1951992/0903/sys/src/9/pc/main.c:195,208
1992/0323    
	ac = 0; 
	av[ac++] = pusharg("/386/9safari"); 
	av[ac++] = pusharg("-p"); 
1992/0903    
	cp[64] = 0; 
	if(strncmp(cp, "fd!", 3) == 0){ 
		sprint(buf, "local!#f/fd%ddisk", atoi(cp+3)); 
		av[ac++] = pusharg(buf); 
	} else if(strncmp(cp, "hd!", 3) == 0){ 
		sprint(buf, "local!#w/hd%ddisk", atoi(cp+3)); 
		av[ac++] = pusharg(buf); 
	} 
1992/0323    
 
	/* 4 byte word align stack */ 
	sp = (uchar*)((ulong)sp & ~3); 
1992/0902/sys/src/9/pc/main.c:413,4211992/0903/sys/src/9/pc/main.c:426,441
1991/0803    
	print("exiting\n"); 
1992/0812    
	if(ispanic) 
		for(;;); 
1992/0902    
	i8042reset();		/* via keyboard controller */ 
	print("can't reset via software, do something drastic!\n"); 
	for(;;); 
1992/0903    
 
	switch(resettype){ 
	case Resetheadland: 
		headreset(); 
	case Reset8042: 
		i8042reset();		/* via keyboard controller */ 
	default: 
		print("Reset the machine!\n"); 
		for(;;); 
	} 
1991/0803    
} 
 
/* 


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