X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Fkeyboard.c;h=c5b528100f1070c9035fc08ccbd20c0da1cf386e;hb=9452a96dc7cfcadaa81a32a36acc1a95bc1844db;hp=f0d0c3ad9924bd79ce14b81399070d22bf578c45;hpb=4d2f332f7cc62ee71669fceab8f3632859d9cac2;p=palacios.git diff --git a/palacios/src/devices/keyboard.c b/palacios/src/devices/keyboard.c index f0d0c3a..c5b5281 100644 --- a/palacios/src/devices/keyboard.c +++ b/palacios/src/devices/keyboard.c @@ -28,7 +28,6 @@ #include #include - #ifndef V3_CONFIG_DEBUG_KEYBOARD #undef PrintDebug #define PrintDebug(fmt, args...) @@ -813,7 +812,7 @@ static int keyboard_write_command(struct guest_info * core, ushort_t port, void case 0xf2: // instead of what is currently in output_byte (I think) case 0xf3: // main effect is taht if bit zero is zero case 0xf4: // should cause reset - case 0xf5: // I doubt anything more recent than a 286 running OS2 with the penalty box will care + case 0xf5: case 0xf6: case 0xf7: case 0xf8: @@ -824,7 +823,14 @@ static int keyboard_write_command(struct guest_info * core, ushort_t port, void case 0xfd: case 0xfe: case 0xff: - PrintDebug(core->vm_info, core, "keyboard: ignoring command 0x%x on output port\n", cmd); + if (!(cmd & 0x1)) { + // general purpose reset + PrintDebug(core->vm_info, core, "keyboard: reseting VM\n"); + v3_reset_vm(core->vm_info); + + } else { + PrintDebug(core->vm_info, core, "keyboard: ignoring command 0x%x on output port\n", cmd); + } break; // case ac diagonstic - returns 16 bytes from keyboard microcontroler on 60h @@ -1074,6 +1080,8 @@ static int keyboard_free(struct keyboard_internal * kbd) { // unhook host events + v3_lock_deinit(&(kbd->kb_lock)); + V3_Free(kbd); return 0; }