From owner-svn-src-all@FreeBSD.ORG Fri Sep 17 22:59:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D0901065672; Fri, 17 Sep 2010 22:59:16 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D5F368FC0C; Fri, 17 Sep 2010 22:59:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8HMxFs6044496; Fri, 17 Sep 2010 22:59:15 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8HMxFW1044493; Fri, 17 Sep 2010 22:59:15 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201009172259.o8HMxFW1044493@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 17 Sep 2010 22:59:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212805 - in head/sys/boot/i386: libi386 zfsboot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2010 22:59:16 -0000 Author: pjd Date: Fri Sep 17 22:59:15 2010 New Revision: 212805 URL: http://svn.freebsd.org/changeset/base/212805 Log: Before VirtualBox is fixed, mark with #ifdef what has to be done to make it possible to boot from ZFS RAIDZ for example from within VirtualBox. The problem with VirtualBox is that its BIOS reports only one disk present. If we choose to ignore this report, we can find all the disks available. We can't have this work-around to be turned on by default, because some broken BIOSes report true when it comes to number of disks, but present the same disk multiple times. Modified: head/sys/boot/i386/libi386/biosdisk.c head/sys/boot/i386/zfsboot/zfsboot.c Modified: head/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- head/sys/boot/i386/libi386/biosdisk.c Fri Sep 17 22:51:45 2010 (r212804) +++ head/sys/boot/i386/libi386/biosdisk.c Fri Sep 17 22:59:15 2010 (r212805) @@ -214,10 +214,12 @@ bd_init(void) /* sequence 0, 0x80 */ for (base = 0; base <= 0x80; base += 0x80) { for (unit = base; (nbdinfo < MAXBDDEV); unit++) { +#ifndef VIRTUALBOX /* check the BIOS equipment list for number of fixed disks */ if((base == 0x80) && (nfd >= *(unsigned char *)PTOV(BIOS_NUMDRIVES))) - break; + break; +#endif bdinfo[nbdinfo].bd_unit = unit; bdinfo[nbdinfo].bd_flags = (unit < 0x80) ? BD_FLOPPY : 0; Modified: head/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- head/sys/boot/i386/zfsboot/zfsboot.c Fri Sep 17 22:51:45 2010 (r212804) +++ head/sys/boot/i386/zfsboot/zfsboot.c Fri Sep 17 22:59:15 2010 (r212805) @@ -94,7 +94,7 @@ __FBSDID("$FreeBSD$"); #define V86_CY(x) ((x) & 1) #define V86_ZR(x) ((x) & 0x40) -#define BIOS_NUMDRIVES 0x475 +#define BIOS_NUMDRIVES 0x475 #define DRV_HARD 0x80 #define DRV_MASK 0x7f @@ -667,7 +667,12 @@ main(void) * will find any other available pools and it may fill in missing * vdevs for the boot pool. */ - for (i = 0; i < *(unsigned char *)PTOV(BIOS_NUMDRIVES); i++) { +#ifndef VIRTUALBOX + for (i = 0; i < *(unsigned char *)PTOV(BIOS_NUMDRIVES); i++) +#else + for (i = 0; i < MAXBDDEV; i++) +#endif + { if ((i | DRV_HARD) == *(uint8_t *)PTOV(ARGS)) continue;