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

1991/1210/pc/kbd.c (diff list | history)

1991/1207/sys/src/9/pc/kbd.c:169,1751991/1210/sys/src/9/pc/kbd.c:169,201 (short | long | prev | next)
1991/0803    
	return 0; 
1991/0731    
} 
 
1991/1210    
/* 
 *  ask 8042 to enable the use of address bit 20 
 */ 
1991/0703    
void 
1991/1210    
i8042a20(void) 
{ 
	outready(); 
	outb(Cmd, 0xD1); 
	outready(); 
	outb(Data, 0xDF); 
	outready(); 
} 
 
/* 
 *  ask 8042 to reset the 386 
 */ 
void 
i8042reset(void) 
{ 
	outready(); 
	outb(Cmd, 0xD1); 
	outready(); 
	outb(Data, 0xDE); 
	outready(); 
} 
 
void 
1991/0703    
kbdinit(void) 
{ 
1991/0731    
	int c, s; 
1991/1207/sys/src/9/pc/kbd.c:185,2031991/1210/sys/src/9/pc/kbd.c:211,240
1991/0730    
		if(c & Inready) 
			inb(Data); 
 
1991/0731    
	/* enable kbd/mouse xfers and interrupts */ 
1991/0730    
	outb(Cmd, 0x60); 
1991/0803    
	if(outready() < 0) 
		print("kbd init failed\n"); 
1991/1207    
	outb(Data, 0x47);	/* BUG -- on 6300 0x65 */ 
1991/0803    
	if(outready() < 0) 
		print("kbd init failed\n"); 
1991/1207    
	outb(Cmd, 0xA8);	/* BUG -- should this be AE? */ 
1991/0731    
                 
1991/0803    
	/* make mouse streaming, enabled */ 
	if(mousecmd(0xEA) < 0 
	|| mousecmd(0xF4) < 0) 
		print("can't initialize mouse\n"); 
1991/1210    
	switch(machtype){ 
	case Attnsx: 
		/* enable kbd/mouse xfers and interrupts */ 
		outb(Cmd, 0x60); 
		if(outready() < 0) 
			print("kbd init failed\n"); 
		outb(Data, 0x47); 
		if(outready() < 0) 
			print("kbd init failed\n"); 
		outb(Cmd, 0xA8); 
	 
		/* make mouse streaming, enabled */ 
		if(mousecmd(0xEA) < 0 
		|| mousecmd(0xF4) < 0) 
			print("can't initialize mouse\n"); 
		break; 
	case At: 
		/* enable kbd xfers and interrupts */ 
		outb(Cmd, 0x60); 
		if(outready() < 0) 
			print("kbd init failed\n"); 
		outb(Data, 0x65); 
		break; 
	} 
1991/0731    
} 
1991/0730    
 
1991/0731    
/* 


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