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

1990/0911/power/bboot.c (diff list | history)

1990/0504/sys/src/9/power/bboot.c:23,371990/0911/sys/src/9/power/bboot.c:23,38 (short | long | prev | next)
1990/0424    
struct address { 
	char *name; 
	char *cmd; 
1990/0911    
	char *srvname; 
1990/0424    
} Address; 
 
Address addr[] = { 
	{ "bitbootes", "bitconnect" }, 
	{ "ross", "connect 020701005eff" }, 
	{ "bootes", "connect 080069020205" }, 
	{ "helix", "connect 080069020427" }, 
	{ "spindle", "connect 0800690202df" }, 
	{ "r70", "connect 08002b04265d" }, 
1990/0911    
	{ "bitbootes", "bitconnect", "bit!bootes" }, 
	{ "ross", "connect 020701005eff", "nonet!ross" }, 
	{ "bootes", "connect 080069020205", "nonet!bootes" }, 
	{ "helix", "connect 080069020427", "nonet!helix" }, 
	{ "spindle", "connect 0800690202df", "nonet!spindle" }, 
	{ "r70", "connect 08002b04265d", "nonet!r70" }, 
1990/0424    
	{ 0 } 
}; 
 
1990/0504/sys/src/9/power/bboot.c:61,671990/0911/sys/src/9/power/bboot.c:62,68
1990/0424    
/* 
1990/0427    
 *  predeclared 
1990/0424    
 */ 
1990/0427    
char	*lookup(char *); 
1990/0911    
Address* lookup(char *); 
1990/0427    
int	readseg(int, int, long, long, int); 
int	readkernel(int); 
1990/0504    
int	readconf(int); 
1990/0504/sys/src/9/power/bboot.c:126,1501990/0911/sys/src/9/power/bboot.c:127,148
1990/0424    
{ 
1990/0427    
	int n; 
1990/0504    
	char conffile[128]; 
1990/0911    
	Address *a; 
1990/0424    
 
1990/0427    
	if(ask){ 
		outin("bootfile", bootfile, bbuf, sizeof(bbuf)); 
		bootfile = bbuf; 
	} 
1990/0424    
                 
1990/0427    
	if(!ask) 
		scmd = lookup(sys); 
	else { 
		outin("server", sys, sbuf, sizeof(sbuf)); 
		sys = sbuf; 
		scmd = lookup(sys); 
	} 
	if(scmd == 0){ 
1990/0911    
 
	a = lookup(sys); 
	if(a == 0){ 
1990/0427    
		fprint(2, "boot: %s unknown\n", sys); 
		return; 
	} 
1990/0911    
	scmd = a->cmd; 
1990/0424    
 
1990/0427    
                 
1990/0424    
	/* 
1990/0427    
	 *  for the bit, we skip all the ether goo 
1990/0424    
	 */ 
1990/0504/sys/src/9/power/bboot.c:174,1911990/0911/sys/src/9/power/bboot.c:172,193
1990/0427    
		prerror("push noether"); 
		return; 
	} 
1990/0911    
	if(write(cfd, "config nonet", sizeof("config nonet")-1)<0){ 
		prerror("config nonet"); 
		return; 
	} 
1990/0424    
 
	/* 
	 *  grab a nonet channel and call up the ross file server 
	 */ 
	fd = open("#n/1/data", 2); 
1990/0911    
	fd = open("#nnonet/2/data", 2); 
1990/0427    
	if(fd < 0) { 
		prerror("opening #n/1/data"); 
1990/0911    
		prerror("opening #n/2/data"); 
1990/0427    
		return; 
	} 
1990/0424    
	cfd = open("#n/1/ctl", 2); 
1990/0911    
	cfd = open("#nnonet/2/ctl", 2); 
1990/0427    
	if(cfd < 0){ 
		prerror("opening #n/1/ctl"); 
1990/0911    
		prerror("opening #n/2/ctl"); 
1990/0427    
		return; 
	} 
	if(write(cfd, scmd, strlen(scmd))<0){ 
1990/0504/sys/src/9/power/bboot.c:301,3071990/0911/sys/src/9/power/bboot.c:303,309
1990/0427    
/* 
 *  lookup the address for a system 
 */ 
char * 
1990/0911    
Address * 
1990/0427    
lookup(char *arg) 
{ 
	Address *a; 
1990/0504/sys/src/9/power/bboot.c:313,3191990/0911/sys/src/9/power/bboot.c:315,321
1990/0427    
	} 
	for(a = addr; a->name; a++){ 
		if(strcmp(a->name, arg) == 0) 
			return a->cmd; 
1990/0911    
			return a; 
1990/0427    
	} 
	return 0; 
} 


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