Add PC speaker driver and connect it to '\a' in the VGA console.
[pintos-anon] / src / devices / vga.c
index 8255747244e641d599d686fadecb167a9fc6b4f7..f421b617bd3706858d2536eb21866531b1fd9b85 100644 (file)
@@ -3,6 +3,7 @@
 #include <stdint.h>
 #include <stddef.h>
 #include <string.h>
+#include "devices/speaker.h"
 #include "threads/io.h"
 #include "threads/interrupt.h"
 #include "threads/vaddr.h"
@@ -80,6 +81,12 @@ vga_putc (int c)
       if (cx >= COL_CNT)
         newline ();
       break;
+
+    case '\a':
+      intr_set_level (old_level);
+      speaker_beep ();
+      intr_disable ();
+      break;
       
     default:
       fb[cy][cx][0] = c;