X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdevices%2Fvga.c;h=949dd975eaec8da2ae0e34551b7ca23765a14792;hb=f14d80c05e67af1545779f038d9f47dec2188fc3;hp=fdddd91de7b94e062869d416472b373f0a939e8b;hpb=7180597203a54c08582b1bb092dc465ec1d26d7c;p=pintos-anon diff --git a/src/devices/vga.c b/src/devices/vga.c index fdddd91..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 "io.h" -#include "lib.h" -#include "mmu.h" +#include +#include "threads/io.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. */