summaryrefslogtreecommitdiff
path: root/kern
diff options
context:
space:
mode:
authorLuca Dariz <luca.dariz@gmail.com>2022-02-05 18:51:25 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-08-27 20:32:01 +0200
commit6c3c3c7a2e633e4dedd1701e6e2134f223b38574 (patch)
tree26096c259ae6de6c6bdd2b003cd7f97f67f8104b /kern
parentc442d1a656e16d12cefe2d3e9b57f764ca4bc755 (diff)
cleanup multiboot
* use _raw_ structs where we refer to the bootloader-provided data * remove unused structures * fix 64 bit boot Signed-off-by: Luca Dariz <luca@orpolo.org> Message-Id: <20220205175129.309469-3-luca@orpolo.org>
Diffstat (limited to 'kern')
-rw-r--r--kern/bootstrap.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/kern/bootstrap.c b/kern/bootstrap.c
index 60e1ad58..60648c9d 100644
--- a/kern/bootstrap.c
+++ b/kern/bootstrap.c
@@ -70,7 +70,7 @@
#include <mach/xen.h>
extern struct start_info boot_info; /* XXX put this in a header! */
#else /* MACH_XEN */
-extern struct multiboot_info boot_info; /* XXX put this in a header! */
+extern struct multiboot_raw_info boot_info; /* XXX put this in a header! */
#endif /* MACH_XEN */
#endif
@@ -155,9 +155,25 @@ void bootstrap_create(void)
boot_info.mods_count = n;
boot_info.flags |= MULTIBOOT_MODS;
#else /* MACH_XEN */
+#ifdef __x86_64__
+ struct multiboot_raw_module *bmods32 = ((struct multiboot_raw_module *)
+ phystokv(boot_info.mods_addr));
+ struct multiboot_module *bmods=NULL;
+ if (bmods32)
+ {
+ int i;
+ bmods = alloca(boot_info.mods_count * sizeof(*bmods));
+ for (i=0; i<boot_info.mods_count; i++)
+ {
+ bmods[i].mod_start = bmods32[i].mod_start;
+ bmods[i].mod_end = bmods32[i].mod_end;
+ bmods[i].string = bmods32[i].string;
+ }
+ }
+#else
struct multiboot_module *bmods = ((struct multiboot_module *)
phystokv(boot_info.mods_addr));
-
+#endif
#endif /* MACH_XEN */
if (!(boot_info.flags & MULTIBOOT_MODS)
|| (boot_info.mods_count == 0))