Index: branches/ErmaC/Trunk/i386/modules/Cconfig =================================================================== --- branches/ErmaC/Trunk/i386/modules/Cconfig (revision 2023) +++ branches/ErmaC/Trunk/i386/modules/Cconfig (revision 2024) @@ -7,5 +7,6 @@ source "i386/modules/klibc/Cconfig" source "i386/modules/uClibcxx/Cconfig" source "i386/modules/HelloWorld/Cconfig" +source "i386/modules/Sata/Cconfig" source "i386/modules/Keylayout/Cconfig" endmenu Index: branches/ErmaC/Trunk/i386/modules/Sata/Cconfig =================================================================== --- branches/ErmaC/Trunk/i386/modules/Sata/Cconfig (revision 0) +++ branches/ErmaC/Trunk/i386/modules/Sata/Cconfig (revision 2024) @@ -0,0 +1,10 @@ +# +# Chameleon Modules +# + +config SATA_MODULE + tristate "Sata Module" + default m + ---help--- + Say Y here if you want to enable the use of this module. + Index: branches/ErmaC/Trunk/i386/modules/Sata/Sata.c =================================================================== --- branches/ErmaC/Trunk/i386/modules/Sata/Sata.c (revision 0) +++ branches/ErmaC/Trunk/i386/modules/Sata/Sata.c (revision 2024) @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2011,2012 cparm . All rights reserved. + * + */ + +#include "libsaio.h" +#include "modules.h" +#include "bootstruct.h" +#include "pci.h" +#include "device_inject.h" +#include "platform.h" + +#ifndef DEBUG_SATA +#define DEBUG_SATA 0 +#endif + +#if DEBUG_SATA +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + +void SATA_hook(void* arg1, void* arg2, void* arg3, void* arg4); + +uint8_t default_SATA_ID[]= { + 0x81, 0x26, 0x00, 0x00 +}; +#define SATA_ID_LEN ( sizeof(default_SATA_ID) / sizeof(uint8_t) ) + +void SATA_hook(void* arg1, void* arg2, void* arg3, void* arg4) +{ + pci_dt_t* current = arg1; + struct DevPropDevice *device = NULL; + char *devicepath = NULL; + + if (current && current->class_id == PCI_CLASS_STORAGE_SATA) + { + if (!string) + { + string = devprop_create_string(); + if (!string) return; + } + devicepath = get_pci_dev_path(current); + if (!devicepath) return; + + device = devprop_add_device(string, devicepath); + if (!device) return; + + devprop_add_value(device, "device-id", default_SATA_ID, SATA_ID_LEN); + + verbose("SATA device : [%04x:%04x :: %04x], changed to ICH6 ESB2 \n", + current->vendor_id, current->device_id,current->class_id); + + } + +} + +void Sata_start(void); +void Sata_start(void) +{ + register_hook_callback("PCIDevice", &SATA_hook); +} + Index: branches/ErmaC/Trunk/i386/modules/Sata/Makefile =================================================================== --- branches/ErmaC/Trunk/i386/modules/Sata/Makefile (revision 0) +++ branches/ErmaC/Trunk/i386/modules/Sata/Makefile (revision 2024) @@ -0,0 +1,13 @@ +MODULE_NAME = Sata +MODULE_DESCRIPTION = This module help Sata devices to be recognized as internal +MODULE_AUTHOR = "Cparm" +MODULE_VERSION = "1.0.0" +MODULE_COMPAT_VERSION = "1.0.0" +MODULE_START = $(MODULE_NAME)_start +MODULE_DEPENDENCIES = + +DIR = Sata + +MODULE_OBJS = Sata.o + +include ../MakeInc.dir \ No newline at end of file Index: branches/ErmaC/Trunk/i386/modules/Makefile =================================================================== --- branches/ErmaC/Trunk/i386/modules/Makefile (revision 2023) +++ branches/ErmaC/Trunk/i386/modules/Makefile (revision 2024) @@ -33,6 +33,10 @@ SUBDIRS += Keylayout endif +ifdef CONFIG_SATA_MODULE +SUBDIRS += sata +endif + CFLAGS= -O3 $(MORECPP) -arch i386 -g -static DEFINES= CONFIG = hd Index: branches/ErmaC/Trunk/CHANGES =================================================================== --- branches/ErmaC/Trunk/CHANGES (revision 2023) +++ branches/ErmaC/Trunk/CHANGES (revision 2024) @@ -1,3 +1,5 @@ +- cparm : Added a Sata module, known as YellowIconFixer in my branch, useful to fix yellow icon issue (can also fix an issue with the apple's dvd player application in moutain lion) + , for now not added in the pkg script !!! - 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).