Jump to content
2,188 posts in this topic

Recommended Posts

6 hours ago, Sherlocks said:

Sure. But just I need some other info:

On 5/22/2019 at 2:55 PM, Sherlocks said:

MacBookPro15,1 : REV rBR EPCI
MacBookPro15,2 : REV rBR EPCI
MacBookAir8,1  : REV rBR EPCI
Macmini8,1     : REV rBR EPCI
iMacPro1,1     : REV rBR EPCI

will newer models behave the same? why MacBookXX aren't there?

Link to comment
Share on other sites

@Sherlocks, @Slice please take a look the logic:

static inline bool isModelREVLess(const char * model) {
  /* no following keys starting from:
   MacBookPro15,1 : REV RBr RPlt
   MacBookPro15,2 : REV RBr RPlt
   MacBookAir8,1  : REV RBr RPlt
   Macmini8,1     : REV RBr RPlt
   iMacPro1,1     : REV RBr RPlt
   */
  bool result = false;
  long maj = 0;
  long rev = 0;
  
  const char *family[7] = { /* order is important */
    "MacPro",
    "MacBookAir",
    "MacBookPro",
    "MacBook",
    "Macmini",
    "iMacPro",
    "iMac"
  };
  
  if (!model) {
    return result;
  }
  
  for (int i = 0; i < 7; i++) {
    if (hw_strstr(model, family[i])) {
      char suffix[6], majStr[3], revStr[3]; // 15,10 (never seen but possible + null)
      
      // get the numeric part into a string
      snprintf(suffix, (strlen(model) - strlen(family[i])) + 1, "%s", model + strlen(family[i]));
      size_t commaIndex = 0;
      
      // get the comma position to split the suffix into a major and revision version:
      char c = suffix[commaIndex];
      do {
        if (c == ',') {
          break;
        }
        commaIndex++;
        c = suffix[commaIndex];
      } while (c != '\0');
      
      if (commaIndex == 0) {
        return result; // failure
      }
      // populate the two strings with major and revision version:
      snprintf(majStr, commaIndex + 1, "%s", suffix);
      snprintf(revStr, (strlen(suffix) - commaIndex) + 1, "%s", suffix + commaIndex + 1);
      
      // make it numbers:
      maj = strtol(majStr, (char **)NULL, 10);
      rev = strtol(revStr, (char **)NULL, 10);
      
      // Apple never took 0
      if (maj && rev) {
        // looks for a mach
        if (strncmp(family[i], "iMacPro", strlen("iMacPro")) == 0 &&
            ((maj == 1 && rev >= 1) || maj >= 1)) {
          result = true;
        } else if (strncmp(family[i], "Macmini", strlen("Macmini")) == 0 &&
                   ((maj == 8 && rev >= 1) || maj >= 8)) {
          result = true;
        } else if (strncmp(family[i], "MacBookAir", strlen("MacBookAir")) == 0 &&
                   ((maj == 8 && rev >= 1) || maj >= 8)) {
          result = true;
        } else if (strncmp(family[i], "MacBookPro", strlen("MacBookPro")) == 0 &&
                   ((maj == 15 && rev >= 1) || maj >= 15)) {
          result = true;
        }
      }
      break;
    }
  }
  
  return result;
}
    
IORegistryEntry * rootNode = IORegistryEntry::fromPath("/efi/platform", gIODTPlane);
  if (rootNode) {
    OSData *data = OSDynamicCast(OSData, rootNode->getProperty("Model"));
    OSData *model = OSData::withCapacity(64);
    const unsigned char* raw = static_cast<const unsigned char*>(data->getBytesNoCopy());
    
    for (int i = 0; i < data->getLength(); i += 2) {
      model->appendByte(raw[i], 1);
    }
    
    rev3 = isModelREVLess((const char *)model->getBytesNoCopy());
  }
  .....

if isModelREVLess() then don't add REV RBr RPlt keys or remove them if found.

Also every model grater then MacBookPro15,1 - MacBookAir8,1 -Macmini8,1  - iMacPro1,1, for example MacBookAir8,2 will not add these keys. Is fine?

 

P.S. Not yet tested, will be soon. Waiting you to know if the logic is correct.

Edited by vector sigma
code update
  • Like 1
Link to comment
Share on other sites

[mention=980913]Sherlocks[/mention], [mention=112217]Slice[/mention] please take a look the logic:

static inline bool needREVGreaterEqualTo3(IORegistryEntry * node) { // "/efi/platform" /* no following keys starting from: MacBookPro15,1 : REV rBR EPCI MacBookPro15,2 : REV rBR EPCI MacBookAir8,1  : REV rBR EPCI Macmini8,1     : REV rBR EPCI iMacPro1,1     : REV rBR EPCI */ bool result = false; long maj = 0; long rev = 0; if (node) {   char model[20];   OSData *data = OSDynamicCast(OSData, node->getProperty("Model"));   if (data && data->getLength() > 0) {     bcopy(data->getBytesNoCopy(), model, data->getLength());     const char *family[7] = { /* order is important */       "MacPro",       "MacBookAir",       "MacBookPro",       "MacBook",       "Macmini",       "iMacPro",       "iMac"     };     for (int i = 0; i         if (hw_strstr(model, family[i])) {         char suffix[6], majStr[3], revStr[3]; // 15,10 (never seen but possible + null)         // get the numeric part into a string         snprintf(suffix, (strlen(model) - strlen(family[i])) + 1, "%s", model + strlen(family[i]));         size_t commaIndex = 0;         // get the comma position to split the suffix into a major and revision version:         char c = suffix[commaIndex];         do {           if (c == ',') {             break;           }           commaIndex++;           c = suffix[commaIndex];         } while (c != '\0');         if (commaIndex == 0) {           return result; // failure         }         // populate the two strings with major and revision version:         snprintf(majStr, commaIndex + 1, "%s", suffix);         snprintf(revStr, (strlen(suffix) - commaIndex) + 1, "%s", suffix + commaIndex + 1);         // make it numbers:         maj = strtol(majStr, (char **)NULL, 10);         rev = strtol(revStr, (char **)NULL, 10);         // Apple never took 0         if (maj && rev) {           // looks for a mach           if (strncmp(family[i], "iMacPro", strlen("iMacPro")) == 0 &&               ((maj == 1 && rev >= 1) || maj >= 1)) {             result = true;           } else if (strncmp(family[i], "Macmini", strlen("Macmini")) == 0 &&                      ((maj == 8 && rev >= 1) || maj >= 8)) {             result = true;           } else if (strncmp(family[i], "MacBookAir", strlen("MacBookAir")) == 0 &&                      ((maj == 8 && rev >= 1) || maj >= 8)) {             result = true;           } else if (strncmp(family[i], "MacBookPro", strlen("MacBookPro")) == 0 &&                      ((maj == 15 && rev >= 1) || maj >= 15)) {             result = true;           }         }         break;       }     }   } } return result;}

if needREVGreaterEqualTo3() then don't add REV rBR EPCI keys or remove them if found.

Also every model grater then MacBookPro15,1 - MacBookAir8,1 -Macmini8,1  - iMacPro1,1, for example MacBookAir8,2 will not add these keys. Is fine?

 

P.S. Not yet tested, will be soon. Waiting you to know if the logic is correct.

 

looks great.

clover bootloader need check for model?

 

나의 SM-N960N 의 Tapatalk에서 보냄

Link to comment
Share on other sites

5 hours ago, Sherlocks said:

clover bootloader need check for model?

No is automatic and also remove any trace of them from "/efi/platform" if published by him, but needs to be tested with involved mac models, can you?

 

P.S. I have to correct my self. Keys not added are REV RBr and RPlt.

 

 

FakeSMC.kext.zip

Edited by vector sigma
code update
  • Like 1
Link to comment
Share on other sites

5小时前,矢量西格玛说:

否是自动的,如果由他发布,也会从“/ efi / platform”删除它们的任何痕迹,但是需要使用相关的mac模型进行测试,对吗?

 

PS我必须纠正自己。未添加的键是REV RBr和RPlt。

 

 

FakeSMC.kext.zip

ok!
 

Edited by jinbingmao
  • Like 1
Link to comment
Share on other sites

1 hour ago, jinbingmao said:

ok!

You have to ensure to load FakeSMC.kext and plugins from the same branch, that is only from the trunk (master) or only from the development branch. This last is used only for experimentation and only when everythings will be fine, changes will be applied to the trunk. Not yet ready.... we have a job ;)

5 minutes ago, Sherlocks said:

thanks vector. it's great

Thanks. Tested?

Link to comment
Share on other sites

12 minutes ago, vector sigma said:

您必须确保从同一分支加载FakeSMC.kext和插件,该分支仅来自主干(主)或仅来自开发分支。最后一个仅用于实验,只有当每一件事都没有问题时,才会对行李箱进行更改。还没准备好....我们有工作 ;)

谢谢。测试?

QQ20190607-072228@2x.png.a09ae78c066c4d2daf4624a40b806b3c.png

Link to comment
Share on other sites

At present, the South Bridge temperature of the main board Z87 chipset is not monitored. Everything else is complete. It's really comprehensive. It's a great job to go beyond history.

  

target speed= 目标速度

Byte Limitation

  • Like 1
Link to comment
Share on other sites

27 minutes ago, jinbingmao said:

At present, the South Bridge temperature of the main board Z87 chipset is not monitored

I need to know more about temperature for your chips. Maybe a dump made in windows or linux can help me?

 

27 minutes ago, jinbingmao said:

Byte Limitation

Yep, only 12 bytes allowed and your is longer:

50 72 6F 63 65 73 73 6F 72 20 46 61 6E 27

... but we can fix it by giving a shorter name and let the app translate it to any. Example:

"CPU" = "My cool processor's Fan"; :angel:

Edited by vector sigma
Link to comment
Share on other sites

6 minutes ago, jinbingmao said:

When the temperature is below the critical temperature, the fan is the target speed.  

I'm not sure to understand you, but in W836x.kext you can choose to let the motherboard doing its job automatically. An 'alarm' will always work if temperature is accurate. Usually I set to the low level possible even if the cpu increase 2 or 3 degrees as I love silence, but others that play with overclocking may need the possibility to go at max during their test stress. For all others.... imho just let the bios decide!

Just now, jinbingmao said:

fan=风扇

no need for this. Just CPU as fan name will be enough. The app knows is it a fan, so the app will show a more descriptive string. To be implemented, but is so easy to be done...

Link to comment
Share on other sites

6 minutes ago, vector sigma said:

我不太了解你,但在W836x.kext中你可以选择让主板自动完成它的工作。如果温度准确,“警报”将始终有效。通常我设置为低级别,即使cpu增加2或3度因为我喜欢沉默,但其他玩超频可能需要在测试压力期间达到最大值。对于所有其他人...... imho只是让bios决定!

不需要这个。只需CPU作为粉丝名称即可。该应用程序知道它是一个粉丝,因此该应用程序将显示更具描述性的字符串。要实施,但很容易做到......

1.png

Link to comment
Share on other sites

On 6/6/2019 at 9:17 PM, vector sigma said:

@Sherlocks, @Slice please take a look the logic:


static inline bool isModelREVLess(const char * model) {
  /* no following keys starting from:
   MacBookPro15,1 : REV RBr RPlt
   MacBookPro15,2 : REV RBr RPlt
   MacBookAir8,1  : REV RBr RPlt
   Macmini8,1     : REV RBr RPlt
   iMacPro1,1     : REV RBr RPlt
   */
  bool result = false;
  long maj = 0;
  long rev = 0;
  
  const char *family[7] = { /* order is important */
    "MacPro",
    "MacBookAir",
    "MacBookPro",
    "MacBook",
    "Macmini",
    "iMacPro",
    "iMac"
  };
  
  if (!model) {
    return result;
  }
  
  for (int i = 0; i < 7; i++) {
    if (hw_strstr(model, family[i])) {
      char suffix[6], majStr[3], revStr[3]; // 15,10 (never seen but possible + null)
      
      // get the numeric part into a string
      snprintf(suffix, (strlen(model) - strlen(family[i])) + 1, "%s", model + strlen(family[i]));
      size_t commaIndex = 0;
      
      // get the comma position to split the suffix into a major and revision version:
      char c = suffix[commaIndex];
      do {
        if (c == ',') {
          break;
        }
        commaIndex++;
        c = suffix[commaIndex];
      } while (c != '\0');
      
      if (commaIndex == 0) {
        return result; // failure
      }
      // populate the two strings with major and revision version:
      snprintf(majStr, commaIndex + 1, "%s", suffix);
      snprintf(revStr, (strlen(suffix) - commaIndex) + 1, "%s", suffix + commaIndex + 1);
      
      // make it numbers:
      maj = strtol(majStr, (char **)NULL, 10);
      rev = strtol(revStr, (char **)NULL, 10);
      
      // Apple never took 0
      if (maj && rev) {
        // looks for a mach
        if (strncmp(family[i], "iMacPro", strlen("iMacPro")) == 0 &&
            ((maj == 1 && rev >= 1) || maj >= 1)) {
          result = true;
        } else if (strncmp(family[i], "Macmini", strlen("Macmini")) == 0 &&
                   ((maj == 8 && rev >= 1) || maj >= 8)) {
          result = true;
        } else if (strncmp(family[i], "MacBookAir", strlen("MacBookAir")) == 0 &&
                   ((maj == 8 && rev >= 1) || maj >= 8)) {
          result = true;
        } else if (strncmp(family[i], "MacBookPro", strlen("MacBookPro")) == 0 &&
                   ((maj == 15 && rev >= 1) || maj >= 15)) {
          result = true;
        }
      }
      break;
    }
  }
  
  return result;
}
    
IORegistryEntry * rootNode = IORegistryEntry::fromPath("/efi/platform", gIODTPlane);
  if (rootNode) {
    OSData *data = OSDynamicCast(OSData, rootNode->getProperty("Model"));
    OSData *model = OSData::withCapacity(64);
    const unsigned char* raw = static_cast<const unsigned char*>(data->getBytesNoCopy());
    
    for (int i = 0; i < data->getLength(); i += 2) {
      model->appendByte(raw[i], 1);
    }
    
    rev3 = isModelREVLess((const char *)model->getBytesNoCopy());
  }
  .....

if isModelREVLess() then don't add REV RBr RPlt keys or remove them if found.

Also every model grater then MacBookPro15,1 - MacBookAir8,1 -Macmini8,1  - iMacPro1,1, for example MacBookAir8,2 will not add these keys. Is fine?

 

P.S. Not yet tested, will be soon. Waiting you to know if the logic is correct.

 

@vector sigma

i checked latest build.

need to change like this

 

MacBookPro15,1 : REV RBr RPlt
MacBookPro15,2 : REV RBr RPlt
MacBookAir8,1  : REV RBr RPlt
Macmini8,1     : REV RBr RPlt
iMacPro1,1     : REV RBr RPlt

 

to

 

MacBookPro15,1 : REV RBr EPCI
MacBookPro15,2 : REV RBr EPCI
MacBookAir8,1  : REV RBr EPCI
Macmini8,1     : REV RBr EPCI
iMacPro1,1     : REV RBr EPCI

Edited by Sherlocks
Link to comment
Share on other sites

18 minutes ago, Sherlocks said:

to

 

MacBookPro15,1 : REV RBr EPCI
MacBookPro15,2 : REV RBr EPCI
MacBookAir8,1  : REV RBr EPCI
Macmini8,1     : REV RBr EPCI
iMacPro1,1     : REV RBr EPCI

Can you test it before another commit?

 

FakeSMC.kext.zip

Take into account that for MacBookPro15,3+, MacBookAir8,2 +, Macmini8,2 + and iMacPro1,2 + will do the same.

  • Like 1
Link to comment
Share on other sites

1 hour ago, vector sigma said:

Can you test it before another commit?

 

FakeSMC.kext.zip

Take into account that for MacBookPro15,3+, MacBookAir8,2 +, Macmini8,2 + and iMacPro1,2 + will do the same.

 

347274558_2019-06-081_25_30.png.46d9126c3095e3787e35f92589b9c5db.png

 

great. 

i wonder if macbook11,1 or imac20,1 have t2 chip(smc3), probably will update fakesmc in future?

  • Thanks 1
Link to comment
Share on other sites

13 minutes ago, Sherlocks said:

 

347274558_2019-06-081_25_30.png.46d9126c3095e3787e35f92589b9c5db.png

 

great. 

i wonder if macbook11,1 or imac20,1 have t2 chip(smc3), probably will update fakesmc in future?

I made another change in the mean time:

char argBuf[16];
  if (PE_parse_boot_argn("-withREV", &argBuf, sizeof(argBuf))) {
    isRevLess = false;
  } else if (PE_parse_boot_argn("-noREV", &argBuf, sizeof(argBuf))) {
    isRevLess = true;
  } else {
    IORegistryEntry * rootNode = IORegistryEntry::fromPath("/efi/platform", gIODTPlane);
    if (rootNode) {
      OSData *data = OSDynamicCast(OSData, rootNode->getProperty("Model"));
      OSData *model = OSData::withCapacity(64);
      const unsigned char* raw = static_cast<const unsigned char*>(data->getBytesNoCopy());
      
      for (int i = 0; i < data->getLength(); i += 2) {
        model->appendByte(raw[i], 1);
      }
      
      isRevLess = isModelREVLess((const char *)model->getBytesNoCopy());
    }
  }

-withREV will add all the keys

-noREV will remove REV and others

nothing, automatic... and will we have time to update and users happy.

Edited by vector sigma
code update
  • Like 1
Link to comment
Share on other sites

8 minutes ago, vector sigma said:

I made another change in the mean time:


char argBuf[16];
  if (PE_parse_boot_argn("-withREV", &argBuf, sizeof(argBuf))) {
    isRevLess = false;
  } else if (!PE_parse_boot_argn("-noREV", &argBuf, sizeof(argBuf))) {
    IORegistryEntry * rootNode = IORegistryEntry::fromPath("/efi/platform", gIODTPlane);
    if (rootNode) {
      OSData *data = OSDynamicCast(OSData, rootNode->getProperty("Model"));
      OSData *model = OSData::withCapacity(64);
      const unsigned char* raw = static_cast<const unsigned char*>(data->getBytesNoCopy());
      
      for (int i = 0; i < data->getLength(); i += 2) {
        model->appendByte(raw[i], 1);
      }
      
      isRevLess = isModelREVLess((const char *)model->getBytesNoCopy());
    }
  }

-withREV will add all the keys

-noREV will remove REV and others

nothing, automatic... and will we have time to update and users happy.

 

thanks. can you cleanup platformdata for future with maintenance?

for example

https://sourceforge.net/p/cloverefiboot/code/HEAD/tree/rEFIt_UEFI/Platform/platformdata.c#l223

{ 0x02, 0x45, 0x0f, 0, 0, 0x00 }, "2018mbp", "j680", 0xf0a009 }, // there are no BIOS REV rBR EPCI

to

NULL, NULL, "j680", NULL },

 

if has smc3, don't add it blow

https://sourceforge.net/p/cloverefiboot/code/HEAD/tree/rEFIt_UEFI/Platform/DataHubCpu.c#l458

https://sourceforge.net/p/cloverefiboot/code/HEAD/tree/rEFIt_UEFI/Platform/DataHubCpu.c#l467

 

it's just suggestion. or if you have a better idea

Edited by Sherlocks
Link to comment
Share on other sites

×
×
  • Create New...