Index: branches/meklort/i386/libsaio/usb.c =================================================================== --- branches/meklort/i386/libsaio/usb.c (revision 154) +++ branches/meklort/i386/libsaio/usb.c (revision 155) @@ -23,8 +23,6 @@ #endif -#define MAX_USB_DEVS 9 - struct pciList { pci_dt_t* pciDev; Index: branches/meklort/i386/boot2/ramdisk.h =================================================================== --- branches/meklort/i386/boot2/ramdisk.h (revision 154) +++ branches/meklort/i386/boot2/ramdisk.h (revision 155) @@ -8,7 +8,15 @@ #define __BOOT_RAMDISK_H #define RAMDISKCONFIG_FILENAME "rd(0,0)/RAMDisk.plist" +//#define kPostbootRamdisk +void md0Ramdisk(); +typedef struct RAMDiskParam +{ + ppnum_t base; + unsigned int size; +} RAMDiskParam; + /* mboot.c */ extern struct multiboot_info *gMI; extern int multibootRamdiskReadBytes( int biosdev, unsigned int blkno, Index: branches/meklort/i386/boot2/boot.c =================================================================== --- branches/meklort/i386/boot2/boot.c (revision 154) +++ branches/meklort/i386/boot2/boot.c (revision 155) @@ -75,6 +75,8 @@ //int menucount = 0; int gDeviceCount = 0; +bool recoveryMode = false; + BVRef bvr; BVRef menuBVR; BVRef bvChain; Index: branches/meklort/i386/boot2/boot.h =================================================================== --- branches/meklort/i386/boot2/boot.h (revision 154) +++ branches/meklort/i386/boot2/boot.h (revision 155) @@ -92,6 +92,9 @@ #define kScreenWidth "ScreenWidth" /* edid.h */ #define kScreenHeight "ScreenHeight" /* edid.h */ +#define kRecoveryFolder "RecoveryFolder" /* drivers.h */ + + /* * Flags to the booter or kernel */ @@ -139,6 +142,12 @@ extern void common_boot(int biosdev); /* + * usb.c + */ +extern int usb_loop(); + + +/* * graphics.c */ extern void printVBEModeInfo(); Index: branches/meklort/i386/boot2/drivers.c =================================================================== --- branches/meklort/i386/boot2/drivers.c (revision 154) +++ branches/meklort/i386/boot2/drivers.c (revision 155) @@ -41,7 +41,9 @@ #include "kernel_patcher.h" extern char gMacOSVersion; +extern int recoveryMode; + struct Module { struct Module *nextModule; long willLoad; @@ -184,32 +186,55 @@ else if ( gBootFileType == kBlockDeviceType ) { // First try to load Extra extensions from the ramdisk if isn't aliased as bt(0,0). - if (gRAMDiskVolume && !gRAMDiskBTAliased) - { - strcpy(dirSpecExtra, "rd(0,0)/Extra/"); - FileLoadDrivers(dirSpecExtra, 0); - } + if(recoveryMode) + { + verbose("Loading recovery extensions\n"); - // Next try to load Extra extensions from the selected root partition. - strcpy(dirSpecExtra, "/Extra/"); - if (FileLoadDrivers(dirSpecExtra, 0) != 0) - { - // If failed, then try to load Extra extensions from the boot partition - // in case we have a separate booter partition or a bt(0,0) aliased ramdisk. - if ( !(gBIOSBootVolume->biosdev == gBootVolume->biosdev && gBIOSBootVolume->part_no == gBootVolume->part_no) - || (gRAMDiskVolume && gRAMDiskBTAliased) ) - { - // First try a specfic OS version folder ie 10.5 - sprintf(dirSpecExtra, "bt(0,0)/Extra/%s/", &gMacOSVersion); - if (FileLoadDrivers(dirSpecExtra, 0) != 0) - { - // Next we'll try the base - strcpy(dirSpecExtra, "bt(0,0)/Extra/"); - FileLoadDrivers(dirSpecExtra, 0); - } - } - } + const char* recoveryFolder; + int len; + if (getValueForKey(kWakeImage, &recoveryFolder, &len, &bootInfo->bootConfig)) + { + sprintf(dirSpecExtra, "/Extra/%s/", &recoveryFolder); + if(FileLoadDrivers(dirSpecExtra, 0) != 0) + { + verbose("Unable to locate recovery extensions\n"); + } + } + else { + verbose("Unable to locate recovery extensions\n"); + } + } + else + { + if (gRAMDiskVolume && !gRAMDiskBTAliased) + { + strcpy(dirSpecExtra, "rd(0,0)/Extra/"); + FileLoadDrivers(dirSpecExtra, 0); + } + + // Next try to load Extra extensions from the selected root partition. + strcpy(dirSpecExtra, "/Extra/"); + if (FileLoadDrivers(dirSpecExtra, 0) != 0) + { + // If failed, then try to load Extra extensions from the boot partition + // in case we have a separate booter partition or a bt(0,0) aliased ramdisk. + if ( !(gBIOSBootVolume->biosdev == gBootVolume->biosdev && gBIOSBootVolume->part_no == gBootVolume->part_no) + || (gRAMDiskVolume && gRAMDiskBTAliased) ) + { + // First try a specfic OS version folder ie 10.5 + sprintf(dirSpecExtra, "bt(0,0)/Extra/%s/", &gMacOSVersion); + if (FileLoadDrivers(dirSpecExtra, 0) != 0) + { + // Next we'll try the base + strcpy(dirSpecExtra, "bt(0,0)/Extra/"); + FileLoadDrivers(dirSpecExtra, 0); + } + } + } + + } + // Also try to load Extensions from boot helper partitions. strcpy(dirSpecExtra, "/com.apple.boot.P/System/Library/"); if (FileLoadDrivers(dirSpecExtra, 0) != 0) Index: branches/meklort/i386/libsa/memory.h =================================================================== --- branches/meklort/i386/libsa/memory.h (revision 154) +++ branches/meklort/i386/libsa/memory.h (revision 155) @@ -84,10 +84,10 @@ #define VIDEO_ADDR 0x000A0000 // unusable space #define VIDEO_LEN 0x00060000 -#define KERNEL_ADDR 0x00100000 // 64M kernel + drivers -#define KERNEL_LEN 0x04000000 +#define KERNEL_ADDR 0x00100000 // 128M kernel + drivers // Was 64 +#define KERNEL_LEN 0x08000000 -#define ZALLOC_ADDR 0x04100000 // 256M zalloc area +#define ZALLOC_ADDR 0x08100000 // 192M zalloc area // Was 256 #define ZALLOC_LEN 0x10000000 #define LOAD_ADDR 0x14100000 // 95M File load buffer