From b2880945ae17ad857bd425540acd3dc75b2cff6b Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Tue, 6 Jul 2021 22:07:04 +0200 Subject: Basic multiboot 1 detection and verification --- src/loader/inc/impl/all.h | 23 +++++++++++++++++++++++ src/loader/inc/impl/mb1.h | 8 +++----- 2 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 src/loader/inc/impl/all.h (limited to 'src/loader/inc/impl') diff --git a/src/loader/inc/impl/all.h b/src/loader/inc/impl/all.h new file mode 100644 index 0000000..366b1b3 --- /dev/null +++ b/src/loader/inc/impl/all.h @@ -0,0 +1,23 @@ +// MIT License, Copyright (c) 2021 Marvin Borner + +#ifndef IMPL_ALL_H +#define IMPL_ALL_H + +#include + +enum impl_type { + IMPL_NONE, + IMPL_MB1, + IMPL_MB2, +}; + +struct impl { + enum impl_type type; + void *start; // Of header/entry +}; + +#include + +u8 impl_detect(struct dev *dev, const char *path); + +#endif diff --git a/src/loader/inc/impl/mb1.h b/src/loader/inc/impl/mb1.h index fa0efc1..fcaf048 100644 --- a/src/loader/inc/impl/mb1.h +++ b/src/loader/inc/impl/mb1.h @@ -1,13 +1,11 @@ // MIT License, Copyright (c) 2021 Marvin Borner -#ifndef MB1_H -#define MB1_H +#ifndef IMPL_MB1_H +#define IMPL_MB1_H #include #include -#define MB1_MAGIC 0x1badb002 - -u8 mb1_probe(struct dev *dev); +u8 mb1_detect(struct dev *dev, const char *path); #endif -- cgit v1.2.3