projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
First stab at interrupt-driven serial.
[pintos-anon]
/
src
/
lib
/
kernel
/
printf.c
diff --git
a/src/lib/kernel/printf.c
b/src/lib/kernel/printf.c
index 886706c8091223b50ba901a252630803f593e2c3..c139966f98c358c8804f3c67ce586d49d1286adb 100644
(file)
--- a/
src/lib/kernel/printf.c
+++ b/
src/lib/kernel/printf.c
@@
-1,12
+1,14
@@
#include <stdarg.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdio.h>
-
#include "devices/serial.h"
#include "devices/vga.h"
#include "threads/interrupt.h"
static void vprintf_helper (char, void *);
#include "devices/serial.h"
#include "devices/vga.h"
#include "threads/interrupt.h"
static void vprintf_helper (char, void *);
+/* The standard vprintf() function,
+ which is like printf() but uses a va_list.
+ Writes its output to both vga display and serial port. */
int
vprintf (const char *format, va_list args)
{
int
vprintf (const char *format, va_list args)
{
@@
-29,11
+31,11
@@
vprintf_helper (char c, void *char_cnt_)
putchar (c);
}
putchar (c);
}
-/* Writes C to the
console
. */
+/* Writes C to the
vga display and serial port
. */
int
putchar (int c)
{
int
putchar (int c)
{
- serial_
outb
(c);
+ serial_
putc
(c);
vga_putc (c);
return c;
}
vga_putc (c);
return c;
}