Fix RS232_COM0 -> RS232_COM1
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
|
||||
#define RS232_COM0 0x3F8
|
||||
#define RS232_COM1 0x3F8
|
||||
|
||||
void rs232_init(uint16_t port);
|
||||
void rs232_send(uint16_t port, char c);
|
||||
|
||||
@@ -36,12 +36,12 @@ static int rs232_irq(void) {
|
||||
int has_data = 0;
|
||||
uint8_t s;
|
||||
|
||||
while ((s = inb(RS232_COM0 + RS232_LSR)) & RS232_LSR_DR) {
|
||||
while ((s = inb(RS232_COM1 + RS232_LSR)) & RS232_LSR_DR) {
|
||||
has_data = 1;
|
||||
uint8_t c = inb(RS232_COM0);
|
||||
uint8_t c = inb(RS232_COM1);
|
||||
|
||||
// Act as echo for now
|
||||
rs232_send(RS232_COM0, c);
|
||||
rs232_send(RS232_COM1, c);
|
||||
}
|
||||
|
||||
return !has_data;
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ static multiboot_info_t *multiboot_info;
|
||||
void kernel_main(struct amd64_loader_data *data) {
|
||||
// Reinitialize RS232 properly
|
||||
ps2_init();
|
||||
rs232_init(RS232_COM0);
|
||||
rs232_init(RS232_COM1);
|
||||
|
||||
data = (struct amd64_loader_data *) MM_VIRTUALIZE(data);
|
||||
multiboot_info = (multiboot_info_t *) MM_VIRTUALIZE(data->multiboot_info_ptr);
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ void fmtsiz(char *out, size_t sz) {
|
||||
// TODO: make debugc a __weak function of a character
|
||||
void debugc(int level, char c) {
|
||||
#if defined(ARCH_AMD64)
|
||||
rs232_send(RS232_COM0, c);
|
||||
rs232_send(RS232_COM1, c);
|
||||
amd64_con_putc(c);
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user