X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdevices%2Fvga.c;fp=src%2Fdevices%2Fvga.c;h=8ab08f6fa821649799d982bda991625847164500;hb=a0470f561bcaa4de8ca4a85ceb5ebe58495bdeeb;hp=bc2d6b72bd561321b16f2c8a877c397c4d7a2a26;hpb=208fb587faa75eaa0e740db9b605ff3d7ba24905;p=pintos-anon diff --git a/src/devices/vga.c b/src/devices/vga.c index bc2d6b7..8ab08f6 100644 --- a/src/devices/vga.c +++ b/src/devices/vga.c @@ -5,6 +5,7 @@ #include #include "threads/io.h" #include "threads/mmu.h" +#include "threads/interrupt.h" /* VGA text screen support. See [FREEVGA] for more information. */ @@ -38,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': @@ -77,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. */