Index: branches/azimutz/Chazi/i386/libsaio/xml.c =================================================================== --- branches/azimutz/Chazi/i386/libsaio/xml.c (revision 1046) +++ branches/azimutz/Chazi/i386/libsaio/xml.c (revision 1047) @@ -27,9 +27,8 @@ #include "sl.h" #include "xml.h" -//getchar(); //getc(); Azi: getc stuff - -//Azi: start - this code is unchanged since boot132, were it was exactly the same +//Azi: UPDATE THIS FILE - ADLER STUFF***** +// start - this code is unchanged since boot132, were it was exactly the same // as the one in drivers.c. Atm, the one in drivers.c has some more stuff; it could be // added on xml.h which is included on drivers.c and here?? struct Module { Index: branches/azimutz/Chazi/i386/libsaio/console.c =================================================================== --- branches/azimutz/Chazi/i386/libsaio/console.c (revision 1046) +++ branches/azimutz/Chazi/i386/libsaio/console.c (revision 1047) @@ -159,9 +159,9 @@ { register int c = getc(); - if ( c == '\r' ) c = '\n'; +// if ( c == '\r' ) c = '\n'; - if ( c >= ' ' && c < 0x7f) putchar(c); +// if ( c >= ' ' && c < 0x7f) putchar(c); return (c); } @@ -260,5 +260,5 @@ void pause() { printf("Press a key to continue...\n"); - getc(); + getchar(); // replace getchar() by pause() ?? } Index: branches/azimutz/Chazi/i386/libsaio/acpi_patcher.c =================================================================== --- branches/azimutz/Chazi/i386/libsaio/acpi_patcher.c (revision 1046) +++ branches/azimutz/Chazi/i386/libsaio/acpi_patcher.c (revision 1047) @@ -1107,7 +1107,7 @@ } #if DEBUG_ACPI printf("Press a key to continue... (DEBUG_ACPI)\n"); - getc(); //getchar(); Azi: getc stuff + getchar(); #endif return 1; } Index: branches/azimutz/Chazi/i386/libsaio/load.c =================================================================== --- branches/azimutz/Chazi/i386/libsaio/load.c (revision 1046) +++ branches/azimutz/Chazi/i386/libsaio/load.c (revision 1047) @@ -137,7 +137,7 @@ printf("ncmds: %x\n", (unsigned)mH->ncmds); printf("sizeofcmds: %x\n", (unsigned)mH->sizeofcmds); printf("flags: %x\n", (unsigned)mH->flags); - getc(); //getchar(); Azi: getc stuff + getchar(); #endif ncmds = mH->ncmds; @@ -221,7 +221,7 @@ printf("segname: %s, vmaddr: %x, vmsize: %x, fileoff: %x, filesize: %x, nsects: %d, flags: %x.\n", segCmd->segname, (unsigned)vmaddr, (unsigned)vmsize, (unsigned)fileaddr, (unsigned)filesize, (unsigned) segCmd->nsects, (unsigned)segCmd->flags); - getc(); //getchar(); Azi: getc stuff + getchar(); #endif } else @@ -241,7 +241,7 @@ printf("segname: %s, vmaddr: %x, vmsize: %x, fileoff: %x, filesize: %x, nsects: %d, flags: %x.\n", segCmd->segname, (unsigned)vmaddr, (unsigned)vmsize, (unsigned)fileaddr, (unsigned)filesize, (unsigned) segCmd->nsects, (unsigned)segCmd->flags); - getc(); //getchar(); Azi: getc stuff + getchar(); #endif } @@ -325,7 +325,7 @@ #ifdef DEBUG printf("symoff: %x, nsyms: %x, stroff: %x, strsize: %x\n", symTab->symoff, symTab->nsyms, symTab->stroff, symTab->strsize); - getc(); //getchar(); Azi: getc stuff + getchar(); #endif symsSize = symTab->stroff - symTab->symoff; Index: branches/azimutz/Chazi/i386/libsaio/disk.c =================================================================== --- branches/azimutz/Chazi/i386/libsaio/disk.c (revision 1046) +++ branches/azimutz/Chazi/i386/libsaio/disk.c (revision 1047) @@ -1649,7 +1649,7 @@ printf(" bvr: %d, dev: %d, part: %d, flags: %d, vis: %d\n", bvr, bvr->biosdev, bvr->part_no, bvr->flags, bvr->visible); } printf("count: %d\n", bvCount); - getc(); //getchar(); Azi: getc stuff + getchar(); #endif *count = bvCount; Index: branches/azimutz/Chazi/i386/libsaio/biosfn.c =================================================================== --- branches/azimutz/Chazi/i386/libsaio/biosfn.c (revision 1046) +++ branches/azimutz/Chazi/i386/libsaio/biosfn.c (revision 1047) @@ -187,7 +187,7 @@ // Some BIOSes will simply ignore the value of ECX on entry. // Probably best to keep its value at 20 to avoid surprises. - //printf("Get memory map 0x%x, %d\n", rangeArray);getc(); + //printf("Get memory map 0x%x, %d\n", rangeArray); getchar(); if (maxRangeCount > (BIOS_LEN / sizeof(MemoryRange))) { maxRangeCount = (BIOS_LEN / sizeof(MemoryRange)); } @@ -254,10 +254,10 @@ #if DEBUG { int i; - printf("%d total ranges\n", count); getc(); //getchar(); Azi: getc stuff + printf("%d total ranges\n", count); getchar(); for (i=0, range = rangeArray; itype, (unsigned int)range->base, (unsigned int)range->length); getc(); //getchar(); Azi: getc stuff + range->type, (unsigned int)range->base, (unsigned int)range->length); getchar(); } } #endif Index: branches/azimutz/Chazi/i386/libsaio/saio_internal.h =================================================================== --- branches/azimutz/Chazi/i386/libsaio/saio_internal.h (revision 1046) +++ branches/azimutz/Chazi/i386/libsaio/saio_internal.h (revision 1047) @@ -91,7 +91,6 @@ extern void initBooterLog(void); extern void setupBooterLog(void); extern int putchar(int ch); -extern int getc(void); //Azi: getc stuff extern int getchar(void); extern void msglog(const char * format, ...); extern int printf(const char *format, ...); Index: branches/azimutz/Chazi/i386/boot2/options.h =================================================================== --- branches/azimutz/Chazi/i386/boot2/options.h (revision 1046) +++ branches/azimutz/Chazi/i386/boot2/options.h (revision 1047) @@ -31,7 +31,7 @@ //AZI: KEEP THIS FILE ??? -extern int gDeviceCount; +//extern int gDeviceCount; void clearBootArgs(void); typedef struct { Index: branches/azimutz/Chazi/i386/boot2/drivers.c =================================================================== --- branches/azimutz/Chazi/i386/boot2/drivers.c (revision 1046) +++ branches/azimutz/Chazi/i386/boot2/drivers.c (revision 1047) @@ -579,7 +579,7 @@ length = LoadFile(gFileSpec); executableAddr = (void *)kLoadAddr; } - //printf("%s length = %d addr = 0x%x\n", gFileSpec, length, driverModuleAddr); getc(); + //printf("%s length = %d addr = 0x%x\n", gFileSpec, length, driverModuleAddr); getchar(); } else length = 0; @@ -795,7 +795,7 @@ printf("adler32: 0x%x\n", kernel_header->adler32); printf("uncompressed_size: 0x%x\n", kernel_header->uncompressed_size); printf("compressed_size: 0x%x\n", kernel_header->compressed_size); - getc(); + getchar(); #endif if (kernel_header->signature == OSSwapBigToHostConstInt32('comp')) { Index: branches/azimutz/Chazi/i386/boot2/Makefile =================================================================== --- branches/azimutz/Chazi/i386/boot2/Makefile (revision 1046) +++ branches/azimutz/Chazi/i386/boot2/Makefile (revision 1047) @@ -23,7 +23,7 @@ -fno-builtin -DSAIO_INTERNAL_USER -static $(OMIT_FRAME_POINTER_CFLAG) \ -mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \ -march=pentium4 -msse2 -mfpmath=sse -msoft-float -nostdinc -include $(SRCROOT)/autoconf.h - + CPPFLAGS := $(CPPFLAGS) -nostdinc++ -include $(SRCROOT)/autoconf.h DEFINES= @@ -43,7 +43,8 @@ # The ordering is important; # boot2.o must be first. OBJS = boot2.o boot.o graphics.o drivers.o prompt.o options.o lzss.o mboot.o \ - ramdisk.o picopng.o resume.o bmdecompress.o graphic_utils.o gui.o modules.o modules_support.o boot_modules.o + ramdisk.o picopng.o resume.o bmdecompress.o graphic_utils.o gui.o modules.o \ + modules_support.o boot_modules.o # button.o browser.o scrollbar.o == NOTYET UTILDIR = ../util @@ -112,7 +113,6 @@ @${RM} $(SYMROOT)/${SYMBOLS_MODULE} - @$(LD) -arch i386 \ -undefined dynamic_lookup \ -dylib -read_only_relocs suppress \ @@ -122,17 +122,13 @@ -final_output Symbols \ -macosx_version_min 10.6 \ -o $(OBJROOT)/Symbols_LINKER_ONLY.dylib - - - - endif - @make embed_symbols # this is done in a sub process after boot.sys exists so the strings are populated correctly + @# this is done in a sub process after boot.sys exists so the strings are populated correctly + @make embed_symbols @${RM} $(SYMROOT)/boot2.sys - @( size=`ls -l $(SYMROOT)/boot | awk '{ print $$5}'` ; \ if expr "$$size" ">" "$(MAXBOOTSIZE)" > /dev/null ;\ @@ -145,7 +141,6 @@ echo "\t******* boot is $$size bytes *******"; \ fi) - embed_symbols: ifeq (${CONFIG_MODULES}, y) @echo ================= Embedding Symbols.dylib ================= @@ -153,12 +148,11 @@ @$(SYMROOT)/machOconv $(SYMROOT)/boot2.sys $(SYMROOT)/boot &> /dev/null @echo "\t******* Patching at $(PATCH_ADDR) ******" - @stat -f%z $(SYMROOT)/boot | perl -ane "print pack('V',@F[0]);" | dd conv=notrunc of=${SYMROOT}/boot.sys bs=1 count=4 seek=$(PATCH_ADDR) &> /dev/null + @stat -f%z $(SYMROOT)/boot | perl -ane "print pack('V',@F[0]);" | dd conv=notrunc of=${SYMROOT}/boot.sys bs=1 count=4 seek=$(PATCH_ADDR) &> /dev/null endif @echo "\t[MACHOCONV] boot" @$(SYMROOT)/machOconv $(SYMROOT)/boot.sys $(SYMROOT)/boot - $(SYMROOT)/art.h: @if [ "$(PNGCRUSH)" ]; then \ echo "optimizing art files ...\n$(PNGCRUSH) $(PNGOPTIONS) artwork/$(THEME)"; \ Index: branches/azimutz/Chazi/i386/boot2/resume.c =================================================================== --- branches/azimutz/Chazi/i386/boot2/resume.c (revision 1046) +++ branches/azimutz/Chazi/i386/boot2/resume.c (revision 1047) @@ -118,7 +118,7 @@ printf ("Resuming from Encrypted image is unsupported.\n" "Uncheck \"Use secure virtual memory\" in \"Security\" pane on system preferences.\n" "Press any key to proceed with normal boot.\n"); - getc(); //getchar(); Azi: getc stuff + getchar(); return; } // depends on NVRAM @@ -145,7 +145,7 @@ if ( (long long)mem_base + allocSize < 1024*bootInfo->extmem + 0x100000 ) { printf("Not enough space to restore image. Press any key to proceed with normal boot.\n"); - getc(); //getchar(); Azi: getc stuff + getchar(); return; } Index: branches/azimutz/Chazi/i386/boot2/boot.c =================================================================== --- branches/azimutz/Chazi/i386/boot2/boot.c (revision 1046) +++ branches/azimutz/Chazi/i386/boot2/boot.c (revision 1047) @@ -79,7 +79,7 @@ int bvCount = 0; // global ?? - Slice //int menucount = 0; -int gDeviceCount = 0; +//int gDeviceCount = 0; BVRef bvr; //BVRef menuBVR; - doesn't seem used here @@ -199,7 +199,7 @@ //Azi: Wait=y is breaking other keys when typed "after them" at boot prompt. // Works properly if typed in first place or used on Boot.plist. if (getBoolForKey(kWaitForKeypressKey, &dummyVal, &bootInfo->bootConfig) && dummyVal) { - verbose("(Wait) "); + printf("(Wait) "); // Add to trunk?? don't forget that puse uses printf, not verbose!! pause(); } @@ -397,7 +397,7 @@ //printf msglog(":something...???\n Default: %d, ->biosdev: %d, ->part_no: %d ->flags: %d\n", gBootVolume, gBootVolume->biosdev, gBootVolume->part_no, gBootVolume->flags); msglog(" bt(0,0): %d, ->biosdev: %d, ->part_no: %d ->flags: %d\n", gBIOSBootVolume, gBIOSBootVolume->biosdev, gBIOSBootVolume->part_no, gBIOSBootVolume->flags); -// getchar(); //getc(); Azi: getc stuff - DON'T FORGET pause() - take modules.c as reference. +// getchar(); //#endif useGUI = true; Index: branches/azimutz/Chazi/i386/boot2/boot.h =================================================================== --- branches/azimutz/Chazi/i386/boot2/boot.h (revision 1046) +++ branches/azimutz/Chazi/i386/boot2/boot.h (revision 1047) @@ -176,6 +176,19 @@ #define kBootTimeout -1 #define kCDBootTimeout 8 +enum { + kBackspaceKey = 0x08, + kTabKey = 0x09, + kReturnKey = '\r', + kEscapeKey = 0x1b, + kUpArrowkey = 0x4800, + kDownArrowkey = 0x5000, + kASCIIKeyMask = 0x7f, + kF2Key = 0x3c00, //Azi:autoresolution + kF5Key = 0x3f00, + kF10Key = 0x4400 +}; + /* * A global set by boot() to record the device that the booter * was loaded from. Index: branches/azimutz/Chazi/i386/boot2/modules.c =================================================================== --- branches/azimutz/Chazi/i386/boot2/modules.c (revision 1046) +++ branches/azimutz/Chazi/i386/boot2/modules.c (revision 1047) @@ -17,7 +17,7 @@ #if CONFIG_MODULE_DEBUG #define DBG(x...) printf(x); -#define DBGPAUSE() getc() // getchar() - ";" needed ? +#define DBGPAUSE() getchar() // ";" needed ? #else #define DBG(x...) #define DBGPAUSE() @@ -87,7 +87,7 @@ else { // The module does not have a valid start function - printf("Unable to start %s\n", SYMBOLS_MODULE); getc(); //Azi: getchar(); + printf("Unable to start %s\n", SYMBOLS_MODULE); getchar(); } } } @@ -186,7 +186,7 @@ else // The module does not have a valid start function. This may be a library. { printf("WARNING: Unable to start %s\n", module); - getc(); //Azi: getchar(); + getchar(); } #else else msglog("WARNING: Unable to start %s\n", module); @@ -305,7 +305,7 @@ #if CONFIG_MODULE_DEBUG printf("Unable to locate symbol %s\n", name); - getc(); //Azi: getchar(); + getchar(); #endif if(strcmp(name, VOID_SYMBOL) == 0) return 0xFFFFFFFF; @@ -371,16 +371,14 @@ else { verbose("Invalid mach magic 0x%X\n", ((struct mach_header*)binary)->magic); - //getc(); //Azi: getchar(); +// getchar(); Azi: this gets a bit annoying when using kernelcache :P return NULL; } - - /*if(((struct mach_header*)binary)->filetype != MH_DYLIB) { printf("Module is not a dylib. Unable to load.\n"); - getc(); //Azi: getchar(); + getchar(); return NULL; // Module is in the incorrect format }*/ @@ -391,7 +389,6 @@ loadCommand = binary + binaryIndex; UInt32 cmdSize = loadCommand->cmdsize; - switch ((loadCommand->cmd & 0x7FFFFFFF)) { case LC_SYMTAB: @@ -414,11 +411,11 @@ sectionIndex += sizeof(struct section); - if(section_handler) section_handler(sect->sectname, segCommand->segname, sect->offset, sect->addr); + if (section_handler) + section_handler(sect->sectname, segCommand->segname, sect->offset, sect->addr); - - - if((strcmp("__TEXT", segCommand->segname) == 0) && (strcmp("__text", sect->sectname) == 0)) + if ((strcmp("__TEXT", segCommand->segname) == 0) + && (strcmp("__text", sect->sectname) == 0)) { // __TEXT,__text found, save the offset and address for when looking for the calls. textSection = sect->offset; @@ -427,6 +424,7 @@ } } break; + case LC_SEGMENT_64: // 64bit macho's { segCommand64 = binary + binaryIndex; @@ -442,10 +440,11 @@ sectionIndex += sizeof(struct section_64); - if(section_handler) section_handler(sect->sectname, segCommand->segname, sect->offset, sect->addr); + if (section_handler) + section_handler(sect->sectname, segCommand->segname, sect->offset, sect->addr); - - if((strcmp("__TEXT", segCommand->segname) == 0) && (strcmp("__text", sect->sectname) == 0)) + if ((strcmp("__TEXT", segCommand->segname) == 0) + && (strcmp("__text", sect->sectname) == 0)) { // __TEXT,__text found, save the offset and address for when looking for the calls. textSection = sect->offset; @@ -454,8 +453,7 @@ } } break; - - + case LC_LOAD_DYLIB: case LC_LOAD_WEAK_DYLIB ^ LC_REQ_DYLD: dylibCommand = binary + binaryIndex; @@ -463,7 +461,7 @@ // Possible enhancments: verify version // = dylibCommand->dylib.current_version; // = dylibCommand->dylib.compatibility_version; - if(dylib_loader) + if (dylib_loader) { char* name = malloc(strlen(module) + strlen(".dylib") + 1); sprintf(name, "%s.dylib", module); @@ -474,7 +472,6 @@ free(name); } } - break; case LC_ID_DYLIB: @@ -499,27 +496,29 @@ default: DBG("Unhandled loadcommand 0x%X\n", loadCommand->cmd & 0x7FFFFFFF); break; - } - binaryIndex += cmdSize; } - // bind_macho uses the symbols, if the textAdd does not exist (Symbols.dylib, no code), addresses are static and not relative + // bind_macho uses the symbols, if the textAdd does not exist (Symbols.dylib, no code), + // addresses are static and not relative module_start = (void*)handle_symtable((UInt32)binary, symtabCommand, symbol_handler, is64); - if(dyldInfoCommand) + if (dyldInfoCommand) { // Rebase the module before binding it. - if(dyldInfoCommand->rebase_off) rebase_macho(binary, (char*)dyldInfoCommand->rebase_off, dyldInfoCommand->rebase_size); + if (dyldInfoCommand->rebase_off) + rebase_macho(binary, (char*)dyldInfoCommand->rebase_off, dyldInfoCommand->rebase_size); // Bind all symbols. - if(dyldInfoCommand->bind_off) bind_macho(binary, (UInt8*)dyldInfoCommand->bind_off, dyldInfoCommand->bind_size); - if(dyldInfoCommand->weak_bind_off) bind_macho(binary, (UInt8*)dyldInfoCommand->weak_bind_off, dyldInfoCommand->weak_bind_size); - if(dyldInfoCommand->lazy_bind_off) bind_macho(binary, (UInt8*)dyldInfoCommand->lazy_bind_off, dyldInfoCommand->lazy_bind_size); + if (dyldInfoCommand->bind_off) + bind_macho(binary, (UInt8*)dyldInfoCommand->bind_off, dyldInfoCommand->bind_size); + if (dyldInfoCommand->weak_bind_off) + bind_macho(binary, (UInt8*)dyldInfoCommand->weak_bind_off,dyldInfoCommand->weak_bind_size); + if (dyldInfoCommand->lazy_bind_off) + bind_macho(binary, (UInt8*)dyldInfoCommand->lazy_bind_off, dyldInfoCommand->lazy_bind_size); } return module_start; - } /* @@ -892,7 +891,7 @@ else { printf("Unable to bind symbol %s\n", symbolName); - getc(); //Azi: getchar(); + getchar(); } segmentAddress += sizeof(void*); @@ -911,7 +910,7 @@ else { printf("Unable to bind symbol %s\n", symbolName); - getc(); //Azi: getchar(); + getchar(); } segmentAddress += tmp + sizeof(void*); @@ -929,7 +928,7 @@ else { printf("Unable to bind symbol %s\n", symbolName); - getc(); //Azi: getchar(); + getchar(); } segmentAddress += (immediate * sizeof(void*)) + sizeof(void*); @@ -954,7 +953,7 @@ else { printf("Unable to bind symbol %s\n", symbolName); - getc(); //Azi: getchar(); + getchar(); } break; } @@ -1086,7 +1085,7 @@ #if CONFIG_MODULE_DEBUG //print_hook_list(); - //getc(); //Azi: getchar(); + //getchar(); #endif } @@ -1134,7 +1133,7 @@ void dyld_stub_binder() { printf("ERROR: dyld_stub_binder was called, should have been take care of by the linker.\n"); - getc(); //Azi: getchar(); + getchar(); } #else /* CONFIG_MODULES */ Index: branches/azimutz/Chazi/i386/boot2/gui.c =================================================================== --- branches/azimutz/Chazi/i386/boot2/gui.c (revision 1046) +++ branches/azimutz/Chazi/i386/boot2/gui.c (revision 1047) @@ -13,16 +13,18 @@ #include "appleboot.h" #include "vers.h" +#ifdef CONFIG_EMBED_THEME +#include "art.h" +#endif + #define IMG_REQUIRED -1 #define LOADPNG(img, alt_img) if (loadThemeImage(#img, alt_img) != 0) { return 1; } #define VIDEO(x) (bootArgs->Video.v_ ## x) #define vram VIDEO(baseAddr) -#ifdef CONFIG_EMBED_THEME -#include "art.h" -#endif +int gDeviceCount = 0; +int lasttime = 0; // we need this for animating maybe -int lasttime = 0; // we need this for animating maybe static const char *theme_name = kDefaultThemeName; // #define'ed on boot.h /* @@ -128,15 +130,14 @@ int imageCnt = 0; -extern int gDeviceCount; +//extern int gDeviceCount; //extern int selectIndex; Azi: not in use extern MenuItem *menuItems; -char prompt[BOOT_STRING_LEN]; +//char prompt[BOOT_STRING_LEN]; +extern char gBootArgs[BOOT_STRING_LEN]; -int prompt_pos=0; - char prompt_text[] = "boot: "; menuitem_t infoMenuItems[] = @@ -967,8 +968,8 @@ void clearGraphicBootPrompt() { // clear text buffer - prompt[0] = '\0'; - prompt_pos=0; +// prompt[0] = '\0'; +// prompt_pos=0; if( gui.bootprompt.draw == true ) @@ -982,17 +983,8 @@ return; } -void updateGraphicBootPrompt(int key) +void updateGraphicBootPrompt() { - if ( key == kBackspaceKey ) - prompt[--prompt_pos] = '\0'; - else - { - prompt[prompt_pos] = key; - prompt_pos++; - prompt[prompt_pos] = '\0'; - } - fillPixmapWithColor( gui.bootprompt.pixmap, gui.bootprompt.bgcolor); makeRoundedCorners( gui.bootprompt.pixmap); @@ -1004,14 +996,8 @@ // get the position of the end of the boot prompt text to display user input position_t p_prompt = pos( p_text.x + ( ( strlen(prompt_text) ) * font_console.chars[0]->width ), p_text.y ); - - // calculate the position of the cursor - int offset = ( prompt_pos - ( ( gui.bootprompt.width / font_console.chars[0]->width ) - strlen(prompt_text) - 2 ) ); - - if ( offset < 0) - offset = 0; - drawStr( prompt+offset, &font_console, gui.bootprompt.pixmap, p_prompt); + drawStr( gBootArgs, &font_console, gui.bootprompt.pixmap, p_prompt); gui.menu.draw = false; gui.bootprompt.draw = true; @@ -1634,7 +1620,7 @@ updateVRAM(); - key = getc(); //getchar(); Azi: getc stuff + key = getchar(); if( key == kUpArrowkey ) if( currentline > 0 ) Index: branches/azimutz/Chazi/i386/boot2/gui.h =================================================================== --- branches/azimutz/Chazi/i386/boot2/gui.h (revision 1046) +++ branches/azimutz/Chazi/i386/boot2/gui.h (revision 1047) @@ -16,38 +16,38 @@ #define CHARACTERS_COUNT 223 -#define BOOT_NORMAL 0 +#define BOOT_NORMAL 0 #define BOOT_VERBOSE 1 #define BOOT_IGNORECACHE 2 #define BOOT_SINGLEUSER 3 -#define DO_NOT_BOOT 4 +#define DO_NOT_BOOT 4 #define CLOSE_INFO_MENU 5 -#define INFOMENU_NATIVEBOOT_START 1 -#define INFOMENU_NATIVEBOOT_END 3 +#define INFOMENU_NATIVEBOOT_START 1 +#define INFOMENU_NATIVEBOOT_END 3 -#define MENU_SHOW_MEMORY_INFO 4 -#define MENU_SHOW_VIDEO_INFO 5 -#define MENU_SHOW_HELP 6 +#define MENU_SHOW_MEMORY_INFO 4 +#define MENU_SHOW_VIDEO_INFO 5 +#define MENU_SHOW_HELP 6 enum { HorizontalLayout = 0, - VerticalLayout = 1, + VerticalLayout = 1 }; -/* moved to boot.h ?? +/* enum { kBackspaceKey = 0x08, - kTabKey = 0x09, - kReturnKey = 0x0d, - kEscapeKey = 0x1b, - kUpArrowkey = 0x4800, + kTabKey = 0x09, + kReturnKey = '\r', + kEscapeKey = 0x1b, + kUpArrowkey = 0x4800, kDownArrowkey = 0x5000, kASCIIKeyMask = 0x7f, - kF2Key = 0x3c00, //Azi:autoresolution - kF5Key = 0x3f00, - kF10Key = 0x4400 -};*/ - + kF2Key = 0x3c00, //Azi:autoresolution + kF5Key = 0x3f00, + kF10Key = 0x4400 +}; +*/ /* * Menu item structure. */ @@ -139,6 +139,8 @@ font_t font_small; font_t font_console; +extern int gDeviceCount; + int initGUI(); void drawBackground(); @@ -159,7 +161,7 @@ void showGraphicBootPrompt(); void clearGraphicBootPrompt(); -void updateGraphicBootPrompt(int key); +void updateGraphicBootPrompt(); void updateVRAM(); Index: branches/azimutz/Chazi/i386/boot2/ramdisk.c =================================================================== --- branches/azimutz/Chazi/i386/boot2/ramdisk.c (revision 1046) +++ branches/azimutz/Chazi/i386/boot2/ramdisk.c (revision 1047) @@ -276,9 +276,9 @@ clearScreenRows(0, 24); setCursorPosition(0, 0, 1); showInfoRAMDisk(); - //Azi: check Chazileon on these line breaks here*** + //Azi: check Chazi on these line breaks here*** printf("\n\nPress any key to continue.\n"); - getc(); //getchar(); Azi: getc stuff + getchar(); setActiveDisplayPage(0); } else @@ -291,7 +291,7 @@ printf("\n?rd m - mount ramdisk image\n?rd u - unmount ramdisk image"); printf("\n?rd e - enable bt(0,0) alias\n?rd d - disable bt(0,0) alias"); printf("\n\nPress any key to continue.\n"); - getc(); //getchar(); Azi: getc stuff + getchar(); setActiveDisplayPage(0); } } Index: branches/azimutz/Chazi/i386/boot2/options.c =================================================================== --- branches/azimutz/Chazi/i386/boot2/options.c (revision 1046) +++ branches/azimutz/Chazi/i386/boot2/options.c (revision 1047) @@ -149,7 +149,7 @@ } } - if( bootArgs->Video.v_display == GRAPHICS_MODE ) + if( bootArgs->Video.v_display != VGA_TEXT_MODE ) { drawProgressBar( gui.screen.pixmap, 100, gui.progressbar.pos , ( multi * 100 / multi_buff ) ); gui.redraw = true; @@ -165,7 +165,8 @@ //========================================================================== //Azi: bootargs reminder -static char gBootArgs[BOOT_STRING_LEN]; +//static - getc --> getchar +char gBootArgs[BOOT_STRING_LEN]; static char * gBootArgsPtr = gBootArgs; static char * gBootArgsEnd = gBootArgs + BOOT_STRING_LEN - 1; static char booterCommand[BOOT_STRING_LEN]; @@ -177,7 +178,7 @@ gBootArgsPtr = gBootArgs; memset(gBootArgs, '\0', BOOT_STRING_LEN); - if (bootArgs->Video.v_display == GRAPHICS_MODE) { + if (bootArgs->Video.v_display != VGA_TEXT_MODE) { clearGraphicBootPrompt(); } } @@ -205,7 +206,7 @@ clearScreenRows( row, kScreenLastRow ); } - clearBootArgs(); +// clearBootArgs(); if (visible) { if (bootArgs->Video.v_display == VGA_TEXT_MODE) { @@ -213,11 +214,12 @@ printf( bootRescanPrompt ); } else { printf( bootPrompt ); + printf( gBootArgs ); } } } else { - if (bootArgs->Video.v_display == GRAPHICS_MODE) { - clearGraphicBootPrompt(); + if (bootArgs->Video.v_display != VGA_TEXT_MODE) { +// clearGraphicBootPrompt(); } else { printf("Press Enter to start up the foreign OS. "); } @@ -235,35 +237,35 @@ case kBackspaceKey: if ( gBootArgsPtr > gBootArgs ) { + *--gBootArgsPtr = '\0'; + int x, y, t; getCursorPositionAndType( &x, &y, &t ); if ( x == 0 && y ) { x = 80; y--; } - if (x) - x--; + if (x) x--; + if( bootArgs->Video.v_display == VGA_TEXT_MODE ) { setCursorPosition( x, y, 0 ); putca(' ', 0x07, 1); - } else - updateGraphicBootPrompt(kBackspaceKey); - - *gBootArgsPtr-- = '\0'; - } - + } + else + { + updateGraphicBootPrompt(); + } + } break; default: if ( key >= ' ' && gBootArgsPtr < gBootArgsEnd) { - if( bootArgs->Video.v_display == VGA_TEXT_MODE ) - putchar(key); // echo to screen - else - updateGraphicBootPrompt(key); - - *gBootArgsPtr++ = key; + *gBootArgsPtr++ = key; + + if( bootArgs->Video.v_display != VGA_TEXT_MODE ) updateGraphicBootPrompt(); + else if ( key >= ' ' && key < 0x7f) putchar(key); } break; @@ -339,7 +341,7 @@ // Draw the visible items. - if( bootArgs->Video.v_display == GRAPHICS_MODE ) + if( bootArgs->Video.v_display != VGA_TEXT_MODE ) drawDeviceList(gMenuStart, gMenuEnd, gMenuSelection); @@ -376,7 +378,7 @@ if ( gMenuItems == NULL ) return 0; - if( bootArgs->Video.v_display == GRAPHICS_MODE ) + if( bootArgs->Video.v_display != VGA_TEXT_MODE ) { int res; @@ -702,7 +704,7 @@ } // ensure we're in graphics mode if gui is setup - if (gui.initialised && bootArgs->Video.v_display == VGA_TEXT_MODE) + if (firstRun && gui.initialised && bootArgs->Video.v_display == VGA_TEXT_MODE) { setVideoMode(GRAPHICS_MODE, 0); } @@ -878,7 +880,7 @@ } } - if (bootArgs->Video.v_display == GRAPHICS_MODE) { + if (bootArgs->Video.v_display != VGA_TEXT_MODE) { // redraw the background buffer gui.logo.draw = true; drawBackground(); @@ -918,13 +920,13 @@ showBootPrompt( nextRow, showPrompt ); do { - if (bootArgs->Video.v_display == GRAPHICS_MODE) { + if (bootArgs->Video.v_display != VGA_TEXT_MODE) { // redraw background memcpy( gui.backbuffer->pixels, gui.screen.pixmap->pixels, gui.backbuffer->width * gui.backbuffer->height * 4 ); // reset cursor co-ords gui.debug.cursor = pos( gui.screen.width - 160 , 10 ); } - key = getc(); //getchar(); Azi: getc stuff + key = getchar(); updateMenu( key, (void **) &menuBVR ); newShowPrompt = (gDeviceCount == 0) || (menuBVR->flags & kBVFlagNativeBoot); @@ -956,7 +958,7 @@ */ if (strcmp( booterCommand, "video" ) == 0) { - if (bootArgs->Video.v_display == GRAPHICS_MODE) + if (bootArgs->Video.v_display != VGA_TEXT_MODE) { showInfoBox(getVBEInfoString(), getVBEModeInfoString()); } @@ -967,7 +969,7 @@ } else if ( strcmp( booterCommand, "memory" ) == 0) { - if (bootArgs->Video.v_display == GRAPHICS_MODE ) + if (bootArgs->Video.v_display != VGA_TEXT_MODE ) { showInfoBox("Memory Map", getMemoryInfoString()); } @@ -1016,7 +1018,7 @@ // AutoResolution - Reapply the patch if Graphics Mode was incorrect // or EDID Info was insane. case kF2Key: - reloadAutoRes(); + reloadAutoRes(); // clearBootArgs is on the function break; case kF5Key: @@ -1042,7 +1044,7 @@ // Switch between text & graphic interfaces // Only Permitted if started in graphics interface if (useGUI) { - if (bootArgs->Video.v_display == GRAPHICS_MODE) { + if (bootArgs->Video.v_display != VGA_TEXT_MODE) { setVideoMode(VGA_TEXT_MODE, 0); setCursorPosition(0, 0, 0); @@ -1071,6 +1073,7 @@ gui.redraw = true; setVideoMode(GRAPHICS_MODE, 0); updateVRAM(); + updateGraphicBootPrompt(); } } key = 0; @@ -1446,7 +1449,7 @@ int line_offset; int c; - if (bootArgs->Video.v_display == GRAPHICS_MODE) { + if (bootArgs->Video.v_display != VGA_TEXT_MODE) { showInfoBox( "Press q to quit\n",buf ); return; } @@ -1489,7 +1492,7 @@ printf("[Type %s%sq to quit viewer]", (line_offset > 0) ? "p for previous page, " : "", (*bp != '\1') ? "space for next page, " : ""); } - c = getc(); //getchar(); Azi: getc stuff + c = getchar(); if (c == 'q' || c == 'Q') { break; } @@ -1509,7 +1512,7 @@ void showHelp(void) { - if (bootArgs->Video.v_display == GRAPHICS_MODE) { + if (bootArgs->Video.v_display != VGA_TEXT_MODE) { showInfoBox("Help. Press q to quit.\n", (char *)BootHelp_txt); } else { showTextBuffer((char *)BootHelp_txt, BootHelp_txt_len); @@ -1562,7 +1565,7 @@ printf("Typical boot devices are 80 (First HD), 81 (Second HD)\n"); printf("Enter two-digit hexadecimal boot device [%02x]: ", bootdevice); do { - key = getc(); //getchar(); Azi: getc stuff + key = getchar(); switch (key & kASCIIKeyMask) { case kBackspaceKey: if (digitsI > 0) { @@ -1613,7 +1616,7 @@ bool promptForRescanOption(void) { printf("\nWould you like to enable media rescan option?\nPress ENTER to enable or any key to skip.\n"); - if ( getc()/*getchar(); Azi: getc stuff*/ == kReturnKey) { + if (getchar() == kReturnKey) { return true; } else { return false; Index: branches/azimutz/Chazi/i386/modules/HPET/HPET.c =================================================================== --- branches/azimutz/Chazi/i386/modules/HPET/HPET.c (revision 1046) +++ branches/azimutz/Chazi/i386/modules/HPET/HPET.c (revision 1047) @@ -104,7 +104,7 @@ } /*#if DEBUG_HPET - pause(); - getchar(); //getc(); Azi: getc stuff + pause(); #endif*/ } @@ -195,7 +195,6 @@ if (!(val & 0x80)) verbose(" Failed to force enable HPET\n"); } - break; } } Index: branches/azimutz/Chazi/i386/modules/Resolution/915resolution.c =================================================================== --- branches/azimutz/Chazi/i386/modules/Resolution/915resolution.c (revision 1046) +++ branches/azimutz/Chazi/i386/modules/Resolution/915resolution.c (revision 1047) @@ -182,7 +182,7 @@ if((id & 0x0000FFFF) == 0x00008086) // Intel chipset { //printf("Unknown chipset 0x%llX, please email id to meklort@gmail.com", id); - //getchar(); //getc(); Azi: getc stuff + //getchar(); type = CT_UNKNOWN_INTEL; //type = CT_UNKNOWN; Index: branches/azimutz/Chazi/i386/modules/KernelPatcher/kernel_patcher.c =================================================================== --- branches/azimutz/Chazi/i386/modules/KernelPatcher/kernel_patcher.c (revision 1046) +++ branches/azimutz/Chazi/i386/modules/KernelPatcher/kernel_patcher.c (revision 1047) @@ -385,12 +385,12 @@ // Total: 24 bytes printf("Running on a 10.2.0+ kernel\n"); -// getchar(); //getc(); Azi: getc stuff +// getchar(); } else { printf("Running on a 10.0.0 kernel, patch unsupported\n"); - getc(); //getchar(); Azi: getc stuff + getchar(); } Index: branches/azimutz/Chazi/i386/modules/GraphicsEnabler/IntelGraphicsEnabler/gma.c =================================================================== --- branches/azimutz/Chazi/i386/modules/GraphicsEnabler/IntelGraphicsEnabler/gma.c (revision 1046) +++ branches/azimutz/Chazi/i386/modules/GraphicsEnabler/IntelGraphicsEnabler/gma.c (revision 1047) @@ -109,7 +109,7 @@ { printf("Failed initializing dev-prop string dev-entry, press any key...\n"); - getc(); //Azi: getchar(); + getchar(); return false; } @@ -161,7 +161,7 @@ if (!stringdata) { printf("no stringdata press a key...\n"); - getc(); //Azi: getchar(); + getchar(); return false; } Index: branches/azimutz/Chazi/i386/modules/GraphicsEnabler/ATiGraphicsEnabler/ati.c =================================================================== --- branches/azimutz/Chazi/i386/modules/GraphicsEnabler/ATiGraphicsEnabler/ati.c (revision 1046) +++ branches/azimutz/Chazi/i386/modules/GraphicsEnabler/ATiGraphicsEnabler/ati.c (revision 1047) @@ -658,7 +658,7 @@ device = devprop_add_device(string, devicepath); if (!device) { printf("Failed initializing dev-prop string dev-entry, press any key...\n"); - getc(); //Azi: getchar(); + getchar(); return false; } Index: branches/azimutz/Chazi/i386/modules/HelloWorld/HelloWorld.cpp =================================================================== --- branches/azimutz/Chazi/i386/modules/HelloWorld/HelloWorld.cpp (revision 1046) +++ branches/azimutz/Chazi/i386/modules/HelloWorld/HelloWorld.cpp (revision 1047) @@ -35,7 +35,7 @@ delete obj2; printf("Hello world from ExecKernel hook. Binary located at 0x%X\n", binary); - getc(); //Azi: getchar(); + getchar(); } void HelloWorld_start() @@ -43,7 +43,6 @@ //printf("Hooking 'ExecKernel'\n"); register_hook_callback("ExecKernel", &helloWorld); register_hook_callback("Kernel Start", &helloWorld); - } void HW::printHello()