X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdevices%2Fvga.c;h=949dd975eaec8da2ae0e34551b7ca23765a14792;hb=c27bbbdb32640ba99c35e417f5ae7c0377f747f0;hp=fcdc689e9a1dc6dd8e0dab5d11394a8596f58b78;hpb=f6580e9ad405b519dbe85027691bf3c66074b0a4;p=pintos-anon diff --git a/src/devices/vga.c b/src/devices/vga.c index fcdc689..949dd97 100644 --- a/src/devices/vga.c +++ b/src/devices/vga.c @@ -1,9 +1,11 @@ -#include "vga.h" +#include "devices/vga.h" +#include #include #include -#include "lib/lib.h" +#include #include "threads/io.h" -#include "threads/mmu.h" +#include "threads/interrupt.h" +#include "threads/vaddr.h" /* VGA text screen support. See [FREEVGA] for more information. */ @@ -37,10 +39,14 @@ vga_init (void) } /* Writes C to the VGA text display, interpreting control - characters in the conventional ways. */ + characters in the conventional ways. */ void vga_putc (int c) { + /* Disable interrupts to lock out interrupt handlers + that might write to the console. */ + enum intr_level old_level = intr_disable (); + switch (c) { case '\n': @@ -76,6 +82,8 @@ vga_putc (int c) /* Update cursor position. */ move_cursor (); + + intr_set_level (old_level); } /* Clears the screen and moves the cursor to the upper left. */