printf: also write on serial
This commit is contained in:
parent
ca22696b29
commit
389452ec3f
|
@ -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)
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
|
|
10
tests/test.c
10
tests/test.c
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue