printf: also write on serial

This commit is contained in:
Mathieu Maret 2019-05-17 09:57:14 +02:00
parent ca22696b29
commit 389452ec3f
4 changed files with 10 additions and 8 deletions

View File

@ -1,4 +1,5 @@
#include "klibc.h" #include "klibc.h"
#include "serial.h"
#include "vga.h" #include "vga.h"
int memcmp(const void *aptr, const void *bptr, size_t size) int memcmp(const void *aptr, const void *bptr, size_t size)
@ -116,6 +117,7 @@ void puts(const char *str)
void putc(const char str){ void putc(const char str){
VGAputc(str); VGAputc(str);
serialPutc(str);
} }
void printInt(int integer) void printInt(int integer)

View File

@ -39,7 +39,7 @@ int isTransmitEmpty()
return (inb(PORT + 5) & 0x20); return (inb(PORT + 5) & 0x20);
} }
void serialWrite(char a) void serialPutc(char a)
{ {
while (isTransmitEmpty() == 0) while (isTransmitEmpty() == 0)
; ;
@ -51,5 +51,5 @@ void serialDoIrq(struct interrupt_frame *level)
{ {
(void)level; (void)level;
char c = inb(PORT); char c = inb(PORT);
serialWrite(c); serialPutc(c);
} }

View File

@ -2,5 +2,5 @@
#include "irq.h" #include "irq.h"
void serialSetup(int speed); void serialSetup(int speed);
void serialWrite(char a); void serialPutc(char a);
void serialDoIrq(struct interrupt_frame *frame); void serialDoIrq(struct interrupt_frame *frame);

View File

@ -221,11 +221,11 @@ void run_test(void)
{ {
testPaging(); testPaging();
printf("Testing Serial\n"); printf("Testing Serial\n");
serialWrite('h'); serialPutc('h');
serialWrite('e'); serialPutc('e');
serialWrite('l'); serialPutc('l');
serialWrite('l'); serialPutc('l');
serialWrite('o'); serialPutc('o');
testAlloc(); testAlloc();
printf("Testing backtrace\n"); printf("Testing backtrace\n");
test_backtrace(); test_backtrace();