projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Minor doc improvements.
[pintos-anon]
/
src
/
devices
/
vga.c
diff --git
a/src/devices/vga.c
b/src/devices/vga.c
index fcdc689e9a1dc6dd8e0dab5d11394a8596f58b78..949dd975eaec8da2ae0e34551b7ca23765a14792 100644
(file)
--- a/
src/devices/vga.c
+++ b/
src/devices/vga.c
@@
-1,9
+1,11
@@
-#include "vga.h"
+#include "devices/vga.h"
+#include <round.h>
#include <stdint.h>
#include <stddef.h>
#include <stdint.h>
#include <stddef.h>
-#include
"lib/lib.h"
+#include
<string.h>
#include "threads/io.h"
#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. */
/* 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
}
/* Writes C to the VGA text display, interpreting control
- characters in the conventional ways. */
+ characters in the conventional ways.
*/
void
vga_putc (int c)
{
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':
switch (c)
{
case '\n':
@@
-76,6
+82,8
@@
vga_putc (int c)
/* Update cursor position. */
move_cursor ();
/* Update cursor position. */
move_cursor ();
+
+ intr_set_level (old_level);
}
\f
/* Clears the screen and moves the cursor to the upper left. */
}
\f
/* Clears the screen and moves the cursor to the upper left. */