summaryrefslogtreecommitdiff
path: root/src/kernel/serial.c
diff options
context:
space:
mode:
authorBenji Dial <Benji3.141@gmail.com>2020-08-11 11:33:21 -0400
committerBenji Dial <Benji3.141@gmail.com>2020-08-11 11:33:21 -0400
commit63167f223e1f54910f6b80e698390ee60aec79ee (patch)
tree41844f646bdcb5c9ba241bb5867c5e4f51737d52 /src/kernel/serial.c
parent77d7a284c02bc6b1b3a3a92ad5d957172cee9b81 (diff)
downloadportland-os-63167f223e1f54910f6b80e698390ee60aec79ee.tar.gz
lots of progress
currently, BAR fields of IDE drives are all returning zero, and the ATA read function isn't working. i'm not sure why. i'm going to work on VESA next, and come back to the IDE driver later
Diffstat (limited to 'src/kernel/serial.c')
-rw-r--r--src/kernel/serial.c16
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