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 "serial.h"
#include "vga.h"
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){
VGAputc(str);
serialPutc(str);
}
void printInt(int integer)

View File

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

View File

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

View File

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