aboutsummaryrefslogtreecommitdiff
path: root/src/output.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2008-02-25 22:30:47 -0500
committerKevin O'Connor <kevin@koconnor.net>2008-02-25 22:30:47 -0500
commit38fcbfeebc7ce9c1aa940c1b98f6141f161a6ff4 (patch)
tree31ca1bb3a2f9a8d44695df13a183d01ca87abe3e /src/output.c
parent4b60c000deee2002ba272b45a1121df7495c39f9 (diff)
downloadseabios-hppa-38fcbfeebc7ce9c1aa940c1b98f6141f161a6ff4.zip
seabios-hppa-38fcbfeebc7ce9c1aa940c1b98f6141f161a6ff4.tar.gz
seabios-hppa-38fcbfeebc7ce9c1aa940c1b98f6141f161a6ff4.tar.bz2
Version 0.1.2rel-0.1.2
Diffstat (limited to 'src/output.c')
-rw-r--r--src/output.c38
1 files changed, 29 insertions, 9 deletions
diff --git a/src/output.c b/src/output.c
index efb6411..6c7f719 100644
--- a/src/output.c
+++ b/src/output.c
@@ -11,9 +11,13 @@
#include "biosvar.h" // struct bregs
static void
-screenc(char c)
+screenc(u8 c)
{
- // XXX
+ struct bregs br;
+ memset(&br, 0, sizeof(br));
+ br.ah = 0x0e;
+ br.al = c;
+ call16_int(0x10, &br);
}
// XXX
@@ -23,8 +27,12 @@ screenc(char c)
static void
putc(u16 action, char c)
{
- screenc(c);
outb(c, PORT_DEBUG);
+ if (action) {
+ if (c == '\n')
+ screenc('\r');
+ screenc(c);
+ }
}
// Write a string to the framebuffer.
@@ -140,13 +148,27 @@ bprintf(u16 action, const char *fmt, ...)
va_end(args);
}
+static void
+dump_regs(const char *fname, const char *type, struct bregs *regs)
+{
+ if (!regs) {
+ bprintf(0, "%s %s: NULL\n", type, fname);
+ return;
+ }
+ bprintf(0, "%s %s: a=%x b=%x c=%x d=%x si=%x di=%x\n"
+ , type, fname, regs->eax, regs->ebx, regs->ecx, regs->edx
+ , regs->esi, regs->edi);
+ bprintf(0, " ds=%x es=%x bp=%x sp=%x ip=%x cs=%x f=%x\n"
+ , regs->ds, regs->es, regs->ebp, regs->esp
+ , regs->ip, regs->cs, regs->flags);
+}
+
// Function called on handler startup.
void
__debug_enter(const char *fname, struct bregs *regs)
{
- bprintf(0, "enter %s: a=%x b=%x c=%x d=%x si=%x di=%x\n"
- , fname, regs->eax, regs->ebx, regs->ecx, regs->edx
- , regs->esi, regs->edi);
+ // XXX - implement run time suppression test
+ dump_regs(fname, "enter", regs);
}
void
@@ -154,7 +176,5 @@ __debug_exit(const char *fname, struct bregs *regs)
{
if (! (regs->flags & F_CF))
return;
- bprintf(0, "exit %s: a=%x b=%x c=%x d=%x s=%x i=%x\n"
- , fname, regs->eax, regs->ebx, regs->ecx, regs->edx
- , regs->esi, regs->edi);
+ dump_regs(fname, "exit", regs);
}