diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2021-03-20 16:24:14 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2021-03-20 16:24:14 +0200 |
commit | 12302df8b3f59de46f9f20ecae57ccf874d0c867 (patch) | |
tree | c89f806227442014911ddb8e424bbc6248974b11 /src/kernel/multiboot.cc | |
parent | Add quicksort implementation to stdlib (diff) | |
download | kernel.cpp-12302df8b3f59de46f9f20ecae57ccf874d0c867.tar.xz |
Add allocator
Diffstat (limited to 'src/kernel/multiboot.cc')
-rw-r--r-- | src/kernel/multiboot.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/kernel/multiboot.cc b/src/kernel/multiboot.cc new file mode 100644 index 0000000..024916e --- /dev/null +++ b/src/kernel/multiboot.cc @@ -0,0 +1,10 @@ +#include <multiboot2.h> +#include <types.h> + +uint32_t check_multiboot(uint32_t mb_magic, uint32_t mb_addr) { + if (mb_magic != MULTIBOOT2_BOOTLOADER_MAGIC) return 0; + if (mb_addr & 7) return 0; + + const uint32_t size = *reinterpret_cast<uint32_t*>(mb_addr); + return size; +} |