X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fdevices%2Fkbd.c;h=fcc82bed0680dee0a9b511b9284ec15b7b328b01;hb=53641f9bb07aa127b2b5e402e28b7421ce8a7f3b;hp=4d7dfdf1a315df6cd3b92564c2719bc815d694de;hpb=837e5b7fb902bd749106309ef76a5276c73ca34c;p=pintos-anon diff --git a/src/devices/kbd.c b/src/devices/kbd.c index 4d7dfdf..fcc82be 100644 --- a/src/devices/kbd.c +++ b/src/devices/kbd.c @@ -4,6 +4,7 @@ #include #include #include "devices/input.h" +#include "devices/shutdown.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) + shutdown_reboot (); + /* Handle Ctrl, Shift. Note that Ctrl overrides Shift. */ if (ctrl && c >= 0x40 && c < 0x60)