aboutsummaryrefslogtreecommitdiff
path: root/kernel/features
diff options
context:
space:
mode:
authorMarvin Borner2021-05-20 20:41:24 +0200
committerMarvin Borner2021-05-20 20:41:24 +0200
commit298aaf63f15350e6248d5a96e8c6a63b0ec93e0f (patch)
tree952331f841b4d02d0b7189da716648df5cdb4d8e /kernel/features
parentb22346a9b830b642e684e13cf4946d8ef8d8e1ca (diff)
Major restructuring
Diffstat (limited to 'kernel/features')
-rw-r--r--kernel/features/bus.c2
-rw-r--r--kernel/features/fs.c6
-rw-r--r--kernel/features/io.c30
-rw-r--r--kernel/features/load.c2
-rw-r--r--kernel/features/logger.c4
-rw-r--r--kernel/features/mm.c4
-rw-r--r--kernel/features/net.c8
-rw-r--r--kernel/features/proc.c6
-rw-r--r--kernel/features/syscall.c6
9 files changed, 42 insertions, 26 deletions
diff --git a/kernel/features/bus.c b/kernel/features/bus.c
index 4a09fc0..d58cee3 100644
--- a/kernel/features/bus.c
+++ b/kernel/features/bus.c
@@ -2,7 +2,7 @@
#include <assert.h>
#include <bus.h>
-#include <cpu.h>
+#include <drivers/cpu.h>
#include <crypto.h>
#include <def.h>
#include <errno.h>
diff --git a/kernel/features/fs.c b/kernel/features/fs.c
index 7d62c61..c5ebfcd 100644
--- a/kernel/features/fs.c
+++ b/kernel/features/fs.c
@@ -1,13 +1,13 @@
// MIT License, Copyright (c) 2020 Marvin Borner
#include <assert.h>
-#include <cpu.h>
+#include <drivers/cpu.h>
#include <crypto.h>
#include <def.h>
#include <errno.h>
#include <fs.h>
-#include <ide.h>
-#include <mbr.h>
+#include <drivers/ide.h>
+#include <drivers/mbr.h>
#include <mem.h>
#include <mm.h>
#include <print.h>
diff --git a/kernel/features/io.c b/kernel/features/io.c
index bc7977a..4bbc4e0 100644
--- a/kernel/features/io.c
+++ b/kernel/features/io.c
@@ -2,22 +2,23 @@
#include <assert.h>
#include <bus.h>
-#include <cpu.h>
#include <def.h>
-#include <fb.h>
-#include <interrupts.h>
+#include <drivers/cpu.h>
+#include <drivers/interrupts.h>
+#include <drivers/ps2.h>
+#include <drivers/timer.h>
+#include <drivers/vbe.h>
+#include <drivers/vmware.h>
#include <io.h>
#include <list.h>
#include <logger.h>
#include <mem.h>
#include <mm.h>
+#include <multiboot.h>
#include <proc.h>
-#include <ps2.h>
#include <rand.h>
#include <str.h>
#include <syscall.h>
-#include <timer.h>
-#include <vmware.h>
struct io_listener {
u32 group;
@@ -211,6 +212,10 @@ CLEAR void io_install(void)
for (u32 i = 0; i < IO_MAX; i++)
io_listeners[i] = list_new();
+ /**
+ * Keyboard & mouse detection
+ */
+
ps2_detect();
u8 ps2_keyboard = ps2_keyboard_detect();
@@ -226,8 +231,19 @@ CLEAR void io_install(void)
ps2_mouse_install(ps2_mouse);
}
+ /**
+ * Framebuffer detection
+ */
+
+ u32 vbe = multiboot_vbe();
+ if (vbe)
+ vbe_install(vbe);
+
+ /**
+ * Other devices
+ */
+
timer_install();
logger_install();
- fb_install();
bus_install();
}
diff --git a/kernel/features/load.c b/kernel/features/load.c
index 645c4d2..1059240 100644
--- a/kernel/features/load.c
+++ b/kernel/features/load.c
@@ -1,6 +1,6 @@
// MIT License, Copyright (c) 2020 Marvin Borner
-#include <cpu.h>
+#include <drivers/cpu.h>
#include <errno.h>
#include <fs.h>
#include <load.h>
diff --git a/kernel/features/logger.c b/kernel/features/logger.c
index 7db9a82..23efa93 100644
--- a/kernel/features/logger.c
+++ b/kernel/features/logger.c
@@ -1,13 +1,13 @@
// MIT License, Copyright (c) 2021 Marvin Borner
-#include <cpu.h>
+#include <drivers/cpu.h>
#include <def.h>
#include <errno.h>
#include <io.h>
#include <logger.h>
#include <mem.h>
#include <print.h>
-#include <serial.h>
+#include <drivers/serial.h>
static res logger_write(const void *buf, u32 offset, u32 count)
{
diff --git a/kernel/features/mm.c b/kernel/features/mm.c
index 0f80fda..81645af 100644
--- a/kernel/features/mm.c
+++ b/kernel/features/mm.c
@@ -2,10 +2,10 @@
// MIT License, Copyright (c) 2021 Marvin Borner
#include <assert.h>
-#include <cpu.h>
+#include <drivers/cpu.h>
#include <def.h>
#include <errno.h>
-#include <fb.h>
+#include <drivers/vbe.h>
#include <mem.h>
#include <mm.h>
#include <multiboot.h>
diff --git a/kernel/features/net.c b/kernel/features/net.c
index 530837b..9e40ea6 100644
--- a/kernel/features/net.c
+++ b/kernel/features/net.c
@@ -1,18 +1,18 @@
// MIT License, Copyright (c) 2020 Marvin Borner
#include <assert.h>
-#include <cpu.h>
+#include <drivers/cpu.h>
#include <def.h>
#include <list.h>
#include <mem.h>
#include <net.h>
-#include <pci.h>
+#include <drivers/pci.h>
#include <print.h>
#include <rand.h>
-#include <rtl8139.h>
+#include <drivers/rtl8139.h>
#include <socket.h>
#include <str.h>
-#include <timer.h>
+#include <drivers/timer.h>
static u32 current_ip_addr = 0;
static u32 gateway_addr = 0;
diff --git a/kernel/features/proc.c b/kernel/features/proc.c
index 4dd90c8..019b0ed 100644
--- a/kernel/features/proc.c
+++ b/kernel/features/proc.c
@@ -1,10 +1,10 @@
// MIT License, Copyright (c) 2020 Marvin Borner
#include <assert.h>
-#include <cpu.h>
+#include <drivers/cpu.h>
#include <errno.h>
#include <fs.h>
-#include <gdt.h>
+#include <drivers/gdt.h>
#include <load.h>
#include <mem.h>
#include <mm.h>
@@ -12,7 +12,7 @@
#include <proc.h>
#include <stack.h>
#include <str.h>
-#include <timer.h>
+#include <drivers/timer.h>
#define PROC(node) ((struct proc *)node->data)
diff --git a/kernel/features/syscall.c b/kernel/features/syscall.c
index b66cd2e..b376a13 100644
--- a/kernel/features/syscall.c
+++ b/kernel/features/syscall.c
@@ -1,9 +1,9 @@
// MIT License, Copyright (c) 2020 Marvin Borner
-#include <cpu.h>
+#include <drivers/cpu.h>
#include <errno.h>
#include <fs.h>
-#include <interrupts.h>
+#include <drivers/interrupts.h>
#include <io.h>
#include <load.h>
#include <mem.h>
@@ -14,7 +14,7 @@
#include <str.h>
#include <sys.h>
#include <syscall.h>
-#include <timer.h>
+#include <drivers/timer.h>
static void syscall_handler(struct regs *r)
{