From 6c3c3c7a2e633e4dedd1701e6e2134f223b38574 Mon Sep 17 00:00:00 2001 From: Luca Dariz Date: Sat, 5 Feb 2022 18:51:25 +0100 Subject: 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 Message-Id: <20220205175129.309469-3-luca@orpolo.org> --- kern/bootstrap.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'kern/bootstrap.c') 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 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