Index: branches/azimutz/Chazileon/doc/BootHelp.txt =================================================================== --- branches/azimutz/Chazileon/doc/BootHelp.txt (revision 380) +++ branches/azimutz/Chazileon/doc/BootHelp.txt (revision 381) @@ -18,8 +18,8 @@ kernel: kernel name (e.g. "mach_kernel" - must be in "/" ) - flags: -v (verbose) -s (single user mode), - -x (safe mode) -F (ignore boot configuration file) + flags: -v (verbose) -s (single user mode) -x (safe mode) + -F (ignore "Kernel Flags" specified in boot configuration file) 32 (i386 arch) -legacy (no 64 bit apps - kernel flag) 64 (x86_64 arch) Index: branches/azimutz/Chazileon/CHANGES =================================================================== --- branches/azimutz/Chazileon/CHANGES (revision 380) +++ branches/azimutz/Chazileon/CHANGES (revision 381) @@ -1,3 +1,5 @@ +- Removed obsolete -f option, use -x instead +- Removed -x32 option, use arch=i386 instead - Added automatic SMBusspeed detection for lga1156 core i5/7 cpus - Added new iMac11,1 sbios default model for lga1156 core i5/17 mobos - md0 code. Notified xnu when an md ramdisk is specified Index: branches/azimutz/Chazileon/i386/libsaio/msdos.c =================================================================== --- branches/azimutz/Chazileon/i386/libsaio/msdos.c (revision 380) +++ branches/azimutz/Chazileon/i386/libsaio/msdos.c (revision 381) @@ -54,7 +54,7 @@ #include "msdos.h" #define LABEL_LENGTH 11 -#define MSDOS_CACHE_BLOCKSIZE BPS * 2 +#define MSDOS_CACHE_BLOCKSIZE BPS #define CLUST_FIRST 2/* reserved cluster range */ #define CLUST_RSRVD32 0x0ffffff8 /* reserved cluster range */ Index: branches/azimutz/Chazileon/i386/boot2/graphics.c =================================================================== --- branches/azimutz/Chazileon/i386/boot2/graphics.c (revision 380) +++ branches/azimutz/Chazileon/i386/boot2/graphics.c (revision 381) @@ -1216,21 +1216,24 @@ return; } - if (gVerboseMode) { - currentTickTime = time18(); // late binding - if (currentTickTime < lastTickTime + MIN_TICKS) { - return; - } else { - lastTickTime = currentTickTime; - } - - if (getVideoMode() == VGA_TEXT_MODE) { - if (currentIndicator >= sizeof(indicator)) { - currentIndicator = 0; - } - printf("%c\b", indicator[currentIndicator++]); - } - } + currentTickTime = time18(); // late binding + if (currentTickTime < lastTickTime + MIN_TICKS) + { + return; + } + else + { + lastTickTime = currentTickTime; + } + + if (getVideoMode() == VGA_TEXT_MODE) + { + if (currentIndicator >= sizeof(indicator)) + { + currentIndicator = 0; + } + printf("%c\b", indicator[currentIndicator++]); + } } void Index: branches/azimutz/Chazileon/i386/boot2/boot.c =================================================================== --- branches/azimutz/Chazileon/i386/boot2/boot.c (revision 380) +++ branches/azimutz/Chazileon/i386/boot2/boot.c (revision 381) @@ -419,6 +419,7 @@ gui.bootprompt.draw = false; // ? gui.menu.draw = false; // ? gui.infobox.draw = false; // We can't boot with this drawn; most probably it's not needed!? + gui.logo.draw = false; updateVRAM(); } @@ -488,6 +489,7 @@ bvChain = newFilteredBVChain(0x80, 0xFF, allowBVFlags, denyBVFlags, &gDeviceCount); setBootGlobals(bvChain); + setupDeviceList(&bootInfo->themeConfig); //Azi: check this - position test!!! } continue; } @@ -701,15 +703,9 @@ if (ret <= 0) { printf("Can't find %s\n", bootFile); - - if(gui.initialised) - { - sleep(1); - drawBackground(); - gui.devicelist.draw = true; - gui.redraw = true; - } - + + sleep(1); + if (gBootFileType == kNetworkDeviceType) { // Return control back to PXE. Don't unload PXE base code. gUnloadPXEOnExit = false; Index: branches/azimutz/Chazileon/i386/boot2/boot.h =================================================================== --- branches/azimutz/Chazileon/i386/boot2/boot.h (revision 380) +++ branches/azimutz/Chazileon/i386/boot2/boot.h (revision 381) @@ -176,7 +176,6 @@ #define kArchX86_64Flag "64" // # boot.c, getValFK //---------- #define kVerboseModeFlag "-v" // * options.c, getValFK -#define kOldSafeModeFlag "-f" // kIgnoreCacheModeFlag***, options.c, getValFK #define kSafeModeFlag "-x" // * options.c, getValueFBK (5) & getValFK #define kSingleUserModeFlag "-s" // * options.c, getValFK #define kIgnoreBootFileFlag "-F" // * options.c, getValFBK Index: branches/azimutz/Chazileon/i386/boot2/gui.c =================================================================== --- branches/azimutz/Chazileon/i386/boot2/gui.c (revision 380) +++ branches/azimutz/Chazileon/i386/boot2/gui.c (revision 381) @@ -417,6 +417,18 @@ return 0; } +int freeWindowBuffer( window_t *window ) +{ + if (window->pixmap && window->pixmap->pixels) + { + free(window->pixmap->pixels); + free(window->pixmap); + return 0; + } + + return 1; +} + void fillPixmapWithColor(pixmap_t *pm, uint32_t color) { int x,y; @@ -439,21 +451,87 @@ blend( images[iBackground].image, gui.screen.pixmap, gui.background.pos ); // draw logo.png into background buffer - blend( images[iLogo].image, gui.screen.pixmap, gui.logo.pos); + if (gui.logo.draw) + { + blend( images[iLogo].image, gui.screen.pixmap, gui.logo.pos); + } memcpy( gui.backbuffer->pixels, gui.screen.pixmap->pixels, gui.backbuffer->width * gui.backbuffer->height * 4 ); } -void loadThemeValues(config_file_t *theme, bool overide) +void setupDeviceList(config_file_t *theme) { - unsigned int screen_width = gui.screen.width; - unsigned int screen_height = gui.screen.height; unsigned int pixel; int alpha; // transparency level 0 (obligue) - 255 (transparent) uint32_t color; // color value formatted RRGGBB int val, len; const char *string; + if(getIntForKey("devices_max_visible", &val, theme )) + gui.maxdevices = MIN( val, gDeviceCount ); + + if(getIntForKey("devices_iconspacing", &val, theme )) + gui.devicelist.iconspacing = val; + + // check layout for horizontal or vertical + gui.layout = HorizontalLayout; + if(getValueForKey( "devices_layout", &string, &len, theme)) { + if (!strcmp (string, "vertical")) { + gui.layout = VerticalLayout; + } + } + + switch (gui.layout) { + case VerticalLayout: + gui.devicelist.height = ((images[iSelection].image->height + font_console.chars[0]->height + gui.devicelist.iconspacing) * MIN(gui.maxdevices, gDeviceCount) + (images[iDeviceScrollPrev].image->height + images[iDeviceScrollNext].image->height) + gui.devicelist.iconspacing); + gui.devicelist.width = (images[iSelection].image->width + gui.devicelist.iconspacing); + + if(getDimensionForKey("devices_pos_x", &pixel, theme, gui.screen.width , images[iSelection].image->width ) ) + gui.devicelist.pos.x = pixel; + + if(getDimensionForKey("devices_pos_y", &pixel, theme, gui.screen.height , gui.devicelist.height ) ) + gui.devicelist.pos.y = pixel; + break; + + case HorizontalLayout: + default: + gui.devicelist.width = ((images[iSelection].image->width + gui.devicelist.iconspacing) * MIN(gui.maxdevices, gDeviceCount) + (images[iDeviceScrollPrev].image->width + images[iDeviceScrollNext].image->width) + gui.devicelist.iconspacing); + gui.devicelist.height = (images[iSelection].image->height + font_console.chars[0]->height + gui.devicelist.iconspacing); + + if(getDimensionForKey("devices_pos_x", &pixel, theme, gui.screen.width , gui.devicelist.width ) ) + gui.devicelist.pos.x = pixel; + else + gui.devicelist.pos.x = ( gui.screen.width - gui.devicelist.width ) / 2; + + if(getDimensionForKey("devices_pos_y", &pixel, theme, gui.screen.height , images[iSelection].image->height ) ) + gui.devicelist.pos.y = pixel; + else + gui.devicelist.pos.y = ( gui.screen.height - gui.devicelist.height ) / 2; + break; + } + + if(getColorForKey("devices_bgcolor", &color, theme)) + gui.devicelist.bgcolor = (color & 0x00FFFFFF); + + if(getIntForKey("devices_transparency", &alpha, theme)) + gui.devicelist.bgcolor = gui.devicelist.bgcolor | (( 255 - ( alpha & 0xFF) ) << 24); + + if (gui.devicelist.pixmap) + { + freeWindowBuffer(&gui.devicelist); + createWindowBuffer(&gui.devicelist); + } +} + +void loadThemeValues(config_file_t *theme) +{ + unsigned int screen_width = gui.screen.width; + unsigned int screen_height = gui.screen.height; + unsigned int pixel; + int alpha; // transparency level 0 (obligue) - 255 (transparent) + uint32_t color; // color value formatted RRGGBB + int val; + /* * Parse screen parameters */ @@ -502,58 +580,11 @@ if(getDimensionForKey("countdown_pos_y", &pixel, theme, screen_height , 0 ) ) gui.countdown.pos.y = pixel; - /* + /* * Parse devicelist parameters */ - if(getIntForKey("devices_max_visible", &val, theme )) - gui.maxdevices = MIN( val, gDeviceCount ); + setupDeviceList(theme); - if(getIntForKey("devices_iconspacing", &val, theme )) - gui.devicelist.iconspacing = val; - - // check layout for horizontal or vertical - gui.layout = HorizontalLayout; - if(getValueForKey( "devices_layout", &string, &len, theme)) { - if (!strcmp (string, "vertical")) { - gui.layout = VerticalLayout; - } - } - - switch (gui.layout) { - case VerticalLayout: - gui.devicelist.height = ((images[iSelection].image->height + font_console.chars[0]->height + gui.devicelist.iconspacing) * MIN(gui.maxdevices, gDeviceCount) + (images[iDeviceScrollPrev].image->height + images[iDeviceScrollNext].image->height) + gui.devicelist.iconspacing); - gui.devicelist.width = (images[iSelection].image->width + gui.devicelist.iconspacing); - - if(getDimensionForKey("devices_pos_x", &pixel, theme, gui.screen.width , images[iSelection].image->width ) ) - gui.devicelist.pos.x = pixel; - - if(getDimensionForKey("devices_pos_y", &pixel, theme, gui.screen.height , gui.devicelist.height ) ) - gui.devicelist.pos.y = pixel; - break; - - case HorizontalLayout: - default: - gui.devicelist.width = ((images[iSelection].image->width + gui.devicelist.iconspacing) * MIN(gui.maxdevices, gDeviceCount) + (images[iDeviceScrollPrev].image->width + images[iDeviceScrollNext].image->width) + gui.devicelist.iconspacing); - gui.devicelist.height = (images[iSelection].image->height + font_console.chars[0]->height + gui.devicelist.iconspacing); - - if(getDimensionForKey("devices_pos_x", &pixel, theme, gui.screen.width , gui.devicelist.width ) ) - gui.devicelist.pos.x = pixel; - else - gui.devicelist.pos.x = ( gui.screen.width - gui.devicelist.width ) / 2; - - if(getDimensionForKey("devices_pos_y", &pixel, theme, gui.screen.height , images[iSelection].image->height ) ) - gui.devicelist.pos.y = pixel; - else - gui.devicelist.pos.y = ( gui.screen.height - gui.devicelist.height ) / 2; - break; - } - - if(getColorForKey("devices_bgcolor", &color, theme)) - gui.devicelist.bgcolor = (color & 0x00FFFFFF); - - if(getIntForKey("devices_transparency", &alpha, theme)) - gui.devicelist.bgcolor = gui.devicelist.bgcolor | (( 255 - ( alpha & 0xFF) ) << 24); - /* * Parse infobox parameters */ @@ -719,7 +750,7 @@ // load graphics otherwise fail and return if (loadGraphics() == 0) { - loadThemeValues(&bootInfo->themeConfig, true); + loadThemeValues(&bootInfo->themeConfig); colorFont(&font_small, gui.screen.font_small_color); colorFont(&font_console, gui.screen.font_console_color); @@ -729,7 +760,8 @@ if (createWindowBuffer(&gui.devicelist) == 0) { if (createWindowBuffer(&gui.bootprompt) == 0) { if (createWindowBuffer(&gui.infobox) == 0) { - if (createWindowBuffer(&gui.menu) == 0) { + if (createWindowBuffer(&gui.menu) == 0) { + gui.logo.draw = true; #ifdef AUTORES_DEBUG printf("Press Any Key...\n"); Index: branches/azimutz/Chazileon/i386/boot2/gui.h =================================================================== --- branches/azimutz/Chazileon/i386/boot2/gui.h (revision 380) +++ branches/azimutz/Chazileon/i386/boot2/gui.h (revision 381) @@ -146,6 +146,7 @@ int initGUI(); void drawBackground(); +void setupDeviceList(config_file_t *theme); void drawDeviceIcon(BVRef device, pixmap_t *buffer, position_t p, bool isSelected); void drawDeviceList(int start, int end, int selection); void drawProgressBar(pixmap_t *blendInto, uint16_t width, position_t p, uint8_t progress); Index: branches/azimutz/Chazileon/i386/boot2/options.c =================================================================== --- branches/azimutz/Chazileon/i386/boot2/options.c (revision 380) +++ branches/azimutz/Chazileon/i386/boot2/options.c (revision 381) @@ -450,7 +450,7 @@ gVerboseMode = false; gBootMode = kBootModeNormal; *gBootArgsPtr++ = '-'; - *gBootArgsPtr++ = 'f'; + *gBootArgsPtr++ = 'x'; break; case BOOT_SINGLEUSER: @@ -874,6 +874,7 @@ if (bootArgs->Video.v_display == GRAPHICS_MODE) { // redraw the background buffer + gui.logo.draw = true; drawBackground(); gui.devicelist.draw = true; gui.redraw = true; @@ -1449,24 +1450,20 @@ strncpy(&argP[cnt], cp, userCnt); argP[cnt+userCnt] = '\0'; - if(!shouldboot) - { - gVerboseMode = getValueForKey( kVerboseModeFlag, &val, &cnt, &bootInfo->bootConfig ) || - getValueForKey( kSingleUserModeFlag, &val, &cnt, &bootInfo->bootConfig ); + if(!shouldboot) + { + gVerboseMode = getValueForKey( kVerboseModeFlag, &val, &cnt, &bootInfo->bootConfig ) || + getValueForKey( kSingleUserModeFlag, &val, &cnt, &bootInfo->bootConfig ); + + gBootMode = ( getValueForKey( kSafeModeFlag, &val, &cnt, &bootInfo->bootConfig ) ) ? + kBootModeSafe : kBootModeNormal; + } - gBootMode = ( getValueForKey( kSafeModeFlag, &val, &cnt, &bootInfo->bootConfig ) ) ? - kBootModeSafe : kBootModeNormal; + if ( getValueForKey( kMKextCacheKey, &val, &cnt, &bootInfo->bootConfig ) ) + { + strlcpy(gMKextName, val, cnt + 1); + } - if ( getValueForKey( kOldSafeModeFlag, &val, &cnt, &bootInfo->bootConfig ) ) { - gBootMode = kBootModeSafe; - } - - if ( getValueForKey( kMKextCacheKey, &val, &cnt, &bootInfo->bootConfig ) ) { - strlcpy(gMKextName, val, cnt + 1); - } - - } - free(configKernelFlags); free(valueBuffer);