diff options
author | Marvin Borner | 2021-07-06 22:07:04 +0200 |
---|---|---|
committer | Marvin Borner | 2021-07-06 22:07:04 +0200 |
commit | b2880945ae17ad857bd425540acd3dc75b2cff6b (patch) | |
tree | f5dea0028fb5e2b9072aa15f60c497bc7e20d13b /src/loader/inc/impl | |
parent | 23aa6f84539ba320a91235fb81681d0754178f62 (diff) |
Basic multiboot 1 detection and verification
Diffstat (limited to 'src/loader/inc/impl')
-rw-r--r-- | src/loader/inc/impl/all.h | 23 | ||||
-rw-r--r-- | src/loader/inc/impl/mb1.h | 8 |
2 files changed, 26 insertions, 5 deletions
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 <def.h> + +enum impl_type { + IMPL_NONE, + IMPL_MB1, + IMPL_MB2, +}; + +struct impl { + enum impl_type type; + void *start; // Of header/entry +}; + +#include <dev.h> + +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 <def.h> #include <dev.h> -#define MB1_MAGIC 0x1badb002 - -u8 mb1_probe(struct dev *dev); +u8 mb1_detect(struct dev *dev, const char *path); #endif |