summaryrefslogtreecommitdiff
path: root/src/arch/amd64/mboot.h
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2024-01-27 03:01:43 -0500
committerFreya Murphy <freya@freyacat.org>2024-01-27 03:02:02 -0500
commit481b4e303ab578171114d5e09bb9daff4c4e1d1a (patch)
treee968fde035447f869a05781e1d578fca0427ecc9 /src/arch/amd64/mboot.h
parentupdate libs (diff)
downloadcorn-481b4e303ab578171114d5e09bb9daff4c4e1d1a.tar.gz
corn-481b4e303ab578171114d5e09bb9daff4c4e1d1a.tar.bz2
corn-481b4e303ab578171114d5e09bb9daff4c4e1d1a.zip
mboot parsing
Diffstat (limited to '')
-rw-r--r--src/arch/amd64/mboot.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/arch/amd64/mboot.h b/src/arch/amd64/mboot.h
new file mode 100644
index 0000000..88348f5
--- /dev/null
+++ b/src/arch/amd64/mboot.h
@@ -0,0 +1,40 @@
+#pragma once
+
+#include <stdint.h>
+
+#define CMDLINE_MAX 32
+
+struct mboot_tag {
+ uint8_t valid; // if the tag at this location is set
+ uint32_t type;
+ uint32_t size;
+ union {
+ char cmdline[CMDLINE_MAX + 1];
+ void *rootsdp;
+ } data;
+};
+
+enum mboot_tag_type {
+ MBOOT_CMDLINE = 0,
+ MBOOT_XSDP = 14
+};
+
+struct mboot_info {
+ uint32_t total_size;
+ uint32_t reserved;
+ struct mboot_tag tags[21];
+};
+
+/**
+ * Loads the multi boot information
+ * @param mboot_info - the pointer passed from multiboot2
+ */
+struct mboot_info mboot_load_info(void *mboot_info);
+
+/**
+ * Gets a tag from multiboot
+ * @param type - the tag type
+ * @returns NULL - tag not loaded
+ * @returns tag - tag was loaded
+ */
+struct mboot_tag *mboot_get_tag(struct mboot_info *info, enum mboot_tag_type type);