From: Joshua Wise Date: Fri, 7 Nov 2008 20:08:28 +0000 (-0500) Subject: add serial output to aseg-paging X-Git-Url: http://git.joshuawise.com/netwatch.git/commitdiff_plain/bf47740a3f21a15c662193917bd86cd310af7638 add serial output to aseg-paging --- diff --git a/aseg-paging/Makefile b/aseg-paging/Makefile index ec2474e..a3a52f8 100644 --- a/aseg-paging/Makefile +++ b/aseg-paging/Makefile @@ -6,7 +6,7 @@ CFLAGS=-I../include -I../include/raw \ STUBOBJS=entry.o pagingstub-asm.o pagingstub.o -OBJS=smi.o ../ich2/smi.o ../ich2/smram-ich2.o vga-overlay.o ../pci/pci-raw.o ../lib/minilib.o ../lib/doprnt.o ../lib/sprintf.o ../lib/console.o +OBJS=smi.o ../ich2/smi.o ../ich2/smram-ich2.o vga-overlay.o ../pci/pci-raw.o ../lib/minilib.o ../lib/doprnt.o ../lib/sprintf.o ../lib/console.o ../lib/serial.o all: aseg.elf diff --git a/aseg-paging/firstrun.c b/aseg-paging/firstrun.c index 649583b..97e8692 100644 --- a/aseg-paging/firstrun.c +++ b/aseg-paging/firstrun.c @@ -19,6 +19,7 @@ void __firstrun_start() { smram = smram_save_state(); smram_tseg_set_state(SMRAM_TSEG_OPEN); + serial_init(); /* for (bp = (void *)&_bss; (void *)bp < (void *)&_bssend; bp++) *bp = 0; diff --git a/aseg-paging/vga-overlay.c b/aseg-paging/vga-overlay.c index 4d19c3b..7b33a7b 100644 --- a/aseg-paging/vga-overlay.c +++ b/aseg-paging/vga-overlay.c @@ -4,6 +4,7 @@ #include #include #include +#include #define LOGLEN 96 #define LOG_ONSCREEN 4 @@ -86,6 +87,8 @@ void dolog(const char *s) { strcpy(logents[prodptr], s); prodptr = (prodptr + 1) % LOGLEN; + while (*s) + serial_tx(*s); if (flush_imm) outlog(); } diff --git a/include/serial.h b/include/serial.h new file mode 100644 index 0000000..dcb5921 --- /dev/null +++ b/include/serial.h @@ -0,0 +1,7 @@ +#ifndef SERIAL_H +#define SERIAL_H + +extern void serial_init(); +extern void serial_tx(unsigned char c); + +#endif