summaryrefslogtreecommitdiff
path: root/src/kernel/arch/amd64/driver
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/arch/amd64/driver')
-rw-r--r--src/kernel/arch/amd64/driver/ps2.c8
-rw-r--r--src/kernel/arch/amd64/driver/rtl8139.c2
-rw-r--r--src/kernel/arch/amd64/driver/serial.c4
3 files changed, 11 insertions, 3 deletions
diff --git a/src/kernel/arch/amd64/driver/ps2.c b/src/kernel/arch/amd64/driver/ps2.c
index 971d7d1..4aa17ff 100644
--- a/src/kernel/arch/amd64/driver/ps2.c
+++ b/src/kernel/arch/amd64/driver/ps2.c
@@ -1,7 +1,7 @@
#include <camellia/errno.h>
#include <kernel/arch/amd64/driver/ps2.h>
#include <kernel/arch/amd64/driver/util.h>
-#include <kernel/arch/amd64/interrupts/irq.h>
+#include <kernel/arch/amd64/interrupts.h>
#include <kernel/arch/amd64/port_io.h>
#include <kernel/panic.h>
#include <kernel/proc.h>
@@ -50,8 +50,12 @@ void ps2_init(void) {
wait_out();
port_out8(PS2, 0xF4); /* packet streaming */
wait_in();
- if (port_in8(PS2) != 0xFA) /* check ACK */
+ if (port_in8(PS2) != 0xFA) { /* check ACK */
panic_unimplemented();
+ }
+
+ irq_fn[IRQ_PS2KB] = ps2_irq;
+ irq_fn[IRQ_PS2MOUSE] = ps2_irq;
vfs_root_register("/ps2", accept);
}
diff --git a/src/kernel/arch/amd64/driver/rtl8139.c b/src/kernel/arch/amd64/driver/rtl8139.c
index d0e4d90..bf8a67a 100644
--- a/src/kernel/arch/amd64/driver/rtl8139.c
+++ b/src/kernel/arch/amd64/driver/rtl8139.c
@@ -1,5 +1,6 @@
#include <kernel/arch/amd64/driver/rtl8139.h>
#include <kernel/arch/amd64/driver/util.h>
+#include <kernel/arch/amd64/interrupts.h>
#include <kernel/arch/amd64/pci.h>
#include <kernel/arch/amd64/port_io.h>
#include <kernel/panic.h>
@@ -47,6 +48,7 @@ static void rx_irq_enable(bool v) {
void rtl8139_init(uint32_t bdf) {
if (iobase) panic_unimplemented(); /* multiple devices */
iobase = pcicfg_iobase(bdf);
+ irq_fn[IRQ_RTL8139] = rtl8139_irq;
/* also includes the status, because i have only implemented w32 */
uint32_t cmd = pcicfg_r32(bdf, PCICFG_CMD);
diff --git a/src/kernel/arch/amd64/driver/serial.c b/src/kernel/arch/amd64/driver/serial.c
index 5004c31..e8774b6 100644
--- a/src/kernel/arch/amd64/driver/serial.c
+++ b/src/kernel/arch/amd64/driver/serial.c
@@ -1,6 +1,6 @@
#include <kernel/arch/amd64/driver/serial.h>
#include <kernel/arch/amd64/driver/util.h>
-#include <kernel/arch/amd64/interrupts/irq.h>
+#include <kernel/arch/amd64/interrupts.h>
#include <kernel/arch/amd64/port_io.h>
#include <kernel/panic.h>
#include <kernel/proc.h>
@@ -25,6 +25,8 @@ static void serial_selftest(void) {
}
void serial_preinit(void) {
+ irq_fn[IRQ_COM1] = serial_irq;
+
// see https://www.sci.muni.cz/docs/pc/serport.txt
// set baud rate divisor
port_out8(COM1 + 3, 0b10000000); // enable DLAB