X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pintos-anon;a=blobdiff_plain;f=src%2Fdevices%2Fkbd.c;h=1aa71f5a3062c1888b3d3342d9a2d6675765b4e6;hp=4d7dfdf1a315df6cd3b92564c2719bc815d694de;hb=cc5c971c3cc498d528a2f74f4dc2f8e27a690311;hpb=500278652b3d3ec6ba08c150e749b65ca4a5d208 diff --git a/src/devices/kbd.c b/src/devices/kbd.c index 4d7dfdf..1aa71f5 100644 --- a/src/devices/kbd.c +++ b/src/devices/kbd.c @@ -4,6 +4,7 @@ #include #include #include "devices/input.h" +#include "threads/init.h" #include "threads/interrupt.h" #include "threads/io.h" @@ -53,7 +54,7 @@ struct keymap that we handle elsewhere. */ static const struct keymap invariant_keymap[] = { - {0x01, "\033"}, + {0x01, "\033"}, /* Escape. */ {0x0e, "\b"}, {0x0f, "\tQWERTYUIOP"}, {0x1c, "\r"}, @@ -61,6 +62,7 @@ static const struct keymap invariant_keymap[] = {0x2c, "ZXCVBNM"}, {0x37, "*"}, {0x39, " "}, + {0x53, "\177"}, /* Delete. */ {0, NULL}, }; @@ -131,6 +133,10 @@ keyboard_interrupt (struct intr_frame *args UNUSED) /* Ordinary character. */ if (!release) { + /* Reboot if Ctrl+Alt+Del pressed. */ + if (c == 0177 && ctrl && alt) + reboot (); + /* Handle Ctrl, Shift. Note that Ctrl overrides Shift. */ if (ctrl && c >= 0x40 && c < 0x60)