Date: Tue, 31 Mar 2015 00:45:17 +0800 From: Marcelo Araujo <araujobsdport@gmail.com> To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com> Cc: freebsd-xen@freebsd.org Subject: Re: Unable to load multiboot kernel. Message-ID: <CAOfEmZh9ypr6qM4RqmxAZvghmOtUR=uoAHkWjMCOzeNmuZJTOg@mail.gmail.com> In-Reply-To: <55196D2F.8040203@citrix.com> References: <CAOfEmZgT9nyJfEe5Z39qT9OSWkAa9RVY4xs0b4CjqN=3JJUU1A@mail.gmail.com> <55196D2F.8040203@citrix.com>
next in thread | previous in thread | raw e-mail | index | archive | help
2015-03-30 23:35 GMT+08:00 Roger Pau Monn=C3=A9 <roger.pau@citrix.com>: > Hello, > > El 30/03/15 a les 16.27, Marcelo Araujo ha escrit: > > Hi guys, > > > > I'm attempting to boot FreeBSD as Dom0 on ThinkPad E550 with an i7-5500= U > > quad-core and 16G of ram. > > > > The FreeBSD is in the revision r280848 and Xen is the > 4.6-unstable(checkout > > today). The FreeBSD kernel was built as amd64. > > > > So, the problem that I'm facing is that not possible to load multiboot > > kernel. Right after to load the XEN kernel, its attempt to load the ne= xt > > KERNEL, but I reach out at: > > sys/boot/i386/libi386/multiboot.c > > 167 error =3D elf32_loadfile_raw(filename, dest, result, 1); > > 168 if (error !=3D 0) { > > 169 printf( > > 170 "elf32_loadfile_raw failed: %d unable to load multiboot > > kernel\n", > > 171 error); > > 172 goto out; > > 173 } > > > > I tried to boot at loader using: > > OK unload OK load /boot/xen dom0_mem=3D1024M dom0_max_vcpus=3D2 dom0pvh= =3D1 > > console=3Dcom1,vga > > boot/xen data=3D0x1e0090+0x7fd20f70 \ > > OK load /boot/kernel/kernel > > /boot/kernel/kernel Unable to load /boot/kernel/kernel as a multiboot > > payload kernel > > /boot/kernel/kernel text=3D0x104c6a8 data=3D0x12dbb8+0x3fb0f0 > > sysms=3D[0x8+0x148f98+0x8+0x164832] > > OK boot > > > > And the system is halted. > > > > Any idea? > > That's something new, I've never seen this before. IMHO it seems like > arch_readin is failing to load the kernel into memory, but due to the > lack of messages I'm not sure. Could you try the patch above? It should > make the errors a little bit more chatty. > > Roger. > > diff --git a/sys/boot/common/module.c b/sys/boot/common/module.c > index b48b493..53ce358 100644 > --- a/sys/boot/common/module.c > +++ b/sys/boot/common/module.c > @@ -380,6 +380,7 @@ file_loadraw(char *name, char *type, int insert) > > /* We can't load first */ > if ((file_findfile(NULL, NULL)) =3D=3D NULL) { > + printf("Can not load a raw file without a kernel\n"); > command_errmsg =3D "can't load file before kernel"; > return(NULL); > } > @@ -387,12 +388,14 @@ file_loadraw(char *name, char *type, int insert) > /* locate the file on the load path */ > cp =3D file_search(name, NULL); > if (cp =3D=3D NULL) { > + printf("Cannot find %s file\n", name); > sprintf(command_errbuf, "can't find '%s'", name); > return(NULL); > } > name =3D cp; > > if ((fd =3D open(name, O_RDONLY)) < 0) { > + printf("can't open '%s': %s", name, strerror(errno)); > sprintf(command_errbuf, "can't open '%s': %s", name, > strerror(errno)); > free(name); > return(NULL); > @@ -404,6 +407,7 @@ file_loadraw(char *name, char *type, int insert) > printf("%s ", name); > > laddr =3D loadaddr; > + printf("Trying to load a RAW file at 0x%lx ", laddr); > for (;;) { > /* read in 4k chunks; size is not really important */ > got =3D archsw.arch_readin(fd, laddr, 4096); > @@ -411,6 +415,7 @@ file_loadraw(char *name, char *type, int insert) > break; > if (got < 0) { /* error */ > sprintf(command_errbuf, "error reading '%s': %s", name, > strerror(errno)); > + printf("Error reading %s: %s\n", name, strerror(errno)); > free(name); > close(fd); > return(NULL); > diff --git a/sys/boot/i386/libi386/multiboot.c > b/sys/boot/i386/libi386/multiboot.c > index 11c35df..a3f3084 100644 > --- a/sys/boot/i386/libi386/multiboot.c > +++ b/sys/boot/i386/libi386/multiboot.c > @@ -373,7 +373,7 @@ multiboot_obj_loadfile(char *filename, u_int64_t dest= , > printf( > "Unable to load %s as a multiboot payload > kernel\n", > filename); > - return (EFTYPE); > + return (EINVAL); > } > > /* Load kernel metadata... */ > @@ -382,7 +382,7 @@ multiboot_obj_loadfile(char *filename, u_int64_t dest= , > if (error) { > printf("Unable to load kernel %s metadata error: > %d\n", > rfp->f_name, error); > - return (EFTYPE); > + return (EINVAL); > } > > /* > > > Hello Roger, Thanks for the prompt reply and for the patch. I made a test and now we have a bit more of information. Seems the problem is because the kernel is too large. OK load /boot/kernel/kernel /boot/kernel/kernel Trying to load a RAW file at 0x80001000 Error reading /boot/kernel/kernel: file too large Unable to load /boot/kernel/kernel as a multiboot payload kernel can't load file '/boot/kernel/kernel': invalid argument. Here is the size of my kernel: root@e550:/usr/src/sys/boot # du /boot/kernel/kernel 12885 /boot/kernel/kernel Best Regards, --=20 --=20 Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org <http://www.freebsd.org/> \/ \ ^ Power To Server. .\. /_)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOfEmZh9ypr6qM4RqmxAZvghmOtUR=uoAHkWjMCOzeNmuZJTOg>