aboutsummaryrefslogtreecommitdiff
path: root/kernel/inc/drivers/mbr.h
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/inc/drivers/mbr.h
parentb22346a9b830b642e684e13cf4946d8ef8d8e1ca (diff)
Major restructuring
Diffstat (limited to 'kernel/inc/drivers/mbr.h')
-rw-r--r--kernel/inc/drivers/mbr.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/kernel/inc/drivers/mbr.h b/kernel/inc/drivers/mbr.h
new file mode 100644
index 0000000..07f6da0
--- /dev/null
+++ b/kernel/inc/drivers/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