Exemplo n.º 1
0
void
keyboard_reset (void)
{
	wait_for_kbdsend (false);
	asm_outb (KBD_STATUS, 0x60);
	wait_for_kbdsend (false);
	asm_outb (KBD_DATA, 0x64);
	wait_for_kbdsend (false);
	asm_outb (KBD_DATA, 0xFF);
}
Exemplo n.º 2
0
void
setkbdled (int ledstatus)
{
	u8 gomi;

	wait_for_kbdsend (false);
	asm_outb (KBD_DATA, 0xED);
	wait_for_kbdrecv (true);
	asm_inb (KBD_DATA, &gomi);
	wait_for_kbdsend (false);
	asm_outb (KBD_DATA, ledstatus);
	wait_for_kbdrecv (true);
	asm_inb (KBD_DATA, &gomi);
}
Exemplo n.º 3
0
static void
do_boot_guest (void)
{
	enable = false;
	/* clear screen */
	vramwrite_clearscreen ();
	/* printf ("init pic\n"); */
	asm_outb (0x20, 0x11);
	asm_outb (0x21, 0x8);
	asm_outb (0x21, 0x4);
	asm_outb (0x21, 0x1);
	asm_outb (0xA0, 0x11);
	asm_outb (0xA1, 0x70);
	asm_outb (0xA1, 0x2);
	asm_outb (0xA1, 0x1);
	asm_outb (0x21, 0xFC);
	asm_outb (0xA1, 0xFF);
	/* printf ("init pit\n"); */
	sleep_set_timer_counter ();
	/* printf ("sleep 1 sec\n"); */
	usleep (1000000);
	/* printf ("Starting\n"); */
	reinitialize_vm (true, boot_drive);
}
Exemplo n.º 4
0
static void
vt_panic (void)
{
	ulong cr4;
	u8 port0x92;

	asm_rdcr4 (&cr4);
	if (!(cr4 & CR4_VMXE_BIT))
		return;
	/* enable A20 */
	/* the guest can set or clear A20M# because 
	   A20M# is ignored during VMX operation. however
	   A20M# is used after VMXOFF. */
	asm_inb (0x92, &port0x92);
	port0x92 |= 2;
	asm_outb (0x92, port0x92);
	asm_vmxoff ();
	cr4 &= ~CR4_VMXE_BIT;
	asm_wrcr4 (cr4);
}