[haiku-commits] r39492 - haiku/trunk/src/system/boot/platform/atari_m68k

  • From: revol@xxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 19 Nov 2010 09:55:16 +0100 (CET)

Author: mmu_man
Date: 2010-11-19 09:55:15 +0100 (Fri, 19 Nov 2010)
New Revision: 39492
Changeset: http://dev.haiku-os.org/changeset/39492

Modified:
   haiku/trunk/src/system/boot/platform/atari_m68k/devices.cpp
Log:
When the boot drive API & id is not known, try to determine the id via natfeat. 
XXX not sure which API it refers too.


Modified: haiku/trunk/src/system/boot/platform/atari_m68k/devices.cpp
===================================================================
--- haiku/trunk/src/system/boot/platform/atari_m68k/devices.cpp 2010-11-19 
08:51:59 UTC (rev 39491)
+++ haiku/trunk/src/system/boot/platform/atari_m68k/devices.cpp 2010-11-19 
08:55:15 UTC (rev 39492)
@@ -1131,7 +1131,7 @@
 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 @@
                        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;
        }


Other related posts:

  • » [haiku-commits] r39492 - haiku/trunk/src/system/boot/platform/atari_m68k - revol