Index: branches/iFabio/Chameleon/i386/libsaio/xml.c =================================================================== --- branches/iFabio/Chameleon/i386/libsaio/xml.c (revision 307) +++ branches/iFabio/Chameleon/i386/libsaio/xml.c (revision 308) @@ -909,11 +909,7 @@ if (gTagsFree == 0) { -#if USEMALLOC tag = (TagPtr)malloc(kTagsPerBlock * sizeof(Tag)); -#else - tag = (TagPtr)AllocateBootXMemory(kTagsPerBlock * sizeof(Tag)); -#endif if (tag == 0) return 0; // Initalize the new tags. @@ -991,11 +987,7 @@ // Add the new symbol. if (symbol == 0) { -#if USEMALLOC symbol = (SymbolPtr)malloc(sizeof(Symbol) + 1 + strlen(string)); -#else - symbol = (SymbolPtr)AllocateBootXMemory(sizeof(Symbol) + 1 + strlen(string)); -#endif if (symbol == 0) //return 0; stop("NULL symbol!"); Index: branches/iFabio/Chameleon/i386/libsaio/bootstruct.h =================================================================== --- branches/iFabio/Chameleon/i386/libsaio/bootstruct.h (revision 307) +++ branches/iFabio/Chameleon/i386/libsaio/bootstruct.h (revision 308) @@ -1,4 +1,4 @@ -/* +/** <-- JavaDoc style (doxygen) //Azi * Copyright (c) 2002-2003 Apple Computer, Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ @@ -30,15 +30,21 @@ #include "bios.h" #include "device_tree.h" -/* - * Kernel boot args global also used by booter for its own data. +/*! <-- QT style (doxygen) //Azi + Kernel boot args global also used by booter for its own data. */ extern boot_args *bootArgs; extern boot_args_pre_lion *bootArgsPreLion; extern Node *gMemoryMapNode; #define VGA_TEXT_MODE 0 +//defined in /usr/../boot.h +//#define GRAPHICS_MODE 1 +//#define FB_TEXT_MODE 2 + + + /* * Maximum number of boot drivers that can be loaded. */ @@ -100,10 +106,10 @@ /*! PrivateBootInfo has fields used by the booter that used to be part of - KernelBootArgs_t *bootArgs. When the switch was made to EFI the structure - completely changed to boot_args *bootArgs. This (new to boot-132) structure + KernelBootArgs_t *bootArgs. When the switch was made to EFI the structure + completely changed to boot_args *bootArgs. This (new to boot-132) structure contains the fields the kernel no longer cares about but the booter still - uses internally. Some fields (e.g. the video information) remain interesting + uses internally. Some fields (e.g. the video information) remain interesting to the kernel and are thus located in bootArgs although with different field names. */ typedef struct PrivateBootInfo { @@ -133,6 +139,6 @@ config_file_t ramdiskConfig; // RAMDisk.plist } PrivateBootInfo_t; -extern PrivateBootInfo_t *bootInfo; +extern PrivateBootInfo_t *bootInfo; #endif /* __BOOTSTRUCT_H */ Index: branches/iFabio/Chameleon/i386/libsaio/smbios_patcher.h =================================================================== --- branches/iFabio/Chameleon/i386/libsaio/smbios_patcher.h (revision 0) +++ branches/iFabio/Chameleon/i386/libsaio/smbios_patcher.h (revision 308) @@ -0,0 +1,66 @@ +/* + * Copyright 2008 mackerintel + */ +/* + * AsereBLN: cleanup + */ + +#ifndef __LIBSAIO_SMBIOS_PATCHER_H +#define __LIBSAIO_SMBIOS_PATCHER_H + +#include "libsaio.h" +#include "SMBIOS.h" + +extern char MacModel[8]; +extern unsigned int ModelRev; +extern uint64_t smbios_p; + + +/* From Foundation/Efi/Guid/Smbios/SmBios.h */ +/* Modified to wrap Data4 array init with {} */ +#define EFI_SMBIOS_TABLE_GUID {0xeb9d2d31, 0x2d88, 0x11d3, 0x9a, 0x16, {0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d}} + +#define SMBIOS_RANGE_START 0x000F0000 +#define SMBIOS_RANGE_END 0x000FFFFF + +#define SMBIOS_ORIGINAL 0 +#define SMBIOS_PATCHED 1 + +struct smbios_table_header +{ + uint8_t type; + uint8_t length; + uint16_t handle; +} __attribute__ ((packed)); + +struct smbios_property +{ + const char *name; + uint8_t table_type; + enum {SMSTRING, SMWORD, SMBYTE, SMOWORD} value_type; + int offset; + int (*auto_int) (const char *name, int table_num); + const char *(*auto_str) (const char *name, int table_num); + const char *(*auto_oword) (const char *name, int table_num); +}; + +struct smbios_table_description +{ + uint8_t type; + int len; + int (*numfunc)(int tablen); +}; + +/** call with flag SMBIOS_ORIGINAL to get orig. entrypoint + or call with flag SMBIOS_PATCHED to get patched smbios entrypoint +*/ +extern struct SMBEntryPoint *getSmbios(int); +extern struct DMIHeader* FindNextDmiTableOfType(int type, int minlen); +extern struct DMIHeader* FindFirstDmiTableOfType(int type, int minlen); +extern void getSmbiosProductName(); +const char *smbiosStringAtIndex(DMIHeader*, int index, int *length ); +extern bool scanDMI(void); +extern void scan_cpu_DMI(void); //PlatformInfo_t *); //Slice + + +#endif /* !__LIBSAIO_SMBIOS_PATCHER_H */ Index: branches/iFabio/Chameleon/i386/libsaio/mem.h =================================================================== --- branches/iFabio/Chameleon/i386/libsaio/mem.h (revision 0) +++ branches/iFabio/Chameleon/i386/libsaio/mem.h (revision 308) @@ -0,0 +1,15 @@ +/* + * Copyright 2010 AsereBLN. All rights reserved. + * + * mem.h + */ + +#ifndef __LIBSAIO_MEM_H +#define __LIBSAIO_MEM_H + +#include "platform.h" + +extern void scan_memory(); //PlatformInfo_t *); + + +#endif /* __LIBSAIO_MEM_H */ Index: branches/iFabio/Chameleon/i386/libsaio/ati.h =================================================================== --- branches/iFabio/Chameleon/i386/libsaio/ati.h (revision 0) +++ branches/iFabio/Chameleon/i386/libsaio/ati.h (revision 308) @@ -0,0 +1,46 @@ +/* + * ATI injector + * + * Copyright (C) 2009 Jasmin Fazlic, iNDi, netkas + * + * ATI injector is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * ATI driver and injector is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with ATI injector. If not, see . + */ + /* + * Alternatively you can choose to comply with APSL + */ + + +#ifndef __LIBSAIO_ATI_H +#define __LIBSAIO_ATI_H + +bool setup_ati_devprop(pci_dt_t *ati_dev); + +struct ati_chipsets_t { + unsigned device; + char *name; +}; + +struct ati_data_key { + uint32_t size; + char *name; + uint8_t data[]; +}; + +#define REG8(reg) ((volatile uint8_t *)regs)[(reg)] +#define REG16(reg) ((volatile uint16_t *)regs)[(reg) >> 1] +#define REG32R(reg) ((volatile uint32_t *)regs)[(reg) >> 2] +#define REG32W(reg, val) ((volatile uint32_t *)regs)[(reg) >> 2] = (val) + + +#endif /* !__LIBSAIO_ATI_H */ Index: branches/iFabio/Chameleon/i386/boot2/drivers.c =================================================================== --- branches/iFabio/Chameleon/i386/boot2/drivers.c (revision 307) +++ branches/iFabio/Chameleon/i386/boot2/drivers.c (revision 308) @@ -210,36 +210,46 @@ } } - // Also try to load Extensions from boot helper partitions. - if (gBootVolume->flags & kBVFlagBooter) + + if(!gHaveKernelCache) { - strcpy(dirSpecExtra, "/com.apple.boot.P/System/Library/"); - if (FileLoadDrivers(dirSpecExtra, 0) != 0) - { - strcpy(dirSpecExtra, "/com.apple.boot.R/System/Library/"); - if (FileLoadDrivers(dirSpecExtra, 0) != 0) + // Non-prelinked kernel, load system mkext. + // NOTE: In it's default state, XNU cannot be both prelinked, and load additional drivers + // from the bootloader. There is, however, a patch that changes this and allows + // for both to occure. + + // Also try to load Extensions from boot helper partitions. + if (gBootVolume->flags & kBVFlagBooter) { - strcpy(dirSpecExtra, "/com.apple.boot.S/System/Library/"); - FileLoadDrivers(dirSpecExtra, 0); + strcpy(dirSpecExtra, "/com.apple.boot.P/System/Library/"); + if (FileLoadDrivers(dirSpecExtra, 0) != 0) + { + strcpy(dirSpecExtra, "/com.apple.boot.R/System/Library/"); + if (FileLoadDrivers(dirSpecExtra, 0) != 0) + { + strcpy(dirSpecExtra, "/com.apple.boot.S/System/Library/"); + FileLoadDrivers(dirSpecExtra, 0); + } + } } - } - } - - if (gMKextName[0] != '\0') - { - verbose("LoadDrivers: Loading from [%s]\n", gMKextName); - if ( LoadDriverMKext(gMKextName) != 0 ) + + if (gMKextName[0] != '\0') { - error("Could not load %s\n", gMKextName); - return -1; + verbose("LoadDrivers: Loading from [%s]\n", gMKextName); + if ( LoadDriverMKext(gMKextName) != 0 ) + { + error("Could not load %s\n", gMKextName); + return -1; + } } + else + { + strcpy(gExtensionsSpec, dirSpec); + strcat(gExtensionsSpec, "System/Library/"); + FileLoadDrivers(gExtensionsSpec, 0); + } + } - else - { - strcpy(gExtensionsSpec, dirSpec); - strcat(gExtensionsSpec, "System/Library/"); - FileLoadDrivers(gExtensionsSpec, 0); - } } else { @@ -808,7 +818,10 @@ return -1; } } - + + // Notify modules that the kernel has been decompressed, is about to be decoded + execute_hook("DecodeKernel", (void*)binary, NULL, NULL, NULL); + ret = ThinFatFile(&binary, &len); if (ret == 0 && len == 0 && archCpuType==CPU_TYPE_X86_64) { Index: branches/iFabio/Chameleon/i386/boot2/boot.c =================================================================== --- branches/iFabio/Chameleon/i386/boot2/boot.c (revision 307) +++ branches/iFabio/Chameleon/i386/boot2/boot.c (revision 308) @@ -155,8 +155,7 @@ execute_hook("DecodedKernel", (void*)binary, NULL, NULL, NULL); // Load boot drivers from the specifed root path. - if (!gHaveKernelCache) - LoadDrivers("/"); + LoadDrivers("/"); clearActivityIndicator(); @@ -486,7 +485,7 @@ break; } - if(getBoolForKey(kUseKernelCache, &usecache, &bootInfo->bootConfig)) { + if(getBoolForKey(kUseKernelCache, &usecache, &bootInfo->bootConfig) && usecache) { if (getValueForKey(kKernelCacheKey, &val, &len, &bootInfo->bootConfig)) { strlcpy(gBootKernelCacheFile, val, len+1); } Index: branches/iFabio/Chameleon/package/buildpkg =================================================================== --- branches/iFabio/Chameleon/package/buildpkg (revision 307) +++ branches/iFabio/Chameleon/package/buildpkg (revision 308) @@ -10,7 +10,7 @@ COL_BLACK="\x1b[30;01m" COL_RED="\x1b[31;01m" -COL_GREEN="\x1b[32;01m" #COL_GREEN="\x1b[32;01m" +COL_GREEN="\x1b[32;01m" COL_YELLOW="\x1b[33;01m" COL_MAGENTA="\x1b[35;01m" COL_CYAN="\x1b[36;01m" Index: branches/iFabio/Chameleon/package/builddmg =================================================================== --- branches/iFabio/Chameleon/package/builddmg (revision 307) +++ branches/iFabio/Chameleon/package/builddmg (revision 308) @@ -1 +1,60 @@ #!/bin/bash + +# $1 Path to store built dmg + +DMG_ROOT="${0%/*}" + +OPENUP_TOOL=${1%/*}/i386/openUp + +SRC_FOLDER=$DMG_ROOT/source +VOLUME_NAME="Chameleon" +DMG_TEMP_NAME=${DMG_ROOT}/rw.${DMG_NAME} + + +# +# ========================== +# + +COL_BLACK="\x1b[30;01m" +COL_RED="\x1b[31;01m" +COL_GREEN="\x1b[32;01m" +COL_YELLOW="\x1b[33;01m" +COL_MAGENTA="\x1b[35;01m" +COL_CYAN="\x1b[36;01m" +COL_WHITE="\x1b[37;01m" +COL_BLUE="\x1b[34;01m" +COL_RESET="\x1b[39;49;00m" + +# +# ========================== +# + +version=$( cat version ) +stage=${version##*-} +revision=$( grep I386BOOT_CHAMELEONREVISION sym/i386/vers.h | awk '{ print $3 }' | tr -d '\"' ) +builddate=$( grep I386BOOT_BUILDDATE sym/i386/vers.h | awk '{ print $3,$4 }' | tr -d '\"' ) +timestamp=$( date -j -f "%Y-%m-%d %H:%M:%S" "${builddate}" "+%s" ) + +# +# Create a read-only disk image of the contents of a folder +# + + echo "=========== BUILD .DMG TEST ===========" + echo "" + echo "- Version: $version" + echo "- Stage: $stage" + echo "- Revision: $revision" + echo "- Build date: $builddate" + echo "- Time stamp: $timestamp" + echo "" + echo "- DMG path: $DMG_ROOT" + echo "- Source dir: $SRC_FOLDER" + echo "- Volume name: $VOLUME_NAME" + echo "- Temp dmg: $DMG_TEMP_NAME" + echo "" + echo "- OpenUp path: $OPENUP_TOOL" + echo "" + echo "================= END =================" + echo "" + +exit 0 Index: branches/iFabio/Chameleon/Makefile =================================================================== --- branches/iFabio/Chameleon/Makefile (revision 307) +++ branches/iFabio/Chameleon/Makefile (revision 308) @@ -103,6 +103,7 @@ dmg: all @if [ -e "$(SYMROOT)" ]; then \ sudo `pwd`/package/slimpkg `pwd`/sym/package; \ + sudo `pwd`/package/builddmg `pwd`/sym/package; \ fi; .PHONY: $(SYMROOT)/i386/vers.h