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

1993/0918/carrera/main.c (diff list | history)

1993/0903/sys/src/9/carrera/main.c:34,401993/0904/sys/src/9/carrera/main.c:34,39 (short | long)
1993/0903    
void 
main(void) 
{ 
	*(uchar*)(Uart0) = '*'; 
	tlbinit();		/* Very early to establish IO mappings */ 
	ioinit(); 
	arginit(); 
1993/0903/sys/src/9/carrera/main.c:46,531993/0904/sys/src/9/carrera/main.c:45,54
1993/0903    
	kmapinit(); 
	xinit(); 
	printinit(); 
	NS16552setup(Uart0, UartFREQ); 
1993/0904    
 
	NS16552setup(Uart1, UartFREQ); 
1993/0903    
	NS16552special(0, 9600, &kbdq, &printq, kbdcr2nl); 
1993/0904    
 
1993/0903    
	vecinit(); 
	iprint("\n\nBrazil\n"); 
	pageinit(); 
1993/0903/sys/src/9/carrera/main.c:60,661993/0904/sys/src/9/carrera/main.c:61,66
1993/0903    
	schedinit(); 
} 
 
                 
/* 
 *  copy arguments passed by the boot kernel (or ROM) into a temporary buffer. 
 *  we do this because the arguments are in memory that may be allocated 
1993/0903/sys/src/9/carrera/main.c:72,781993/0904/sys/src/9/carrera/main.c:72,79
1993/0903    
{ 
	char	*name; 
	char	*val; 
}bootenv[] = { 
1993/0904    
}bootenv[] = 
{ 
1993/0903    
	{"netaddr=",	sysname}, 
	{"console=",	consname}, 
	{"bootdisk=",	bootdisk}, 
1993/0903/sys/src/9/carrera/main.c:141,1461993/0904/sys/src/9/carrera/main.c:142,148
1993/0903    
 
	n = m->machno; 
	m->stb = &stlb[n][0]; 
1993/0904    
 
1993/0903    
	clockinit(); 
} 
 
1993/0903/sys/src/9/carrera/main.c:152,1601993/0904/sys/src/9/carrera/main.c:154,172
1993/0903    
{ 
	ulong phys; 
 
1993/0904    
	/* 
	 * Map devices 
	 */ 
1993/0903    
	phys = PPN(Devicephys)|PTEGLOBL|PTEVALID|PTEWRITE|PTEUNCACHED; 
1993/0904    
	puttlbx(1, Devicevirt, phys, PTEGLOBL, PGSZ64K); 
1993/0903    
 
	puttlbx(1, Devicevirt, phys, PTEGLOBL, PGSZ256K); 
1993/0904    
	/* 
	 * Map Interrupt control 
	 */ 
	phys = PPN(Intctlphys)|PTEGLOBL|PTEVALID|PTEWRITE|PTEUNCACHED; 
	puttlbx(2, Intctlvirt, phys, PTEGLOBL, PGSZ4K); 
 
	*(ushort*)Intenareg = 0xffff; 
1993/0903    
} 
 
/* 
1993/0903/sys/src/9/carrera/main.c:166,1721993/0904/sys/src/9/carrera/main.c:178,185
1993/0903    
	memmove((ulong*)UTLBMISS, (ulong*)vector0, 0x100); 
	memmove((ulong*)CACHETRAP, (ulong*)vector100, 0x80); 
	memmove((ulong*)EXCEPTION, (ulong*)vector180, 0x80); 
	icflush((ulong*)UTLBMISS, 32*1024); 
1993/0904    
 
	icflush((ulong*)UTLBMISS, 8*1024); 
1993/0903    
} 
 
void 
1993/0903/sys/src/9/carrera/main.c:263,2741993/0904/sys/src/9/carrera/main.c:276,283
1993/0903    
 
	spllo(); 
	print("cpu %d exiting %d\n", m->machno, type); 
	timer = 0; 
	while(active.machs || consactive()) { 
		if(timer++ > 400) 
			break; 
1993/0904    
	while(consactive()) 
1993/0903    
		delay(10); 
	} 
	splhi(); 
	for(;;) 
		; 
1993/0903/sys/src/9/carrera/main.c:296,3021993/0904/sys/src/9/carrera/main.c:305,311
1993/0903    
	conf.npage1 = 0; 
	conf.base1 = 0; 
 
	conf.upages = (conf.npage*90)/100; 
1993/0904    
	conf.upages = (conf.npage*70)/100; 
1993/0903    
	if(top - conf.upages > (256*1024*1024)/BY2PG) 
		conf.upages = top - (256*1024*1024)/BY2PG; 
 
1993/0903/sys/src/9/carrera/main.c:304,3101993/0904/sys/src/9/carrera/main.c:313,319
1993/0903    
 
	/* set up other configuration parameters */ 
	conf.nproc = 100; 
	conf.nswap = 262144; 
1993/0904    
	conf.nswap = conf.npage*3; 
1993/0903    
	conf.nimage = 200; 
	conf.ipif = 8; 
	conf.ip = 64; 
1993/0904/sys/src/9/carrera/main.c:40,541993/0905/sys/src/9/carrera/main.c:40,50 (short | long)
1993/0903    
	confinit(); 
	savefpregs(&initfp); 
	machinit(); 
	active.exiting = 0; 
	active.machs = 1; 
	kmapinit(); 
	xinit(); 
1993/0905    
	iomapinit(); 
1993/0903    
	printinit(); 
1993/0904    
                 
	NS16552setup(Uart1, UartFREQ); 
1993/0903    
	NS16552special(0, 9600, &kbdq, &printq, kbdcr2nl); 
1993/0904    
                 
1993/0905    
	serialinit(); 
1993/0903    
	vecinit(); 
	iprint("\n\nBrazil\n"); 
	pageinit(); 
1993/0904/sys/src/9/carrera/main.c:58,631993/0905/sys/src/9/carrera/main.c:54,63
1993/0903    
	rootfiles(); 
	swapinit(); 
	userinit(); 
1993/0905    
enab(); 
spllo(); 
for(;;) 
  ; 
1993/0903    
	schedinit(); 
} 
 
1993/0904/sys/src/9/carrera/main.c:143,1521993/0905/sys/src/9/carrera/main.c:143,166
1993/0903    
	n = m->machno; 
	m->stb = &stlb[n][0]; 
1993/0904    
 
1993/0905    
	m->speed = 50; 
1993/0903    
	clockinit(); 
1993/0905    
 
	active.exiting = 0; 
	active.machs = 1; 
1993/0903    
} 
 
/* 
1993/0905    
 * Set up a console on serial port 2 
 */ 
void 
serialinit(void) 
{ 
	NS16552setup(Uart1, UartFREQ); 
	NS16552special(0, 9600, &kbdq, &printq, kbdcr2nl); 
} 
 
/* 
1993/0903    
 * Map IO address space in wired down TLB entry 1 
 */ 
void 
1993/0904/sys/src/9/carrera/main.c:166,1751993/0905/sys/src/9/carrera/main.c:180,222
1993/0904    
	phys = PPN(Intctlphys)|PTEGLOBL|PTEVALID|PTEWRITE|PTEUNCACHED; 
	puttlbx(2, Intctlvirt, phys, PTEGLOBL, PGSZ4K); 
 
	*(ushort*)Intenareg = 0xffff; 
1993/0905    
	/* Enable all devce interrupt */ 
	IO(ushort, Intenareg) = 0xffff; 
1993/0903    
} 
 
1993/0905    
void 
enetaddr(uchar *ea) 
{ 
	/** BUG get from PROM */ 
	static uchar tea[] = { 0x00, 0x00, 0x77, 0x01, 0xD2, 0xba }; 
 
	memmove(ea, tea, sizeof(tea)); 
} 
 
1993/0903    
/* 
1993/0905    
 * All DMA and ether IO buffers must reside in the first 16M bytes of 
 * memory to be covered by the translation registers 
 */ 
void 
iomapinit(void) 
{ 
	int i; 
	Tte *t; 
 
	t = xspanalloc(Ntranslation*sizeof(Tte), BY2PG, 0); 
 
	for(i = 0; i < Ntranslation; i++) 
		t[i].lo = i<<PGSHIFT; 
 
	/* Set the translation table */ 
	IO(ulong, Ttbr) = PADDR(t); 
	IO(ulong, Tlrb) = (Ntranslation-1)*sizeof(Tte); 
 
	/* Invalidate the old entries */ 
	IO(ulong, Tir) = 0; 
} 
 
/* 
1993/0903    
 *  setup MIPS trap vectors 
 */ 
void 
1993/0904/sys/src/9/carrera/main.c:272,2811993/0905/sys/src/9/carrera/main.c:319,328
1993/0903    
void 
exit(long type) 
{ 
	int timer; 
1993/0905    
	USED(type); 
1993/0903    
 
	spllo(); 
	print("cpu %d exiting %d\n", m->machno, type); 
1993/0905    
	print("cpu %d exiting\n", m->machno); 
1993/0904    
	while(consactive()) 
1993/0903    
		delay(10); 
	splhi(); 
1993/0904/sys/src/9/carrera/main.c:288,2981993/0905/sys/src/9/carrera/main.c:335,340
1993/0903    
{ 
	ulong ktop, top; 
 
	/* 
	 *  divide memory twixt user pages and kernel. Since 
	 *  the kernel can't use anything above .5G unmapped, 
	 *  make sure all that memory goes to the user. 
	 */ 
	ktop = PGROUND((ulong)end); 
	ktop = PADDR(ktop); 
	top = (16*1024*1024)/BY2PG; 
1993/0904/sys/src/9/carrera/main.c:306,3131993/0905/sys/src/9/carrera/main.c:348,353
1993/0903    
	conf.base1 = 0; 
 
1993/0904    
	conf.upages = (conf.npage*70)/100; 
1993/0903    
	if(top - conf.upages > (256*1024*1024)/BY2PG) 
		conf.upages = top - (256*1024*1024)/BY2PG; 
 
	conf.nmach = 1; 
 
1993/0904/sys/src/9/carrera/main.c:320,3261993/0905/sys/src/9/carrera/main.c:360,366
1993/0903    
	conf.arp = 32; 
	conf.frag = 32; 
 
	conf.copymode = 0;		/* copy on reference */ 
1993/0905    
	conf.copymode = 0;		/* copy on write */ 
1993/0903    
} 
 
 
1993/0905/sys/src/9/carrera/main.c:54,631993/0906/sys/src/9/carrera/main.c:54,60 (short | long)
1993/0903    
	rootfiles(); 
	swapinit(); 
	userinit(); 
1993/0905    
enab(); 
spllo(); 
for(;;) 
  ; 
1993/0906    
screeninit(); 
1993/0903    
	schedinit(); 
} 
 
1993/0905/sys/src/9/carrera/main.c:166,1961993/0906/sys/src/9/carrera/main.c:163,206
1993/0903    
void 
ioinit(void) 
{ 
	ulong phys; 
1993/0906    
	ulong devphys, isaphys, intphys; 
1993/0903    
 
1993/0904    
	/* 
	 * Map devices 
1993/0906    
	 * Map devices and the Eisa control space 
1993/0904    
	 */ 
1993/0903    
	phys = PPN(Devicephys)|PTEGLOBL|PTEVALID|PTEWRITE|PTEUNCACHED; 
1993/0904    
	puttlbx(1, Devicevirt, phys, PTEGLOBL, PGSZ64K); 
1993/0906    
	devphys = PPN(Devicephys)|PTEGLOBL|PTEVALID|PTEWRITE|PTEUNCACHED; 
	isaphys = PPN(Eisaphys)|PTEGLOBL|PTEVALID|PTEWRITE|PTEUNCACHED; 
1993/0903    
 
1993/0906    
	puttlbx(1, Devicevirt, devphys, isaphys, PGSZ64K); 
 
1993/0904    
	/* 
	 * Map Interrupt control 
	 */ 
	phys = PPN(Intctlphys)|PTEGLOBL|PTEVALID|PTEWRITE|PTEUNCACHED; 
	puttlbx(2, Intctlvirt, phys, PTEGLOBL, PGSZ4K); 
1993/0906    
	intphys = PPN(Intctlphys)|PTEGLOBL|PTEVALID|PTEWRITE|PTEUNCACHED; 
	puttlbx(2, Intctlvirt, intphys, PTEGLOBL, PGSZ4K); 
1993/0904    
 
1993/0905    
	/* Enable all devce interrupt */ 
	IO(ushort, Intenareg) = 0xffff; 
1993/0903    
} 
 
1993/0906    
/* 
 * Pull the ethernet address out of NVRAM 
 */ 
1993/0905    
void 
enetaddr(uchar *ea) 
{ 
	/** BUG get from PROM */ 
	static uchar tea[] = { 0x00, 0x00, 0x77, 0x01, 0xD2, 0xba }; 
1993/0906    
	int i; 
	uchar tbuf[8]; 
1993/0905    
 
	memmove(ea, tea, sizeof(tea)); 
1993/0906    
	for(i = 0; i < 8; i++) 
		tbuf[i] = ((uchar*)(NvramRO+Enetoffset))[i]; 
 
	print("ether:"); 
	for(i = 0; i < 6; i++) { 
		ea[i] = tbuf[7-i]; 
		print("%2.2ux", ea[i]); 
	} 
	print("\n"); 
1993/0905    
} 
 
1993/0903    
/* 
1993/0905/sys/src/9/carrera/main.c:360,3651993/0906/sys/src/9/carrera/main.c:370,377
1993/0903    
	conf.arp = 32; 
	conf.frag = 32; 
 
1993/0906    
	conf.monitor = 1; 
 
1993/0905    
	conf.copymode = 0;		/* copy on write */ 
1993/0903    
} 
 
1993/0905/sys/src/9/carrera/main.c:379,3901993/0906/sys/src/9/carrera/main.c:391,393
1993/0903    
	USED(f); 
	USED(d); 
} 
                 
int 
mouseputc(IOQ *q, int c) 
{ 
	USED(q); 
	USED(c); 
	return 0; 
} 
                 
1993/0906/sys/src/9/carrera/main.c:47,521993/0907/sys/src/9/carrera/main.c:47,53 (short | long)
1993/0905    
	serialinit(); 
1993/0903    
	vecinit(); 
	iprint("\n\nBrazil\n"); 
1993/0907    
/*screeninit();*/ 
1993/0903    
	pageinit(); 
	procinit0(); 
	initseg(); 
1993/0906/sys/src/9/carrera/main.c:54,601993/0907/sys/src/9/carrera/main.c:55,60
1993/0903    
	rootfiles(); 
	swapinit(); 
	userinit(); 
1993/0906    
screeninit(); 
1993/0903    
	schedinit(); 
} 
 
1993/0906/sys/src/9/carrera/main.c:155,1601993/0907/sys/src/9/carrera/main.c:155,162
1993/0905    
{ 
	NS16552setup(Uart1, UartFREQ); 
	NS16552special(0, 9600, &kbdq, &printq, kbdcr2nl); 
1993/0907    
 
	kbdinit(); 
1993/0905    
} 
 
/* 
1993/0906/sys/src/9/carrera/main.c:163,1691993/0907/sys/src/9/carrera/main.c:165,171
1993/0903    
void 
ioinit(void) 
{ 
1993/0906    
	ulong devphys, isaphys, intphys; 
1993/0907    
	ulong devphys, isaphys, intphys, isamphys; 
1993/0903    
 
1993/0904    
	/* 
1993/0906    
	 * Map devices and the Eisa control space 
1993/0906/sys/src/9/carrera/main.c:174,1841993/0907/sys/src/9/carrera/main.c:176,188
1993/0906    
	puttlbx(1, Devicevirt, devphys, isaphys, PGSZ64K); 
 
1993/0904    
	/* 
	 * Map Interrupt control 
1993/0907    
	 * Map Interrupt control & Eisa memory 
1993/0904    
	 */ 
1993/0906    
	intphys = PPN(Intctlphys)|PTEGLOBL|PTEVALID|PTEWRITE|PTEUNCACHED; 
	puttlbx(2, Intctlvirt, intphys, PTEGLOBL, PGSZ4K); 
1993/0907    
	isamphys = PPN(Eisamphys)|PTEGLOBL|PTEVALID|PTEWRITE|PTEUNCACHED; 
1993/0904    
 
1993/0907    
	puttlbx(2, Intctlvirt, intphys, isamphys, PGSZ1M); 
 
1993/0905    
	/* Enable all devce interrupt */ 
	IO(ushort, Intenareg) = 0xffff; 
1993/0903    
} 
1993/0906/sys/src/9/carrera/main.c:268,2751993/0907/sys/src/9/carrera/main.c:272,277
1993/0903    
	touser((uchar*)(USTKTOP-sizeof(argbuf))); 
} 
 
FPsave	initfp; 
                 
void 
userinit(void) 
{ 
1993/0906/sys/src/9/carrera/main.c:370,3761993/0907/sys/src/9/carrera/main.c:372,378
1993/0903    
	conf.arp = 32; 
	conf.frag = 32; 
 
1993/0906    
	conf.monitor = 1; 
1993/0907    
	conf.monitor = 0; 
1993/0906    
 
1993/0905    
	conf.copymode = 0;		/* copy on write */ 
1993/0903    
} 
1993/0906/sys/src/9/carrera/main.c:379,3891993/0907/sys/src/9/carrera/main.c:381,386
1993/0903    
/* 
 *  for the sake of devcons 
 */ 
void 
lights(int v) 
{ 
	USED(v); 
} 
 
void 
buzz(int f, int d) 
1993/0907/sys/src/9/carrera/main.c:47,531993/0908/sys/src/9/carrera/main.c:47,53 (short | long)
1993/0905    
	serialinit(); 
1993/0903    
	vecinit(); 
	iprint("\n\nBrazil\n"); 
1993/0907    
/*screeninit();*/ 
1993/0908    
 screeninit(); /**/ 
1993/0903    
	pageinit(); 
	procinit0(); 
	initseg(); 
1993/0907/sys/src/9/carrera/main.c:170,1771993/0908/sys/src/9/carrera/main.c:170,177
1993/0904    
	/* 
1993/0906    
	 * Map devices and the Eisa control space 
1993/0904    
	 */ 
1993/0906    
	devphys = PPN(Devicephys)|PTEGLOBL|PTEVALID|PTEWRITE|PTEUNCACHED; 
	isaphys = PPN(Eisaphys)|PTEGLOBL|PTEVALID|PTEWRITE|PTEUNCACHED; 
1993/0908    
	devphys = IOPTE|PPN(Devicephys); 
	isaphys = IOPTE|PPN(Eisaphys); 
1993/0903    
 
1993/0906    
	puttlbx(1, Devicevirt, devphys, isaphys, PGSZ64K); 
 
1993/0907/sys/src/9/carrera/main.c:178,1901993/0908/sys/src/9/carrera/main.c:178,195
1993/0904    
	/* 
1993/0907    
	 * Map Interrupt control & Eisa memory 
1993/0904    
	 */ 
1993/0906    
	intphys = PPN(Intctlphys)|PTEGLOBL|PTEVALID|PTEWRITE|PTEUNCACHED; 
1993/0907    
	isamphys = PPN(Eisamphys)|PTEGLOBL|PTEVALID|PTEWRITE|PTEUNCACHED; 
1993/0908    
	intphys  = IOPTE|PPN(Intctlphys); 
	isamphys = IOPTE|PPN(Eisamphys); 
1993/0904    
 
1993/0907    
	puttlbx(2, Intctlvirt, intphys, isamphys, PGSZ1M); 
 
1993/0905    
	/* Enable all devce interrupt */ 
	IO(ushort, Intenareg) = 0xffff; 
1993/0908    
 
	/* Look at the first 16M of Eisa memory */ 
iprint("write latch\n"); 
/*	IO(uchar, EisaLatch) = 0; /**/ 
iprint("done\n"); 
1993/0903    
} 
 
1993/0906    
/* 
1993/0908/sys/src/9/carrera/main.c:47,531993/0909/sys/src/9/carrera/main.c:47,53 (short | long)
1993/0905    
	serialinit(); 
1993/0903    
	vecinit(); 
	iprint("\n\nBrazil\n"); 
1993/0908    
 screeninit(); /**/ 
1993/0909    
screeninit();  
1993/0903    
	pageinit(); 
	procinit0(); 
	initseg(); 
1993/0909/sys/src/9/carrera/main.c:47,531993/0914/sys/src/9/carrera/main.c:47,53 (short | long)
1993/0905    
	serialinit(); 
1993/0903    
	vecinit(); 
	iprint("\n\nBrazil\n"); 
1993/0909    
screeninit();  
1993/0914    
/* screeninit(); */ 
1993/0903    
	pageinit(); 
	procinit0(); 
	initseg(); 
1993/0909/sys/src/9/carrera/main.c:171,1771993/0914/sys/src/9/carrera/main.c:171,177
1993/0906    
	 * Map devices and the Eisa control space 
1993/0904    
	 */ 
1993/0908    
	devphys = IOPTE|PPN(Devicephys); 
	isaphys = IOPTE|PPN(Eisaphys); 
1993/0914    
	isaphys = /* IOPTE|PPN(Eisaphys) */ PTEGLOBL; 
1993/0903    
 
1993/0906    
	puttlbx(1, Devicevirt, devphys, isaphys, PGSZ64K); 
 
1993/0914/sys/src/9/carrera/main.c:51,581993/0915/sys/src/9/carrera/main.c:51,58 (short | long)
1993/0903    
	pageinit(); 
	procinit0(); 
	initseg(); 
1993/0915    
	links(); 
1993/0903    
	chandevreset(); 
	rootfiles(); 
	swapinit(); 
	userinit(); 
	schedinit(); 
1993/0914/sys/src/9/carrera/main.c:179,1851993/0915/sys/src/9/carrera/main.c:179,185
1993/0907    
	 * Map Interrupt control & Eisa memory 
1993/0904    
	 */ 
1993/0908    
	intphys  = IOPTE|PPN(Intctlphys); 
	isamphys = IOPTE|PPN(Eisamphys); 
1993/0915    
	isamphys = /* IOPTE|PPN(Eisamphys) */ PTEGLOBL; 
1993/0904    
 
1993/0907    
	puttlbx(2, Intctlvirt, intphys, isamphys, PGSZ1M); 
 
1993/0915/sys/src/9/carrera/main.c:35,411993/0918/sys/src/9/carrera/main.c:35,41 (short | long)
1993/0903    
main(void) 
{ 
	tlbinit();		/* Very early to establish IO mappings */ 
	ioinit(); 
1993/0918    
	ioinit(1); 
1993/0903    
	arginit(); 
	confinit(); 
	savefpregs(&initfp); 
1993/0915/sys/src/9/carrera/main.c:46,531993/0918/sys/src/9/carrera/main.c:46,53
1993/0903    
	printinit(); 
1993/0905    
	serialinit(); 
1993/0903    
	vecinit(); 
	iprint("\n\nBrazil\n"); 
1993/0914    
/* screeninit(); */ 
1993/0918    
	screeninit(); 
	print("\n\nBrazil\n"); 
1993/0903    
	pageinit(); 
	procinit0(); 
	initseg(); 
1993/0915/sys/src/9/carrera/main.c:163,1771993/0918/sys/src/9/carrera/main.c:163,190
1993/0903    
 * Map IO address space in wired down TLB entry 1 
 */ 
void 
ioinit(void) 
1993/0918    
ioinit(int mapeisa) 
1993/0903    
{ 
1993/0907    
	ulong devphys, isaphys, intphys, isamphys; 
1993/0903    
 
1993/0904    
	/* 
1993/0918    
	 * If you want to segattach the eisa space these 
	 * mappings must be turned off to prevent duplication 
	 * of the tlb entries 
	 */ 
	if(mapeisa) { 
		isaphys = IOPTE|PPN(Eisaphys)|PTEGLOBL; 
		isamphys = 0x04000000|IOPTE|PTEGLOBL; 
	} 
	else { 
		isaphys = PTEGLOBL; 
		isamphys = PTEGLOBL; 
	} 
 
	/* 
1993/0906    
	 * Map devices and the Eisa control space 
1993/0904    
	 */ 
1993/0908    
	devphys = IOPTE|PPN(Devicephys); 
1993/0914    
	isaphys = /* IOPTE|PPN(Eisaphys) */ PTEGLOBL; 
1993/0903    
 
1993/0906    
	puttlbx(1, Devicevirt, devphys, isaphys, PGSZ64K); 
 
1993/0915/sys/src/9/carrera/main.c:179,1851993/0918/sys/src/9/carrera/main.c:192,197
1993/0907    
	 * Map Interrupt control & Eisa memory 
1993/0904    
	 */ 
1993/0908    
	intphys  = IOPTE|PPN(Intctlphys); 
1993/0915    
	isamphys = /* IOPTE|PPN(Eisamphys) */ PTEGLOBL; 
1993/0904    
 
1993/0907    
	puttlbx(2, Intctlvirt, intphys, isamphys, PGSZ1M); 
 
1993/0915/sys/src/9/carrera/main.c:187,1951993/0918/sys/src/9/carrera/main.c:199,205
1993/0905    
	IO(ushort, Intenareg) = 0xffff; 
1993/0908    
 
	/* Look at the first 16M of Eisa memory */ 
iprint("write latch\n"); 
/*	IO(uchar, EisaLatch) = 0; /**/ 
iprint("done\n"); 
1993/0903    
} 
 
1993/0906    
/* 
1993/0915/sys/src/9/carrera/main.c:364,3701993/0918/sys/src/9/carrera/main.c:374,380
1993/0903    
	conf.npage1 = 0; 
	conf.base1 = 0; 
 
1993/0904    
	conf.upages = (conf.npage*70)/100; 
1993/0918    
	conf.upages = (conf.npage*50)/100; 
1993/0903    
 
	conf.nmach = 1; 
 
1993/0915/sys/src/9/carrera/main.c:377,3831993/0918/sys/src/9/carrera/main.c:387,393
1993/0903    
	conf.arp = 32; 
	conf.frag = 32; 
 
1993/0907    
	conf.monitor = 0; 
1993/0918    
	conf.monitor = 1; 
1993/0906    
 
1993/0905    
	conf.copymode = 0;		/* copy on write */ 
1993/0903    
} 
1993/0918/sys/src/9/carrera/main.c:277,2831993/0930/sys/src/9/carrera/main.c:277,283 (short | long)
1993/0903    
 
	if(!waserror()){ 
		ksetenv("cputype", "mips"); 
		sprint(buf, "sgi %s 4D", conffile); 
1993/0930    
		sprint(buf, "%s R4400PC", conffile); 
1993/0903    
		ksetenv("terminal", buf); 
		ksetenv("sysname", sysname); 
		poperror(); 
1993/0930/sys/src/9/carrera/main.c:277,2831993/1005/sys/src/9/carrera/main.c:277,283 (short | long)
1993/0903    
 
	if(!waserror()){ 
		ksetenv("cputype", "mips"); 
1993/0930    
		sprint(buf, "%s R4400PC", conffile); 
1993/1005    
		sprint(buf, "carrera %s R4400PC", conffile); 
1993/0903    
		ksetenv("terminal", buf); 
		ksetenv("sysname", sysname); 
		poperror(); 
1993/1005/sys/src/9/carrera/main.c:47,531993/1015/sys/src/9/carrera/main.c:47,53 (short | long)
1993/0905    
	serialinit(); 
1993/0903    
	vecinit(); 
1993/0918    
	screeninit(); 
	print("\n\nBrazil\n"); 
1993/1015    
	iprint("\n\nBrazil\n"); 
1993/0903    
	pageinit(); 
	procinit0(); 
	initseg(); 
1993/1005/sys/src/9/carrera/main.c:137,1421993/1015/sys/src/9/carrera/main.c:137,144
1993/0903    
	/* scrub cache */ 
	cleancache(); 
 
1993/1015    
	memset(m, 0, sizeof(Mach)); 
 
1993/0903    
	n = m->machno; 
	m->stb = &stlb[n][0]; 
1993/0904    
 
1993/1005/sys/src/9/carrera/main.c:374,3801993/1015/sys/src/9/carrera/main.c:376,382
1993/0903    
	conf.npage1 = 0; 
	conf.base1 = 0; 
 
1993/0918    
	conf.upages = (conf.npage*50)/100; 
1993/1015    
	conf.upages = (conf.npage*70)/100; 
1993/0903    
 
	conf.nmach = 1; 
 
1993/1015/sys/src/9/carrera/main.c:197,2071993/1208/sys/src/9/carrera/main.c:197,219 (short | long)
1993/0904    
 
1993/0907    
	puttlbx(2, Intctlvirt, intphys, isamphys, PGSZ1M); 
 
1993/0905    
	/* Enable all devce interrupt */ 
1993/1208    
	/* Enable all device interrupts */ 
1993/0905    
	IO(ushort, Intenareg) = 0xffff; 
1993/0908    
 
	/* Look at the first 16M of Eisa memory */ 
/*	IO(uchar, EisaLatch) = 0; /**/ 
1993/1208    
} 
 
void	puttlbxx(int, ulong, ulong, ulong, int); 
void	puttlbx(int a, ulong b, ulong c, ulong d, int e) 
{ 
	static int done[4]; 
 
	if(((c|d)&PTEVALID) && a < 4){ 
		if(done[a]++) 
			puttlbx(a, b, c, d, e); 
	} 
	puttlbxx(a, b, c, d, e); 
1993/0903    
} 
 
1993/0906    
/* 
1993/1208/sys/src/9/carrera/main.c:6,111993/1209/sys/src/9/carrera/main.c:6,13 (short | long)
1993/0903    
#include	"io.h" 
#include	"init.h" 
 
1993/1209    
int	junk[32]; 
 
1993/0903    
/* 
 *  args passed by boot process 
 */ 
1993/1209/sys/src/9/carrera/main.c:6,131993/1210/sys/src/9/carrera/main.c:6,11 (short | long)
1993/0903    
#include	"io.h" 
#include	"init.h" 
 
1993/1209    
int	junk[32]; 
                 
1993/0903    
/* 
 *  args passed by boot process 
 */ 
1993/1209/sys/src/9/carrera/main.c:33,381993/1210/sys/src/9/carrera/main.c:31,39
1993/0903    
Conf	conf; 
FPsave	initfp; 
 
1993/1210    
extern	uchar rdbgcode[]; 
extern	ulong	rdbglen; 
 
1993/0903    
void 
main(void) 
{ 
1993/1209/sys/src/9/carrera/main.c:57,621993/1210/sys/src/9/carrera/main.c:58,64
1993/0903    
	chandevreset(); 
	swapinit(); 
	userinit(); 
1993/1210    
	rdbginit(); 
1993/0903    
	schedinit(); 
} 
 
1993/1209/sys/src/9/carrera/main.c:206,2231993/1210/sys/src/9/carrera/main.c:208,213
1993/0908    
/*	IO(uchar, EisaLatch) = 0; /**/ 
1993/1208    
} 
 
void	puttlbxx(int, ulong, ulong, ulong, int); 
void	puttlbx(int a, ulong b, ulong c, ulong d, int e) 
{ 
	static int done[4]; 
                 
	if(((c|d)&PTEVALID) && a < 4){ 
		if(done[a]++) 
			puttlbx(a, b, c, d, e); 
	} 
	puttlbxx(a, b, c, d, e); 
1993/0903    
} 
                 
1993/0906    
/* 
 * Pull the ethernet address out of NVRAM 
 */ 
1993/1209/sys/src/9/carrera/main.c:418,4211993/1210/sys/src/9/carrera/main.c:408,417
1993/0903    
{ 
	USED(f); 
	USED(d); 
1993/1210    
} 
 
void 
rdbginit(void) 
{ 
	memmove((void*)0xA001C000, rdbgcode, rdbglen); 
1993/0903    
} 
1993/1210/sys/src/9/carrera/main.c:415,4171993/1214/sys/src/9/carrera/main.c:415,425 (short | long)
1993/1210    
{ 
	memmove((void*)0xA001C000, rdbgcode, rdbglen); 
1993/0903    
} 
1993/1214    
 
void 
procsave(Proc *p) 
{ 
	/* keep track of tlbfaults */ 
	up->counter[TLBCNTR] += m->tlbfault - m->otlbfault; 
	m->otlbfault = m->tlbfault; 
} 
1993/1214/sys/src/9/carrera/main.c:419,4241993/1216/sys/src/9/carrera/main.c:419,426 (short | long)
1993/1214    
void 
procsave(Proc *p) 
{ 
1993/1216    
	USED(p); 
 
1993/1214    
	/* keep track of tlbfaults */ 
	up->counter[TLBCNTR] += m->tlbfault - m->otlbfault; 
	m->otlbfault = m->tlbfault; 
1993/1216/sys/src/9/carrera/main.c:37,441993/1217/sys/src/9/carrera/main.c:37,45 (short | long)
1993/0903    
void 
main(void) 
{ 
	tlbinit();		/* Very early to establish IO mappings */ 
1993/0918    
	ioinit(1); 
1993/1217    
	rdbginit(); 
	tlbinit(); 
	ioinit(1);		/* Very early to establish IO mappings */ 
1993/0903    
	arginit(); 
	confinit(); 
	savefpregs(&initfp); 
1993/1216/sys/src/9/carrera/main.c:62,671993/1217/sys/src/9/carrera/main.c:63,69
1993/0903    
	schedinit(); 
} 
 
1993/1217    
 
1993/0903    
/* 
 *  copy arguments passed by the boot kernel (or ROM) into a temporary buffer. 
 *  we do this because the arguments are in memory that may be allocated 
1993/1216/sys/src/9/carrera/main.c:398,4071993/1217/sys/src/9/carrera/main.c:400,414
1993/0905    
	conf.copymode = 0;		/* copy on write */ 
1993/0903    
} 
 
1993/1217    
void 
procsave(Proc *p) 
{ 
	USED(p); 
1993/0903    
 
/* 
 *  for the sake of devcons 
 */ 
1993/1217    
	/* keep track of tlbfaults */ 
	up->counter[TLBCNTR] += m->tlbfault - m->otlbfault; 
	m->otlbfault = m->tlbfault; 
} 
1993/0903    
 
void 
buzz(int f, int d) 
1993/1216/sys/src/9/carrera/main.c:410,4271993/1217/sys/src/9/carrera/main.c:417,469
1993/0903    
	USED(d); 
1993/1210    
} 
 
void 
rdbginit(void) 
1993/1217    
/* 
	register offsets of ARCS prom jmpbuf 
		JB_PC		0 
		JB_SP		1 
		JB_FP		2 
		JB_S0		3 
		JB_S1		4 
		JB_S2		5 
		JB_S3		6 
		JB_S4		7 
		JB_S5		8 
		JB_S6		9 
		JB_S7		10 
*/ 
 
struct  
1993/1210    
{ 
	memmove((void*)0xA001C000, rdbgcode, rdbglen); 
1993/0903    
} 
1993/1217    
	ulong	pc; 
	ulong	sp; 
	ulong	fp; 
	ulong	s[7]; 
} Mipsjmpbuf; 
1993/1214    
 
void 
procsave(Proc *p) 
1993/1217    
rdbginit(void) 
1993/1214    
{ 
1993/1216    
	USED(p); 
1993/1217    
	uchar *vec; 
	ulong jba; 
1993/1216    
 
1993/1214    
	/* keep track of tlbfaults */ 
	up->counter[TLBCNTR] += m->tlbfault - m->otlbfault; 
	m->otlbfault = m->tlbfault; 
1993/1217    
	/* Only interested in the PC */ 
	Mipsjmpbuf.pc = 0xA001C020; 
 
	/* Link an NMI handler to the debugger 
	 * - addresses from the ARCS rom source 
	 */ 
	vec = (uchar*)0xA0000420; 
	jba = (ulong)UNCACHED(void, &Mipsjmpbuf); 
 
	vec[0] = 'N'; 
	vec[1] = 'm'; 
	vec[2] = 'i'; 
	vec[3] = 's'; 
	vec[4] = jba>>24; 
	vec[5] = jba>>16; 
	vec[6] = jba>>8; 
	vec[7] = jba; 
 
	/* Install the debugger code in a known place */ 
	memmove((void*)0xA001C000, rdbgcode, rdbglen); 
1993/1214    
} 
1993/1217/sys/src/9/carrera/main.c:37,431993/1218/sys/src/9/carrera/main.c:37,42 (short | long)
1993/0903    
void 
main(void) 
{ 
1993/1217    
	rdbginit(); 
	tlbinit(); 
	ioinit(1);		/* Very early to establish IO mappings */ 
1993/0903    
	arginit(); 
1993/1217/sys/src/9/carrera/main.c:173,1791993/1218/sys/src/9/carrera/main.c:172,178
1993/0903    
void 
1993/0918    
ioinit(int mapeisa) 
1993/0903    
{ 
1993/0907    
	ulong devphys, isaphys, intphys, isamphys; 
1993/1218    
	ulong devphys, isaphys, intphys, isamphys, promphys; 
1993/0903    
 
1993/0904    
	/* 
1993/0918    
	 * If you want to segattach the eisa space these 
1993/1217/sys/src/9/carrera/main.c:206,2131993/1218/sys/src/9/carrera/main.c:205,214
1993/1208    
	/* Enable all device interrupts */ 
1993/0905    
	IO(ushort, Intenareg) = 0xffff; 
1993/0908    
 
	/* Look at the first 16M of Eisa memory */ 
/*	IO(uchar, EisaLatch) = 0; /**/ 
1993/1218    
	/* Map the rom back into Promvirt to allow NMI handling */ 
	promphys = IOPTE|PPN(Promphys); 
 
	puttlbx(3, Promvirt, promphys, PTEGLOBL, PGSZ1M); 
1993/1208    
} 
 
1993/0906    
/* 
1993/1218/sys/src/9/carrera/main.c:391,4001993/1219/sys/src/9/carrera/main.c:391,396 (short | long)
1993/0903    
	conf.nproc = 100; 
1993/0904    
	conf.nswap = conf.npage*3; 
1993/0903    
	conf.nimage = 200; 
	conf.ipif = 8; 
	conf.ip = 64; 
	conf.arp = 32; 
	conf.frag = 32; 
 
1993/0918    
	conf.monitor = 1; 
1993/0906    
 
1993/1219/sys/src/9/carrera/main.c:355,3601993/1221/sys/src/9/carrera/main.c:355,362 (short | long)
1993/0903    
void 
exit(long type) 
{ 
1993/1221    
	uchar *vec; 
 
1993/0905    
	USED(type); 
1993/0903    
 
	spllo(); 
1993/1219/sys/src/9/carrera/main.c:361,3691993/1221/sys/src/9/carrera/main.c:363,375
1993/0905    
	print("cpu %d exiting\n", m->machno); 
1993/0904    
	while(consactive()) 
1993/0903    
		delay(10); 
1993/1221    
 
1993/0903    
	splhi(); 
	for(;;) 
		; 
1993/1221    
	/* Turn off the NMI hander for the debugger */ 
	vec = (uchar*)0xA0000420; 
	vec[0] = 0; 
	/* Call the prom */ 
	((void(*)(void))0xBFC00000)(); 
1993/0903    
} 
 
void 
1993/1221/sys/src/9/carrera/main.c:248,2541994/0115/sys/src/9/carrera/main.c:248,254 (short | long)
1993/0905    
 
	/* Set the translation table */ 
	IO(ulong, Ttbr) = PADDR(t); 
	IO(ulong, Tlrb) = (Ntranslation-1)*sizeof(Tte); 
1994/0115    
	IO(ulong, Tlrb) = Ntranslation*sizeof(Tte); 
1993/0905    
 
	/* Invalidate the old entries */ 
	IO(ulong, Tir) = 0; 
1994/0115/sys/src/9/carrera/main.c:450,4561994/0126/sys/src/9/carrera/main.c:450,456 (short | long)
1993/1217    
	ulong jba; 
1993/1216    
 
1993/1217    
	/* Only interested in the PC */ 
	Mipsjmpbuf.pc = 0xA001C020; 
1994/0126    
	Mipsjmpbuf.pc = 0x8001C020; 
1993/1217    
 
	/* Link an NMI handler to the debugger 
	 * - addresses from the ARCS rom source 
1994/0115/sys/src/9/carrera/main.c:468,4721994/0126/sys/src/9/carrera/main.c:468,472
1993/1217    
	vec[7] = jba; 
 
	/* Install the debugger code in a known place */ 
	memmove((void*)0xA001C000, rdbgcode, rdbglen); 
1994/0126    
	memmove((void*)0x8001C000, rdbgcode, rdbglen); 
1993/1214    
} 
1994/0126/sys/src/9/carrera/main.c:272,2771994/0207/sys/src/9/carrera/main.c:272,278 (short | long)
1993/0903    
{ 
	char buf[2*NAMELEN]; 
 
1994/0207    
 
1993/0903    
	spllo(); 
 
	/* 
1994/0207/sys/src/9/carrera/main.c:172,1781994/0210/sys/src/9/carrera/main.c:172,178 (short | long)
1993/0903    
void 
1993/0918    
ioinit(int mapeisa) 
1993/0903    
{ 
1993/1218    
	ulong devphys, isaphys, intphys, isamphys, promphys; 
1994/0210    
	ulong devphys, isaphys, intphys, isamphys, promphys, ptec, ptes, v; 
1993/0903    
 
1993/0904    
	/* 
1993/0918    
	 * If you want to segattach the eisa space these 
1994/0207/sys/src/9/carrera/main.c:192,1981994/0210/sys/src/9/carrera/main.c:192,197
1993/0906    
	 * Map devices and the Eisa control space 
1993/0904    
	 */ 
1993/0908    
	devphys = IOPTE|PPN(Devicephys); 
1993/0903    
                 
1993/0906    
	puttlbx(1, Devicevirt, devphys, isaphys, PGSZ64K); 
 
1993/0904    
	/* 
1994/0207/sys/src/9/carrera/main.c:199,2051994/0210/sys/src/9/carrera/main.c:198,203
1993/0907    
	 * Map Interrupt control & Eisa memory 
1993/0904    
	 */ 
1993/0908    
	intphys  = IOPTE|PPN(Intctlphys); 
1993/0904    
                 
1993/0907    
	puttlbx(2, Intctlvirt, intphys, isamphys, PGSZ1M); 
 
1993/1208    
	/* Enable all device interrupts */ 
1994/0207/sys/src/9/carrera/main.c:207,2141994/0210/sys/src/9/carrera/main.c:205,222
1993/0908    
 
1993/1218    
	/* Map the rom back into Promvirt to allow NMI handling */ 
	promphys = IOPTE|PPN(Promphys); 
                 
	puttlbx(3, Promvirt, promphys, PTEGLOBL, PGSZ1M); 
1994/0210    
 
	/* 8 MB video ram config */ 
	v = IO(ulong, 0xE0000004); 
	v &= ~(3<<8); 
	v |= (2<<8); 
	IO(ulong, 0xE0000004) = v; 
 
	/* Map the display hardware */ 
	ptec = PPN(VideoCTL)|PTEGLOBL|PTEVALID|PTEWRITE|PTEUNCACHED; 
	ptes = PPN(VideoMEM)|PTEGLOBL|PTEVALID|PTEWRITE|PTEUNCACHED; 
	puttlbx(4, Screenvirt, ptes, ptec, PGSZ4M); 
1993/1208    
} 
 
1993/0906    
/* 
1994/0207/sys/src/9/carrera/main.c:271,2771994/0210/sys/src/9/carrera/main.c:279,284
1993/0903    
init0(void) 
{ 
	char buf[2*NAMELEN]; 
                 
1994/0207    
 
1993/0903    
	spllo(); 
 
Too many diffs (26 > 25). Stopping.


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