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

1990/0613/gnot/main.c (diff list | history)

1990/0612/sys/src/9/gnot/main.c:7,221990/0613/sys/src/9/gnot/main.c:7,26 (short | long | prev | next)
1990/03091    
#include	"ureg.h" 
#include	"init.h" 
 
1990/0312    
typedef struct Boot{ 
1990/0613    
typedef struct Boot Boot; 
 
struct Boot 
{ 
1990/0312    
	long station; 
	long traffic; 
	char user[NAMELEN]; 
	char server[64]; 
	char line[64]; 
}Boot; 
1990/0613    
}; 
1990/0312    
#define BOOT ((Boot*)0) 
 
char protouser[NAMELEN]; 
1990/0613    
char bootline[64]; 
1990/06021    
int bank[2]; 
1990/0312    
 
void unloadboot(void); 
1990/0612/sys/src/9/gnot/main.c:48,531990/0613/sys/src/9/gnot/main.c:52,58
1990/0312    
unloadboot(void) 
{ 
	strncpy(protouser, BOOT->user, NAMELEN); 
1990/0613    
	memcpy(bootline, BOOT->line, 64); 
1990/0312    
} 
 
void 
1990/0612/sys/src/9/gnot/main.c:86,911990/0613/sys/src/9/gnot/main.c:91,99
1990/03091    
void 
init0(void) 
{ 
1990/0613    
	Chan *c; 
 
	u->nerrlab = 0; 
1990/03091    
	m->proc = u->p; 
	u->p->state = Running; 
	u->p->mach = m; 
1990/0612/sys/src/9/gnot/main.c:94,1001990/0613/sys/src/9/gnot/main.c:102,113
1990/03091    
	 
	u->slash = (*devtab[0].attach)(0); 
	u->dot = clone(u->slash, 0); 
                 
1990/0613    
	if(!waserror()){ 
		c = namec("#e/bootline", Acreate, OWRITE, 0600); 
		(*devtab[c->type].write)(c, bootline, 64); 
		close(c); 
	} 
	poperror(); 
1990/03091    
	touser(); 
} 
 
1990/0612/sys/src/9/gnot/main.c:242,2601990/0613/sys/src/9/gnot/main.c:255,273
1990/06021    
		return 0; 
	va = UZERO;	/* user page 1 is free to play with */ 
	putmmu(va, PTEVALID|(base+0)*1024L*1024L/BY2PG); 
	*(ulong*)va=0;	/* 0 at 0M */ 
1990/0613    
	*(ulong*)va = 0;	/* 0 at 0M */ 
1990/06021    
	putmmu(va, PTEVALID|(base+1)*1024L*1024L/BY2PG); 
	*(ulong*)va=1;	/* 1 at 1M */ 
1990/0613    
	*(ulong*)va = 1;	/* 1 at 1M */ 
1990/06021    
	putmmu(va, PTEVALID|(base+4)*1024L*1024L/BY2PG); 
	*(ulong*)va=4;	/* 4 at 4M */ 
1990/0613    
	*(ulong*)va = 4;	/* 4 at 4M */ 
1990/06021    
	putmmu(va, PTEVALID|(base+0)*1024L*1024L/BY2PG); 
	if(*(ulong*)va==0) 
1990/0613    
	if(*(ulong*)va == 0) 
1990/06021    
		return 16; 
	putmmu(va, PTEVALID|(base+1)*1024L*1024L/BY2PG); 
	if(*(ulong*)va==1) 
1990/0613    
	if(*(ulong*)va == 1) 
1990/06021    
		return 4; 
	putmmu(va, PTEVALID|(base+4)*1024L*1024L/BY2PG); 
	if(*(ulong*)va==2) 
1990/0613    
	putmmu(va, PTEVALID|(base+0)*1024L*1024L/BY2PG); 
	if(*(ulong*)va == 4) 
1990/06021    
		return 1; 
	return 0; 
} 


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