From 6874c8813931a8aa6c22773fa7647943f6ebe11c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Fri, 19 Nov 2010 08:55:15 +0000 Subject: [PATCH] When the boot drive API & id is not known, try to determine the id via natfeat. XXX not sure which API it refers too. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39492 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/boot/platform/atari_m68k/devices.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/system/boot/platform/atari_m68k/devices.cpp b/src/system/boot/platform/atari_m68k/devices.cpp index 6cd2004c1c..3ed07b47fc 100644 --- a/src/system/boot/platform/atari_m68k/devices.cpp +++ b/src/system/boot/platform/atari_m68k/devices.cpp @@ -1131,7 +1131,7 @@ XHDIDrive::ReadBlocks(void *buffer, off_t first, int32 count) status_t platform_add_boot_device(struct stage2_args *args, NodeList *devicesList) { - TRACE(("boot drive ID: %x\n", gBootDriveID)); + TRACE(("boot drive ID: %x API: %d\n", gBootDriveID, gBootDriveAPI)); init_xhdi(); //XXX: FIXME @@ -1150,12 +1150,24 @@ platform_add_boot_device(struct stage2_args *args, NodeList *devicesList) drive = new(nothrow) XHDIDrive(gBootDriveID, gBootDriveID, 0); break; case ATARI_BOOT_DRVAPI_UNKNOWN: + { + // we don't know yet, try to ask ARAnyM via NatFeat + int id = nat_feat_get_bootdrive(); + if (id > -1) { + gBootDriveID = id; + dprintf("nat_fead_get_bootdrive() = %d\n", id); + // XXX: which API does it refer to ??? id = letter - 'a' + drive = new(nothrow) XHDIDrive(gBootDriveID, gBootDriveID, 0); + break; + } + } default: dprintf("unknown boot drive API %d\n", gBootDriveAPI); return B_ERROR; drive = new(nothrow) BIOSDrive(gBootDriveID); } - if (drive->InitCheck() != B_OK) { + + if (drive == NULL || drive->InitCheck() != B_OK) { dprintf("no boot drive!\n"); return B_ERROR; }