From owner-freebsd-xen@FreeBSD.ORG Mon Mar 30 15:35:43 2015 Return-Path: Delivered-To: freebsd-xen@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5AC42960; Mon, 30 Mar 2015 15:35:43 +0000 (UTC) Received: from SMTP.CITRIX.COM (smtp.citrix.com [66.165.176.89]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "mail.citrix.com", Issuer "Cybertrust Public SureServer SV CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DF9B6251; Mon, 30 Mar 2015 15:35:42 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.11,494,1422921600"; d="scan'208";a="247856988" Message-ID: <55196D2F.8040203@citrix.com> Date: Mon, 30 Mar 2015 17:35:11 +0200 From: =?windows-1252?Q?Roger_Pau_Monn=E9?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: , Subject: Re: Unable to load multiboot kernel. References: In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-DLP: MIA2 X-BeenThere: freebsd-xen@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion of the freebsd port to xen - implementation and usage List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2015 15:35:43 -0000 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-5500U > 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 next > KERNEL, but I reach out at: > sys/boot/i386/libi386/multiboot.c > 167 error = elf32_loadfile_raw(filename, dest, result, 1); > 168 if (error != 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=1024M dom0_max_vcpus=2 dom0pvh=1 > console=com1,vga > boot/xen data=0x1e0090+0x7fd20f70 \ > OK load /boot/kernel/kernel > /boot/kernel/kernel Unable to load /boot/kernel/kernel as a multiboot > payload kernel > /boot/kernel/kernel text=0x104c6a8 data=0x12dbb8+0x3fb0f0 > sysms=[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)) == NULL) { + printf("Can not load a raw file without a kernel\n"); command_errmsg = "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 = file_search(name, NULL); if (cp == NULL) { + printf("Cannot find %s file\n", name); sprintf(command_errbuf, "can't find '%s'", name); return(NULL); } name = cp; if ((fd = 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 = loadaddr; + printf("Trying to load a RAW file at 0x%lx ", laddr); for (;;) { /* read in 4k chunks; size is not really important */ got = 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); } /*