Index: branches/ErmaC/Trunk/i386/libsaio/nvidia_helper.c =================================================================== --- branches/ErmaC/Trunk/i386/libsaio/nvidia_helper.c (revision 0) +++ branches/ErmaC/Trunk/i386/libsaio/nvidia_helper.c (revision 2022) @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2012 cparm . All rights reserved. + * + */ + +#include "libsaio.h" +#include "bootstruct.h" +#include "xml.h" +#include "nvidia_helper.h" +#include "pci.h" +#include "nvidia.h" + +/* + + NVIDIA card injection usage e.g (to be placed in the boot.plist): + + NVIDIA + + + Chipset Name + Quadro FX 380 + IOPCIPrimaryMatch + 0x10DE0658 + VRam Size + 256 + + + Chipset Name + YOUR_CARD_NAME + IOPCIPrimaryMatch + YOUR_CARD_ID + IOPCISubDevId + YOUR_CARD_SUB_ID(if necessary) + VRam Size + YOUR_CARD_VRAM_SIZE + + + Chipset Name + YOUR_SECOND_CARD_NAME + IOPCIPrimaryMatch + YOUR_SECOND_CARD_ID + IOPCISubDevId + YOUR_SECOND_CARD_SUB_ID(if necessary) + VRam Size + YOUR_SECOND_CARD_VRAM_SIZE + + . + . + . + . + + + */ + +cardList_t* cardList = NULL; + +void add_card(char* model, uint32_t id, uint32_t subid, uint64_t videoRam) +{ + + cardList_t* new_card = malloc(sizeof(cardList_t)); + if (new_card) + { + new_card->next = cardList; + + cardList = new_card; + + new_card->id = id; + new_card->subid = subid; + new_card->videoRam = videoRam; + new_card->model = model; + } +} + +cardList_t* FindCardWithIds(uint32_t id, uint32_t subid) +{ + cardList_t* entry = cardList; + while(entry) + { + if((entry->id == id) && (entry->subid == subid)) + { + return entry; + } + else + { + entry = entry->next; + } + + } + + // LET A SECOND CHANCE by seaching only for the device-id + entry = cardList; + while(entry) + { + if((entry->id == id)) + { + return entry; + } + else + { + entry = entry->next; + } + + } + + return NULL; +} + +void fill_card_list(void) +{ + unsigned int i, count; + TagPtr NVDIATag; + char *model_name = NULL, *match_id = NULL, *sub_id = NULL, *vram_size = NULL; + uint32_t dev_id = 0, subdev_id = NV_SUB_IDS; + uint64_t VramSize = 0; + + if ((NVDIATag = XMLCastArray(XMLGetProperty(bootInfo->chameleonConfig.dictionary, (const char*)"NVIDIA")))) + { + count = XMLTagCount(NVDIATag); + + for (i=0; i. All rights reserved. + * + */ + + +#ifndef __LIBSAIO_NVIDIA_HELPER_H +#define __LIBSAIO_NVIDIA_HELPER_H + +typedef struct cardList_t +{ + char* model; + uint32_t id; + uint32_t subid; + uint64_t videoRam; + struct cardList_t* next; +} cardList_t; + +void add_card(char* model, uint32_t id, uint32_t subid, uint64_t videoRam); +void fill_card_list(void); +cardList_t* FindCardWithIds(uint32_t id, uint32_t subid); + +#endif //__LIBSAIO_NVIDIA_HELPER_H \ No newline at end of file Index: branches/ErmaC/Trunk/i386/boot2/boot.c =================================================================== --- branches/ErmaC/Trunk/i386/boot2/boot.c (revision 2021) +++ branches/ErmaC/Trunk/i386/boot2/boot.c (revision 2022) @@ -239,10 +239,10 @@ if (cacheFile[0] != 0) strlcpy(kernelCacheFile, cacheFile, sizeof(kernelCacheFile)); else { - // Mountain Lion and Lion prelink kernel cache file + // Lion and Mountain Lion prelink kernel cache file if ((checkOSVersion("10.7")) || (checkOSVersion("10.8"))) { sprintf(kernelCacheFile, "%skernelcache", kDefaultCachePathSnow); - } + } // Snow Leopard prelink kernel cache file else if (checkOSVersion("10.6")) { sprintf(kernelCacheFile, "kernelcache_%s", (archCpuType == CPU_TYPE_I386) Index: branches/ErmaC/Trunk/i386/util/bdmesg.c =================================================================== --- branches/ErmaC/Trunk/i386/util/bdmesg.c (revision 2021) +++ branches/ErmaC/Trunk/i386/util/bdmesg.c (revision 2022) @@ -32,7 +32,7 @@ const UInt8 *msglog = CFDataGetBytePtr((CFDataRef)bootLog); if (msglog) printf("%s\n", msglog); - + CFRelease(bootLog); return 0; } Index: branches/ErmaC/Trunk/doc/org.chameleon.Boot.nvidia.plist =================================================================== --- branches/ErmaC/Trunk/doc/org.chameleon.Boot.nvidia.plist (revision 0) +++ branches/ErmaC/Trunk/doc/org.chameleon.Boot.nvidia.plist (revision 2022) @@ -0,0 +1,31 @@ + + + + + Default Partition + + GraphicsEnabler + Yes + Kernel + mach_kernel + Kernel Flags + + NVIDIA + + + Chipset Name + Quadro FX 380 + IOPCIPrimaryMatch + 0x10DE0658 + IOPCISubDevId + 0x00000000 + VRam Size + 256 + + + Quiet Boot + No + Timeout + 5 + + Property changes on: branches/ErmaC/Trunk/doc/org.chameleon.Boot.nvidia.plist ___________________________________________________________________ Added: svn:executable + * Index: branches/ErmaC/Trunk/CHANGES =================================================================== --- branches/ErmaC/Trunk/CHANGES (revision 2021) +++ branches/ErmaC/Trunk/CHANGES (revision 2022) @@ -1,3 +1,4 @@ +- cparm : Ported the nvidia plist helper (less time to spend on the device id more time to code :-) ) - Added Recovery Icon for Default Theme (TODO) (credits to blackosx). - Merge Intel Graphics 4000 device IDs from Chimera (Commit 1999). - Merge more cparm's (security, stability, bugs fixes) improvements from his branch.