diff options
Diffstat (limited to 'src/kernel/serial.c')
-rw-r--r-- | src/kernel/serial.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/kernel/serial.c b/src/kernel/serial.c index b88c7ec..0f7abe6 100644 --- a/src/kernel/serial.c +++ b/src/kernel/serial.c @@ -54,7 +54,7 @@ bool serr() { return error; } -void sinit() { +void init_serial() { error = false; outb(CP_1 | CP_INT, 0); outb(CP_1 | CP_LINE, CL_BAUD); @@ -64,7 +64,7 @@ void sinit() { outb(CP_1 | CP_FIFO, 0xc7);//? } -void sout(uint8_t b) { +void sout(char b) { if (error) return; uint16_t s = SERIAL_SPIN_LIMIT; @@ -73,28 +73,28 @@ void sout(uint8_t b) { error = true; return; } - outb(CP_1 | CP_DATA, b); + outb(CP_1 | CP_DATA, (uint8_t)b); } -void soutsz(uint8_t *s) { +void soutsz(char *s) { while (*s) sout(*(s++)); } -void soutsn(uint8_t *s, uint8_t n) { +void soutsn(char *s, uint8_t n) { while (n--) sout(*(s++)); } -uint8_t sin() { +char sin() { if (error) return 0; while (!(inb(CP_1 | CP_LINE_S) & CLS_READ)) ;//spin - return inb(CP_1 | CP_DATA); + return (char)inb(CP_1 | CP_DATA); } -void sinsn(uint8_t *s, uint8_t n) { +void sinsn(char *s, uint8_t n) { while (n--) *(s++) = sin(); }
\ No newline at end of file |