diff options
| author | Ian McFarlane <i.mcfarlane2002@gmail.com> | 2025-04-17 14:19:40 -0400 |
|---|---|---|
| committer | Ian McFarlane <i.mcfarlane2002@gmail.com> | 2025-04-17 14:19:40 -0400 |
| commit | 7108e7c951f7cff79ce4992f1c7d8d0af0bb5af6 (patch) | |
| tree | e99684b87952bded5e51c83848a5d35ab53d9ab0 /kernel/mboot/mboot.c | |
| parent | starting on ata (diff) | |
| parent | clang 18 in flake instead of zig (diff) | |
| download | comus-7108e7c951f7cff79ce4992f1c7d8d0af0bb5af6.tar.gz comus-7108e7c951f7cff79ce4992f1c7d8d0af0bb5af6.tar.bz2 comus-7108e7c951f7cff79ce4992f1c7d8d0af0bb5af6.zip | |
Merge branch 'main' into ata
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) { |