summaryrefslogtreecommitdiff
path: root/kernel/mboot/mboot.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/mboot/mboot.c')
-rw-r--r--kernel/mboot/mboot.c7
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) {