Index: branches/meklort/i386/libsaio/pci.c =================================================================== --- branches/meklort/i386/libsaio/pci.c (revision 550) +++ branches/meklort/i386/libsaio/pci.c (revision 551) @@ -20,7 +20,7 @@ #endif pci_dt_t *root_pci_dev; -static char* dev_path; +static char* dev_path; // TODO: Figure out what is going on here... uint8_t pci_config_read8(uint32_t pci_addr, uint8_t reg) @@ -137,7 +137,8 @@ void build_pci_dt(void) { - dev_path = malloc(sizeof(char) * 256); + dev_path = malloc(sizeof(char) * 256); // TODO: remove + root_pci_dev = malloc(sizeof(pci_dt_t)); bzero(root_pci_dev, sizeof(pci_dt_t)); enable_pci_devs(); @@ -150,11 +151,13 @@ char *get_pci_dev_path(pci_dt_t *pci_dt) { + char* buffer = malloc(sizeof(char) * 256); + pci_dt_t *current; pci_dt_t *end; char tmp[64]; - dev_path[0] = 0; + buffer[0] = 0; end = root_pci_dev; int uid = getPciRootUID(); @@ -174,9 +177,9 @@ sprintf(tmp, "/Pci(0x%x,0x%x)", current->dev.bits.dev, current->dev.bits.func); } - strcat(dev_path, tmp); + sprintf(buffer, "%s%s", buffer, tmp); } - return dev_path; + return buffer; } #ifndef OPTION_ROM Index: branches/meklort/i386/libsaio/saio_internal.h =================================================================== --- branches/meklort/i386/libsaio/saio_internal.h (revision 550) +++ branches/meklort/i386/libsaio/saio_internal.h (revision 551) @@ -172,7 +172,7 @@ extern long LoadVolumeFile(BVRef bvr, const char *fileSpec); extern long LoadFile(const char *fileSpec); extern long ReadFileAtOffset(const char * fileSpec, void *buffer, uint64_t offset, uint64_t length); -extern long LoadThinFatFile(const char *fileSpec, void **binary); +extern long LoadThinFatFile(const char *fileSpec, void **binary); extern long GetDirEntry(const char *dirSpec, long long *dirIndex, const char **name, long *flags, long *time); extern long GetFileInfo(const char *dirSpec, const char *name, Index: branches/meklort/i386/boot2/boot.c =================================================================== --- branches/meklort/i386/boot2/boot.c (revision 550) +++ branches/meklort/i386/boot2/boot.c (revision 551) @@ -140,11 +140,13 @@ bootArgs->kaddr = bootArgs->ksize = 0; + execute_hook("ExecKernel", (void*)binary, NULL, NULL, NULL); + ret = DecodeKernel(binary, &kernelEntry, (char **) &bootArgs->kaddr, (int *)&bootArgs->ksize ); - + if ( ret != 0 ) return ret; @@ -574,7 +576,6 @@ } else { /* Won't return if successful. */ // Notify modules that ExecKernel is about to be called - execute_hook("ExecKernel", binary, NULL, NULL, NULL); ret = ExecKernel(binary); } } Index: branches/meklort/i386/modules/USBFix/USBFix.c =================================================================== --- branches/meklort/i386/modules/USBFix/USBFix.c (revision 550) +++ branches/meklort/i386/modules/USBFix/USBFix.c (revision 551) @@ -25,7 +25,6 @@ void USBFix_start() { - //printf("Hooking 'ExecKernel'\n"); register_hook_callback("PCIDevice", &USBFix_pci_hook); register_hook_callback("Kernel Start", &USBFix_start_hook); Index: branches/meklort/i386/modules/GraphicsEnabler/GraphicsEnabler.c =================================================================== --- branches/meklort/i386/modules/GraphicsEnabler/GraphicsEnabler.c (revision 550) +++ branches/meklort/i386/modules/GraphicsEnabler/GraphicsEnabler.c (revision 551) @@ -15,8 +15,9 @@ #define kGraphicsEnabler "GraphicsEnabler" -void GraphicsEnabler_hook(void* arg1, void* arg2, void* arg3, void* arg4); +void GraphicsEnabler_hook(pci_dt_t* current, void* arg2, void* arg3, void* arg4); + void GraphicsEnabler_start() { register_hook_callback("PCIDevice", &GraphicsEnabler_hook); @@ -25,34 +26,35 @@ void GraphicsEnabler_hook(pci_dt_t* current, void* arg2, void* arg3, void* arg4) { - if(current->class_id != PCI_CLASS_DISPLAY_VGA) return; - - char *devicepath = get_pci_dev_path(current); - - bool do_gfx_devprop = false; - getBoolForKey(kGraphicsEnabler, &do_gfx_devprop, &bootInfo->bootConfig); - - if (do_gfx_devprop) + if(current && current->class_id == PCI_CLASS_DISPLAY_VGA) { - switch (current->vendor_id) + char *devicepath = get_pci_dev_path(current); + + bool do_gfx_devprop = false; + getBoolForKey(kGraphicsEnabler, &do_gfx_devprop, &bootInfo->bootConfig); + + + if (do_gfx_devprop) { - case PCI_VENDOR_ID_ATI: - verbose("ATI VGA Controller [%04x:%04x] :: %s \n", - current->vendor_id, current->device_id, devicepath); - setup_ati_devprop(current); - break; - - case PCI_VENDOR_ID_INTEL: - //message to be removed once support for these cards is added - verbose("Intel VGA Controller [%04x:%04x] :: %s (currently NOT SUPPORTED)\n", - current->vendor_id, current->device_id, devicepath); - break; - - case PCI_VENDOR_ID_NVIDIA: - setup_nvidia_devprop(current); - break; + switch (current->vendor_id) + { + case PCI_VENDOR_ID_ATI: + verbose("ATI VGA Controller [%04x:%04x] :: %s \n", + current->vendor_id, current->device_id, devicepath); + setup_ati_devprop(current); + break; + + case PCI_VENDOR_ID_INTEL: + //message to be removed once support for these cards is added + verbose("Intel VGA Controller [%04x:%04x] :: %s (currently NOT SUPPORTED)\n", + current->vendor_id, current->device_id, devicepath); + break; + + case PCI_VENDOR_ID_NVIDIA: + setup_nvidia_devprop(current); + break; + } } + } - - } Index: branches/meklort/i386/modules/GraphicsEnabler/nvidia.c =================================================================== --- branches/meklort/i386/modules/GraphicsEnabler/nvidia.c (revision 550) +++ branches/meklort/i386/modules/GraphicsEnabler/nvidia.c (revision 551) @@ -57,7 +57,7 @@ #include "nvidia.h" #ifndef DEBUG_NVIDIA -#define DEBUG_NVIDIA 1 +#define DEBUG_NVIDIA 0 #endif #if DEBUG_NVIDIA Index: branches/meklort/i386/modules/Makefile =================================================================== --- branches/meklort/i386/modules/Makefile (revision 550) +++ branches/meklort/i386/modules/Makefile (revision 551) @@ -27,7 +27,7 @@ # The order of building is important. # TODO: exclude Symbols from find so it isn't compiled twice -SUBDIRS = Symbols Resolution Memory KernelPatcher KextPatcher HelloWorld GUI GraphicsEnabler ACPIPatcher HPET USBFix +SUBDIRS = Symbols Resolution KernelPatcher KextPatcher HelloWorld GUI GraphicsEnabler ACPIPatcher HPET USBFix all embedtheme optionrom tags debug install installhdrs: @rm -rf $(OBJROOT) Index: branches/meklort/i386/modules/Ethernet/Ethernet.c =================================================================== --- branches/meklort/i386/modules/Ethernet/Ethernet.c (revision 550) +++ branches/meklort/i386/modules/Ethernet/Ethernet.c (revision 551) @@ -46,18 +46,30 @@ int devprop_add_network_template(struct DevPropDevice *device, uint16_t vendor_id) { - if(!device) - return 0; uint8_t builtin = 0x0; - if((vendor_id != 0x168c) && (builtin_set == 0)) + + if(device) { - builtin_set = 1; - builtin = 0x01; + + if((vendor_id != 0x168c) && (builtin_set == 0)) + { + builtin_set = 1; + builtin = 0x01; + } + + if(!devprop_add_value(device, "built-in", (uint8_t*)&builtin, 1)) + { + return 0; + } + + devices_number++; + return 1; } - if(!devprop_add_value(device, "built-in", (uint8_t*)&builtin, 1)) + else + { return 0; - devices_number++; - return 1; + } + } void set_eth_builtin(pci_dt_t *eth_dev)