Index: trunk/i386/libsaio/vbe.c =================================================================== --- trunk/i386/libsaio/vbe.c (revision 2410) +++ trunk/i386/libsaio/vbe.c (revision 2411) @@ -34,7 +34,7 @@ static biosBuf_t bb; //============================================================================== - +#if UNUSED static inline void outi (int port, int index, int val) { @@ -66,7 +66,7 @@ outb (port, index); outb (port + 1, (inb (port + 1) & ~clear) | set); } - +#endif /* UNUSED */ //============================================================================== int getVBEInfo( void * infoBlock ) Index: trunk/i386/libsaio/stringTable.c =================================================================== --- trunk/i386/libsaio/stringTable.c (revision 2410) +++ trunk/i386/libsaio/stringTable.c (revision 2411) @@ -36,6 +36,8 @@ bool sysConfigValid; +#if UNUSED + /* * Compare a string to a key with quoted characters */ @@ -70,8 +72,6 @@ return 0; } -#if UNUSED - static void eatThru(char val, const char **table_p) { register const char *table = *table_p; Index: trunk/i386/libsaio/fake_efi.c =================================================================== --- trunk/i386/libsaio/fake_efi.c (revision 2410) +++ trunk/i386/libsaio/fake_efi.c (revision 2411) @@ -437,7 +437,7 @@ static const char FIRMWARE_REVISION_PROP[] = "firmware-revision"; static const char FIRMWARE_ABI_PROP[] = "firmware-abi"; static const char FIRMWARE_VENDOR_PROP[] = "firmware-vendor"; -static const char FIRMWARE_ABI_32_PROP_VALUE[] = "EFI32"; +//static const char FIRMWARE_ABI_32_PROP_VALUE[] = "EFI32"; static const char FIRMWARE_ABI_64_PROP_VALUE[] = "EFI64"; static const char EFI_MODE_PROP[] = "efi-mode"; //Bungo static const char SYSTEM_ID_PROP[] = "system-id"; Index: trunk/i386/include/sys/socket.h =================================================================== --- trunk/i386/include/sys/socket.h (revision 2410) +++ trunk/i386/include/sys/socket.h (revision 2411) @@ -514,6 +514,7 @@ * peer from lying about its identity. (Note that cmcred_groups[0] * is the effective GID.) */ +#if 0 struct cmsgcred { pid_t cmcred_pid; /* PID of sending process */ uid_t cmcred_uid; /* real UID of sending process */ @@ -523,6 +524,7 @@ gid_t cmcred_groups[CMGROUP_MAX]; /* groups */ }; #endif +#endif #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ /* given pointer to struct cmsghdr, return pointer to data */ Index: trunk/i386/boot2/mboot.c =================================================================== --- trunk/i386/boot2/mboot.c (revision 2410) +++ trunk/i386/boot2/mboot.c (revision 2411) @@ -15,6 +15,8 @@ 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; @@ -61,29 +63,7 @@ // 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) { - 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. + hi_multiboot(multiboot_magic, mi_orig); } void chainLoad() @@ -344,6 +324,31 @@ // Since we call multiboot ourselves, its return address will be correct. // 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; Index: trunk/i386/boot2/modules.c =================================================================== --- trunk/i386/boot2/modules.c (revision 2410) +++ trunk/i386/boot2/modules.c (revision 2411) @@ -105,6 +105,13 @@ long flags; long time; struct dirstuff* moduleDir = opendir("/Extra/modules/"); + + if(!moduleDir) + { + verbose("Warning: Unable to open modules folder at '/Extra/modules/'. Ingoring modules.\n"); + return; + } + while (readdir(moduleDir, (const char**)&name, &flags, &time) >= 0) { if(strcmp(&name[strlen(name) - sizeof("dylib")], ".dylib") == 0) { char* tmp = malloc(strlen(name) + 1); @@ -121,6 +128,7 @@ } } + closedir(moduleDir); } @@ -282,6 +290,11 @@ //DBG("External symbol %s located at 0x%X\n", name, entry->addr); return entry->addr; } + else if(strcmp(entry->symbol, name + 1) == 0 && *name == '_') // Allow _strstr to bing to strstr, etc + { + //DBG("External symbol %s located at 0x%X\n", name, entry->addr); + return entry->addr; + } else { entry = entry->next; Index: trunk/i386/config/confdata.c =================================================================== --- trunk/i386/config/confdata.c (revision 2410) +++ trunk/i386/config/confdata.c (revision 2411) @@ -13,6 +13,18 @@ #include #include +char * +int_stpncpy (dst, src, len) + char *dst; + const char *src; + size_t len; +{ + size_t n = strlen (src); + if (n > len) + n = len; + return strncpy (dst, src, len) + n; +} + #define LKC_DIRECT_LINK #include "lkc.h" @@ -101,7 +113,7 @@ char *name_ptr = name; size_t n = min(res_rem, src - in); - res_ptr = stpncpy(res_ptr, in, n); + res_ptr = int_stpncpy(res_ptr, in, n); if (!(res_rem -= n)) { return res_value; /* buffer full, quit now */ } @@ -118,7 +130,7 @@ symval = sym_get_string_value(sym); n = min(res_rem, strlen(symval)); - res_ptr = stpncpy(res_ptr, symval, n); + res_ptr = int_stpncpy(res_ptr, symval, n); if (!(res_rem -= n)) { return res_value; /* buffer full, quit now */ } Index: trunk/i386/config/textbox.c =================================================================== --- trunk/i386/config/textbox.c (revision 2410) +++ trunk/i386/config/textbox.c (revision 2411) @@ -320,7 +320,6 @@ */ static void print_line(WINDOW * win, int row, int width) { - int y, x; char *line; line = get_line(); @@ -329,9 +328,9 @@ waddch(win, ' '); waddnstr(win, line, MIN(strlen(line), width - 2)); - getyx(win, y, x); /* Clear 'residue' of previous line */ #if OLD_NCURSES + getyx(win, y, x); { int i; for (i = 0; i < width - x; i++) Index: trunk/i386/modules/AcpiCodec/acpi_codec.c =================================================================== --- trunk/i386/modules/AcpiCodec/acpi_codec.c (revision 2410) +++ trunk/i386/modules/AcpiCodec/acpi_codec.c (revision 2411) @@ -196,8 +196,10 @@ return entry; \ } -__RES(pss, long) -__RES(cst, int) +__RES(pss, long) +#if UNUSED + __RES(cst, int) +#endif /* UNUSED */ static ACPI_TABLE_HEADER * get_new_table_in_list(U32 *new_table_list, U32 Signature, U8 *retIndex ) { Index: trunk/CHANGES =================================================================== --- trunk/CHANGES (revision 2410) +++ trunk/CHANGES (revision 2411) @@ -1,3 +1,4 @@ +- Make compile on gcc w/ errors enabled. - Remove the '-x' option from the offending 'ld' command - Makefile dependency missing for boot0 and boot1h - Temp disable klibc module