1
0
Fork 0
mirror of https://github.com/tailix/kernel.git synced 2025-02-24 15:55:41 -05:00

Verify Multiboot 2 does give us memory map

This commit is contained in:
Alex Kotov 2020-11-27 00:04:38 +05:00
parent 15c3269c38
commit de9fe77c3b
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08

View file

@ -37,6 +37,12 @@ void main(unsigned long multiboot_magic, unsigned long multiboot_info_base)
panic("Can not parse Multiboot 2 info.");
}
const unsigned long multiboot_flags = *(unsigned long*)multiboot_info_base;
if (!(multiboot_flags & (1 << 6))) {
panic("Multiboot 2 doesn't give us memory map.");
}
kinfo.kernel_offset = (unsigned long)&_kernel_offset;
kinfo.kernel_size = (unsigned long)&_kernel_size;