*BSD News Article 4108


Return to BSD News archive

Newsgroups: comp.unix.bsd
Path: sserve!manuel!munnari.oz.au!bruce.cs.monash.edu.au!andrewh
From: andrewh@cs.monash.edu.au (Andrew Herbert)
Subject: 386bsd cpu_reset() code - ideas?
Message-ID: <andrewh.714725683@bruce.cs.monash.edu.au>
Sender: news@bruce.cs.monash.edu.au (USENET News System)
Organization: Computer Science, Monash University, Australia
Date: Tue, 25 Aug 1992 06:54:43 GMT
Lines: 37

The standard cpu_reset() in i386/i386/vm_machdep.c doesn't work on my Micronics
i486/33-EISA system (it just hangs the system), so I've been trying to get
this function to use the keyboard controller reboot trick.  It ain't working
though. :-(

Can anyone suggest where I'm going astray?  The machine hangs after displaying
the expected diagnostics from cpu_reset().

cpu_reset() {
	int     i;
	extern caddr_t  vmmap;
	extern unsigned kbd_cmd();      /* defined in i386/isa/pccons.c */

	printf("mapping RAM page zero\n");
	pmap_enter(pmap_kernel(), vmmap, (vm_offset_t)0, VM_PROT_WRITE, TRUE);

	printf("writing RAM magic numbers\n");
	/* write to physical addr 0x467 and 0x472 (see pmap.c) */
	*((unsigned *)vmmap + 0x467) = 0xf000fff0;
	*((unsigned short *)vmmap + 0x472) = 0x1234;

	printf("setting cmos ram flag\n");
	outb(0x70, 0x8f);       /* write CMOS addr 8F */
	outb(0x71, 0x5);        /* write CMOS data 5 */

	printf("asking keyboard controller to reset CPU\n");
	/* tell keyboard controller to reset the CPU */
	kbd_cmd(0xfe);

	printf("halting\n");
	__asm__("cli; hlt");
}

thanks,
Andrew

andrewh@molly.cs.monash.edu.au