Index: trunk/i386/libsaio/sys.c =================================================================== --- trunk/i386/libsaio/sys.c (revision 2642) +++ trunk/i386/libsaio/sys.c (revision 2643) @@ -72,7 +72,11 @@ static unsigned char kFSUUIDNamespaceSHA1[] = {0xB3,0xE2,0x0F,0x39,0xF2,0x92,0x11,0xD6,0x97,0xA4,0x00,0x30,0x65,0x43,0xEC,0xAC}; #endif -#if DEBUG +#ifndef DEBUG_SYS +#define DEBUG_SYS 0 +#endif + +#if DEBUG_SYS #define DBG(x...) printf(x) #else #define DBG(x...) msglog(x) @@ -999,6 +1003,13 @@ } } +#if 0 + DBG("multiboot_partition_set = %d\n", multiboot_partition_set); + DBG("multiboot_partition = %d\n", multiboot_partition); + DBG("multiboot_skip_partition_set = %d\n", multiboot_skip_partition_set); + DBG("multiboot_skip_partition = %d\n", multiboot_skip_partition); +#endif + /* * Checking "Default Partition" key in system configuration - use format: hd(x,y), the volume UUID or label - * to override the default selection. Index: trunk/i386/boot2/mboot.c =================================================================== --- trunk/i386/boot2/mboot.c (revision 2642) +++ trunk/i386/boot2/mboot.c (revision 2643) @@ -15,8 +15,6 @@ int multiboot_skip_partition=0; int multiboot_skip_partition_set=0; -void boot(int biosdev); - // Global multiboot info, if using multiboot. struct multiboot_info *gMI; @@ -63,7 +61,29 @@ // would be on the stack which would possibly be using way too much stack. void multiboot_to_boot(int multiboot_magic, struct multiboot_info *mi_orig) { - hi_multiboot(multiboot_magic, mi_orig); + uint32_t bootdevice = hi_multiboot(multiboot_magic, mi_orig); + if(bootdevice != BAD_BOOT_DEVICE) + { + // boot only returns to do a chain load. + for(;;) + { // NOTE: boot only uses the last byte (the drive number) + common_boot(bootdevice); + if(chainbootflag) + chainLoad(); + else + waitThenReload(); + } + } + // Avoid returning to high-memory address which isn't valid in the segment + // we are now in. + // Calling sleep() ensures the user ought to be able to use Ctrl+Alt+Del + // because the BIOS will have interrupts on. + for(;;) + sleep(10); + // NOTE: *IF* we needed to return we'd have to fix up our return address to + // be in low memory using the same trick as below. + // However, there doesn't seem to be any point in returning to assembly + // particularly when the remaining code merely halts the processor. } void chainLoad() @@ -325,30 +345,6 @@ // That is unless it's inlined in which case it does not matter. uint32_t bootdevice = multiboot(multiboot_magic, mi_p); - if(bootdevice != BAD_BOOT_DEVICE) - { - // boot only returns to do a chain load. - for(;;) - { // NOTE: boot only uses the last byte (the drive number) - boot(bootdevice); - if(chainbootflag) - chainLoad(); - else - waitThenReload(); - } - } - - // Avoid returning to high-memory address which isn't valid in the segment - // we are now in. - // Calling sleep() ensures the user ought to be able to use Ctrl+Alt+Del - // because the BIOS will have interrupts on. - for(;;) - sleep(10); - // NOTE: *IF* we needed to return we'd have to fix up our return address to - // be in low memory using the same trick as below. - // However, there doesn't seem to be any point in returning to assembly - // particularly when the remaining code merely halts the processor. - // We're about to exit and temporaryBootArgs will no longer be valid bootArgs = NULL; return bootdevice;