diff options
author | Freya Murphy <freya@freyacat.org> | 2025-04-17 13:44:55 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2025-04-17 14:10:42 -0400 |
commit | f8529d09bf1555c2dda61f5841b7ad4f42ce9715 (patch) | |
tree | 16e0cdede45741e945e663f72697665074b2b077 /kernel/mboot/mboot.c | |
parent | fmt (diff) | |
download | comus-f8529d09bf1555c2dda61f5841b7ad4f42ce9715.tar.gz comus-f8529d09bf1555c2dda61f5841b7ad4f42ce9715.tar.bz2 comus-f8529d09bf1555c2dda61f5841b7ad4f42ce9715.zip |
elf sym loading
Diffstat (limited to 'kernel/mboot/mboot.c')
-rw-r--r-- | kernel/mboot/mboot.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/mboot/mboot.c b/kernel/mboot/mboot.c index e10f33c..949337d 100644 --- a/kernel/mboot/mboot.c +++ b/kernel/mboot/mboot.c @@ -3,7 +3,7 @@ #include "mboot.h" -static volatile void *mboot; +static volatile void *mboot = NULL; void mboot_init(long magic, volatile void *ptr) { @@ -14,9 +14,12 @@ void mboot_init(long magic, volatile void *ptr) void *locate_mboot_table(uint32_t type) { + if (mboot == NULL) + return NULL; + struct multiboot *info = (struct multiboot *)mboot; - const char *mboot_end = ((char *)info) + info->total_size; + const char *mboot_end = ((char *)info) + info->total_size; char *tag_ptr = info->tags; while (tag_ptr < mboot_end) { |