Index: trunk/i386/boot2/modules.c =================================================================== --- trunk/i386/boot2/modules.c (revision 2157) +++ trunk/i386/boot2/modules.c (revision 2158) @@ -15,10 +15,10 @@ #if CONFIG_MODULE_DEBUG -#define DBG(x...) printf(x); +#define DBG(x...) printf(x) #define DBGPAUSE() getchar() #else -#define DBG(x...) +#define DBG(x...) verbose(x) #define DBGPAUSE() #endif @@ -149,6 +149,12 @@ } unsigned int moduleSize = file_size(fh); + + if(moduleSize == 0) + { + DBG("WARNING: The module %s has a file size of %d, the module will not be loaded.\n", modString, moduleSize); + return 0; + } char* module_base = (char*) malloc(moduleSize); if (moduleSize && read(fh, module_base, moduleSize) == moduleSize) {