aboutsummaryrefslogtreecommitdiff
path: root/kernel/inc/mbr.h
diff options
context:
space:
mode:
authorMarvin Borner2021-04-30 15:03:27 +0200
committerMarvin Borner2021-04-30 15:03:27 +0200
commit350748137b62e2aa15c62c53ebf4d30816e441f4 (patch)
treea4c1b1c443c1f0de4bd74336a9ceed9376ce694a /kernel/inc/mbr.h
parent3a3d50d7eb0f4fdbb9beaf16bacfa98689cc448c (diff)
Added MBR driver and better disk creation
Diffstat (limited to 'kernel/inc/mbr.h')
-rw-r--r--kernel/inc/mbr.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/kernel/inc/mbr.h b/kernel/inc/mbr.h
new file mode 100644
index 0000000..07f6da0
--- /dev/null
+++ b/kernel/inc/mbr.h
@@ -0,0 +1,28 @@
+// MIT License, Copyright (c) 2021 Marvin Borner
+
+#ifndef MBR_H
+#define MBR_H
+
+#include <def.h>
+#include <fs.h>
+
+struct mbr_entry {
+ u8 attributes;
+ u8 chs_start[3];
+ u8 type;
+ u8 chs_end[3];
+ u32 start;
+ u32 size;
+} PACKED;
+
+struct mbr {
+ u8 bootstrap[440];
+ u32 signature;
+ u16 reserved;
+ struct mbr_entry entries[4];
+ u16 magic;
+} PACKED;
+
+u8 mbr_load(struct vfs_dev *dev);
+
+#endif