summaryrefslogtreecommitdiffstats
path: root/sys/boot
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2010-09-17 22:59:15 +0000
committerpjd <pjd@FreeBSD.org>2010-09-17 22:59:15 +0000
commite5db2f99cc740c8d3705d49f5b6eee2aedbf2d47 (patch)
tree2190a9a714953bdf4ab0d5d1b56558e74d0f7e15 /sys/boot
parent1fabf17c4cabea3da89bdfc1f25b070fcb6de575 (diff)
downloadFreeBSD-src-e5db2f99cc740c8d3705d49f5b6eee2aedbf2d47.zip
FreeBSD-src-e5db2f99cc740c8d3705d49f5b6eee2aedbf2d47.tar.gz
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.
Diffstat (limited to 'sys/boot')
-rw-r--r--sys/boot/i386/libi386/biosdisk.c4
-rw-r--r--sys/boot/i386/zfsboot/zfsboot.c9
2 files changed, 10 insertions, 3 deletions
diff --git a/sys/boot/i386/libi386/biosdisk.c b/sys/boot/i386/libi386/biosdisk.c
index cf0b033..a67a7ef 100644
--- a/sys/boot/i386/libi386/biosdisk.c
+++ b/sys/boot/i386/libi386/biosdisk.c
@@ -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;
diff --git a/sys/boot/i386/zfsboot/zfsboot.c b/sys/boot/i386/zfsboot/zfsboot.c
index b6e5f0c..c6ef699 100644
--- a/sys/boot/i386/zfsboot/zfsboot.c
+++ b/sys/boot/i386/zfsboot/zfsboot.c
@@ -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;
OpenPOWER on IntegriCloud