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

1991/1206/port/devroot.c (diff list | history)

1991/1115/sys/src/9/port/devroot.c:9,201991/1206/sys/src/9/port/devroot.c:9,21 (short | long | prev | next)
1990/0227    
enum{ 
	Qdir, 
	Qbin, 
	Qboot, 
1991/0214    
	Qcfs, 
1990/0227    
	Qdev, 
	Qenv, 
1991/0910    
	Qkfs, 
1990/0227    
	Qproc, 
1991/1206    
 
	Qboot, 
	Qcfs, 
	Qkfs, 
1990/0227    
}; 
 
1991/0214    
extern long	cfslen; 
1991/1115/sys/src/9/port/devroot.c:21,261991/1206/sys/src/9/port/devroot.c:22,29
1991/0216    
extern ulong	cfscode[]; 
1991/0910    
extern long	kfslen; 
extern ulong	kfscode[]; 
1991/1206    
extern ulong	bootlen; 
extern ulong	bootcode[]; 
1991/0214    
 
1990/0227    
Dirtab rootdir[]={ 
1991/1112    
	"bin",		{Qbin|CHDIR},	0,			0777, 
1991/1115/sys/src/9/port/devroot.c:83,881991/1206/sys/src/9/port/devroot.c:86,95
1990/0227    
int	  
rootwalk(Chan *c, char *name) 
{ 
1991/1206    
	if(strcmp(name, "..") == 0) { 
		c->qid.path = Qdir|CHDIR; 
		return 1; 
	} 
1991/0615    
	return devwalk(c, name, rootdir, nroot, rootgen); 
1990/0227    
} 
 
1991/1115/sys/src/9/port/devroot.c:114,1211991/1206/sys/src/9/port/devroot.c:121,126
1991/1115    
	USED(c); 
1990/0227    
} 
 
#include	"boot.h" 
                 
long	  
1991/0411    
rootread(Chan *c, void *buf, long n, ulong offset) 
1990/0227    
{ 
1991/1115/sys/src/9/port/devroot.c:125,1341991/1206/sys/src/9/port/devroot.c:130,139
1991/0615    
		return devdirread(c, buf, n, rootdir, nroot, rootgen); 
1990/0227    
 
	case Qboot:		/* boot */ 
1991/0411    
		if(offset >= sizeof bootcode) 
1991/1206    
		if(offset >= bootlen) 
1990/0227    
			return 0; 
1991/0411    
		if(offset+n > sizeof bootcode) 
			n = sizeof bootcode - offset; 
1991/1206    
		if(offset+n > bootlen) 
			n = bootlen - offset; 
1991/0411    
		memmove(buf, ((char*)bootcode)+offset, n); 
1991/0214    
		return n; 
 


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