summaryrefslogtreecommitdiffhomepage
path: root/src/loader/disk.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/loader/disk.c')
-rw-r--r--src/loader/disk.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/loader/disk.c b/src/loader/disk.c
new file mode 100644
index 0000000..42ec772
--- /dev/null
+++ b/src/loader/disk.c
@@ -0,0 +1,20 @@
+// MIT License, Copyright (c) 2021 Marvin Borner
+
+#include <disk.h>
+#include <fs/ext2.h>
+#include <log.h>
+#include <mbr.h>
+#include <panic.h>
+
+void disk_detect(struct dev *dev)
+{
+ assert(dev->type == DEVICE_DISK);
+
+ if (mbr_detect(dev))
+ return;
+
+ if (ext2_detect(dev))
+ return;
+
+ log("[DSK] Couldn't detect type of disk %s\n", dev->name);
+}