Jump to content
3205 posts in this topic

Recommended Posts

Hi,

 

One other thing with Nvidia injection.

 

I've a GT 640 that have a bad EFI bios.

If I choose Nvidia injection screen is coming scrambled.

 

Need to add this injection to get OK:

                           "NVDA,noEFI", 
                            Buffer (0x05)
                            {
                                "true"
                            }, 

It should be interesting to get an option in clover to select or not for people who get same trouble like me.

 

Another point is memory size detected in in case of injection, I do this modification to get good size.

 
} else { // >= NV_ARCH_C0
        
       // ctrlr_num = nv_rd32(dev, NVC0_MEM_CTRLR_COUNT);
       // ctrlr_amt = nv_rd32(dev, NVC0_MEM_CTRLR_RAM_AMOUNT);
       // dev_priv->vram_size = ctrlr_num * (ctrlr_amt << 20);
        
//vram_size = LShiftU64(REG32(nvda_dev->regs, NVC0_MEM_CTRLR_RAM_AMOUNT), 20);
        
         vram_size = LShiftU64(2 * REG32(nvda_dev->regs, NVC0_MEM_CTRLR_RAM_AMOUNT), 20);
        
 
        
      //  vram_size = REG32(nvda_dev->regs, NVC0_MEM_CTRLR_RAM_AMOUNT);
    // vram_size *= REG32(nvda_dev->regs, NVC0_MEM_CTRLR_COUNT);
       // vram_size = MultU64x32(vram_size, REG32(nvda_dev->regs, NVC0_MEM_CTRLR_COUNT));
        //vram_size =  REG32(nvda_dev->regs, NVC0_MEM_CTRLR_COUNT);
 
}
 

Fred

 

 

Same thing with StriStr. 

 

EDIT

 

i change test != to ==:

      gDriversFlags.HFSLoaded = TRUE;

    } else if (StrStr(FileName, L"apfs") == NULL) {

      gDriversFlags.APFSLoaded = TRUE;

 

And same trouble, mean that the trouble is not on this line !

 

what about that :

0:141  0:000  PlatformDriverOverrideProtocol not found. Installing ... Success

 

EDIT:

It was my fault !

I did not copy main and menu in the good directory.

Need also to change StrStr to StriStr on apfs test.

Don't know why, name is in EFI/CLOVER/drivers64UEFI apfs.efi and show APFS!

 

 

Fred

 

hello Fred.

can you upload your GT 640 clover log?

 

thanks in advance

Hello,

 

i'vent logs, what do you want to know ? (ATM don't use clover)

 

Fred

 

i saw your report about ram size issue.

http://www.insanelymac.com/forum/topic/306156-clover-bugissue-report-and-patch/page-107?do=findComment&comment=2443062

 

i fixed it with PMheart on r4166

 

thank you again. :)

  • Like 1

nvidiaNoEFI and nvidiaSingle

 

GUI.png

 

within the Clover GUI

 

 

diff --git a/rEFIt_UEFI/Platform/Settings.c b/rEFIt_UEFI/Platform/Settings.c
index d93e0d63..28c6eb5a 100644
--- a/rEFIt_UEFI/Platform/Settings.c
+++ b/rEFIt_UEFI/Platform/Settings.c
@@ -4162,6 +4162,9 @@ GetUserSettings(
       Prop = GetProperty (DictPointer, "NvidiaGeneric");
       gSettings.NvidiaGeneric = IsPropertyTrue (Prop);
 
+      Prop = GetProperty (DictPointer, "NvidiaNoEFI");
+      gSettings.NvidiaNoEFI = IsPropertyTrue (Prop);
+
       Prop = GetProperty (DictPointer, "NvidiaSingle");
       gSettings.NvidiaSingle = IsPropertyTrue (Prop);
 
diff --git a/rEFIt_UEFI/refit/menu.c b/rEFIt_UEFI/refit/menu.c
index eb2df983..71a48838 100644
--- a/rEFIt_UEFI/refit/menu.c
+++ b/rEFIt_UEFI/refit/menu.c
@@ -663,6 +663,10 @@ VOID FillInputs(BOOLEAN New)
   }
   UnicodeSPrint(InputItems[InputItemsCount++].SValue, 16, L"%01x", gSettings.DualLink);
 
+  InputItems[InputItemsCount].ItemType = BoolValue; //110
+  InputItems[InputItemsCount++].BValue = gSettings.NvidiaNoEFI;
+  InputItems[InputItemsCount].ItemType = BoolValue; //111
+  InputItems[InputItemsCount++].BValue = gSettings.NvidiaSingle;
 
   //menu for drop table
   if (gSettings.ACPIDropTables) {
@@ -1233,6 +1237,16 @@ VOID ApplyInputs(VOID)
     DBG("applied DualLink=%x\n", gSettings.DualLink);
   }
 
+  i++; //110
+  if (InputItems[i].Valid) {
+    gSettings.NvidiaNoEFI = InputItems[i].BValue;
+  }
+
+  i++; //111
+  if (InputItems[i].Valid) {
+    gSettings.NvidiaSingle = InputItems[i].BValue;
+  }
+
   if (NeedSave) {
     SaveSettings();
   }
@@ -4026,6 +4040,8 @@ REFIT_MENU_ENTRY  *SubMenuGraphics()
     // ErmaC: NvidiaGeneric entry
     if (gGraphics[i].Vendor == Nvidia) {
       AddMenuItem(SubScreen, 55, "Generic NVIDIA name", TAG_INPUT, FALSE);
+      AddMenuItem(SubScreen, 111, "NVIDIA single", TAG_INPUT, FALSE);
+      AddMenuItem(SubScreen, 110, "NVIDIA no EFI", TAG_INPUT, FALSE);
       AddMenuItem(SubScreen, 56, "Use NVIDIA WEB drivers", TAG_INPUT, FALSE);
     }
 

 

or

https://github.com/fabiomartino/cloverefiboot/commit/185feb0d6f091376ed5f9d11f554d2b3fc020aaf.diff

 

THX to carlo_67 and gengik84 for test

 

Cordially

 

ErmaC

  • Like 5

@Sherlocks

 

Please...

You missed the change for setting.c in the commit 4170... the patch is not complete...

 

ErmaC

I checked it. I added it before.

 

Edit1. Okay. I will commit with HS DP6 platform patch. Thanks

 

나의 LG-F800S 의 Tapatalk에서 보냄

  • Like 2

I checked it. I added it before.

 

Edit1. Okay. I will commit with HS DP6 platform patch. Thanks

 

나의 LG-F800S 의 Tapatalk에서 보냄

Sorry...

I'm blind :o and confused.... I haven't see it!

https://sourceforge.net/p/cloverefiboot/code/4170/tree/rEFIt_UEFI/Platform/Settings.c#l2941

 

ErmaC

  • Like 1

 

you added nvidia generlic and single on two parts before. also added here?

https://sourceforge.net/p/cloverefiboot/code/4170/tree/rEFIt_UEFI/Platform/Settings.c#l4399

 

EDIT1.

strange. generic and single have two parts. but there are no two parts from other patches. it seems that is not clean

 

EDIT2.

i have a nvidia graphic. will check with debug.

Right!

 

:o so is present twice...

BAD this duplicated part is there since very long time...

will be better remove the duplicated present in the line 2937-2945

and check for the missed part around line 4390... if any

 

then made test...

 

Sorry

 

ErmaC

  • Like 1

Right!

 

:o so is present twice...

BAD this duplicated part is there since very long time...

will be better remove the duplicated present in the line 2937-2945

and check for the missed part around line 4390... if any

 

then made test...

 

Sorry

 

ErmaC

Removed line and tested it. There is no problem.

But in gui, i found strange issue for only menu.c

 

If press spacebar or enter to check No efi in gui, gui stop. generic and web driver are no problem for check/uncheck. I have to press reboot button. Strange..

 

 

나의 LG-F800S 의 Tapatalk에서 보냄

Haha, who would have thought I knew how clover behaves! If a config.plist is found for your system then that OEM folder becomes the root instead of \EFI\CLOVER, for ACPI tables (DSDT/SSDTs), injected kexts and config.plist (maybe some more stuff, unsure, but your patched ACPI tables may not be loading if you just switched to using OEM folders and didn't move those too). If I recall, you can also create a boot entry with boot arguments and pass the path to a config.plist that you want to use as the argument. I think it's relative to the root folder, I can't exactly remember. But I think only efibootmgr in linux will allow you to add arguments and your firmware may not correctly use them...

  • Like 1

today, i checked FixHeaders_20000000 features.

still no luck.

i have two null oem table id files

here

 

tested cases

case1

only checked FixHeaders_20000000 without drop.

-no luck, get mach_reboot panic

 

case2

drop two acpi table

- can skip mach_reboot panic

 

thanks in advance

NULL ACPI Table.zip

As reported by @gujiangjiang in the the General discussion thread, Clover doesn't detect the SPD vendor for SK Hynix DDR4 DIMMs. Adding the proper bank/code IDs to memvendors.h should fix that:

 

Platform/memvendors: Add SK Hynix DDR4 vendor bank/code IDs

 

However, it appears that there are only a few bank/code IDs for DDR4 DIMMs in memvendors.h, so it might make sense to use the SMBIOS vendor if the SPD vendor isn't detected ("NoName" returned by getVendorName in spd.c). The following patch should do this (but only if the SMBIOS is trusted):

 

Platform/smbios: Use SMBIOS RAM vendor if SPD RAM vendor is unknown

  • Like 4

Very thanks for this fix and i test it works well.

 

However the SerialNumber are still wrong.Can we fix the SerialNumber?

0:149  0:048  === [ Get Smbios ] ========================================
0:149  0:000  Type 16 Index = 0
0:149  0:000  Total Memory Slots Count = 2
0:149  0:000  Type 17 Index = 0
0:149  0:000  SmbiosTable.Type17->Speed = 2133MHz
0:149  0:000  SmbiosTable.Type17->Size = 8192MB
0:149  0:000  SmbiosTable.Type17->Bank/Device = DIMM A DIMM A
0:149  0:000  SmbiosTable.Type17->Vendor = SK Hynix
0:149  0:000  SmbiosTable.Type17->SerialNumber = 12161215
0:149  0:000  SmbiosTable.Type17->PartNumber = HMA41GS6AFR8N-TF    
0:149  0:000  Type 17 Index = 1
0:149  0:000  SmbiosTable.Type17->Speed = 2133MHz
0:149  0:000  SmbiosTable.Type17->Size = 8192MB
0:149  0:000  SmbiosTable.Type17->Bank/Device = DIMM B DIMM B
0:149  0:000  SmbiosTable.Type17->Vendor = SK Hynix
0:149  0:000  SmbiosTable.Type17->SerialNumber = 12121212
0:149  0:000  SmbiosTable.Type17->PartNumber = HMA41GS6AFR8N-TF    
0:149  0:000  Boot status=0
0:149  0:000  Running on: 'XPS 15 9550' with board '0N7TVV'
2:069  0:000  === [ ScanSPD ] ===========================================
2:070  0:000  SMBus device : 8086 A123 class=0C0500 status=Success
2:070  0:000  SMBus CmdReg: 0x3
2:070  0:000  Scanning SMBus [8086:A123], mmio: 0xDD132004, ioport: 0xF040, hostc: 0x11
2:070  0:000  Slots to scan [8]...
2:070  0:000  SPD[0]: Type 12 @0x50
2:088  0:017  Not using XMP because it is not present
2:088  0:000  DDR speed 2132MHz
2:088  0:000  Slot: 0 Type 26 8192MB 2132MHz Vendor=SK Hynix PartNo=HMA41GS6AFR8N-TF SerialNo=0301070A0303080A
2:089  0:000  SPD[2]: Type 12 @0x52
2:106  0:017  Not using XMP because it is not present
2:106  0:000  DDR speed 2132MHz
2:106  0:000  Slot: 2 Type 26 8192MB 2132MHz Vendor=SK Hynix PartNo=HMA41GS6AFR8N-TF SerialNo=0301070A0403090D
7:370  0:000  === [ PatchSmbios ] =======================================
7:370  0:000  insert table 9 for dev 0:0
7:370  0:000  Trusting SMBIOS...
7:370  0:000  Detected alternating SMBIOS channel banks
7:370  0:000  Channels: 2
7:370  0:000  Interleave: 0 2 1 3 4 6 5 7 8 10 9 11 12 14 13 15 16 18 17 19 20 22 21 23
7:370  0:000   partNum=HMA41GS6AFR8N-TF    
7:370  0:000  SMBIOS Type 17 Index = 0 => 0 0:
7:370  0:000  BANK 0 DIMM0 2133MHz 8192MB
7:370  0:000   partNum=HMA41GS6AFR8N-TF    
7:370  0:000  SMBIOS Type 17 Index = 1 => 1 2:
7:370  0:000  BANK 1 DIMM0 2133MHz 8192MB
7:370  0:000  mTotalSystemMemory = 16384
7:370  0:000  NumberOfMemoryDevices = 2
7:370  0:000  Type20[0]->End = 0x7FFFFF, Type17[0] = 0x2000
7:370  0:000  Type20[1]->End = 0xFFFFFF, Type17[1] = 0x6000
7:370  0:000  Table 131 is present, CPUType=31
7:370  0:000  Change to: 705

post-1140626-0-53185900-1503387204_thumb.png

 

And @Sherlocks we can add this fix to Clover code.

 

 

@TheRacerMaster

 

I found a bug with this fix.The ram in "about this mac" was disappeared.

post-1140626-0-95142600-1503388170_thumb.png

Hello

I have problem with every clover version above 4128. If I update clover, patch for fo IONVMeFamily won't work. 

<dict>
				<key>Comment</key>
				<string>IONVMeFamily Preferred Block Size 0x10 -> 0x01 (c) Pike R. Alpha</string>
				<key>Disabled</key>
				<false/>
				<key>Find</key>
				<data>
				9sEQD4VBAQAA
				</data>
				<key>Name</key>
				<string>IONVMeFamily</string>
				<key>Replace</key>
				<data>
				9sEBD4UcAQAA
				</data>
			</dict>
			<dict>
				<key>Comment</key>
				<string>external Icon</string>
				<key>Disabled</key>
				<false/>
				<key>Find</key>
				<data>
				SIXAdAc=
				</data>
				<key>Name</key>
				<string>IONVMeFamily</string>
				<key>Replace</key>
				<data>
				SIXAZpA=
				</data>
			</dict>
			<dict>

System wont boot and froze on this message: post-916820-0-64810100-1503389645_thumb.jpg

 

Last working version is Clover 4128. Im using HighSierra DP7

As reported by @gujiangjiang in the the General discussion thread, Clover doesn't detect the SPD vendor for SK Hynix DDR4 DIMMs. Adding the proper bank/code IDs to memvendors.h should fix that:

 

Platform/memvendors: Add SK Hynix DDR4 vendor bank/code IDs

 

However, it appears that there are only a few bank/code IDs for DDR4 DIMMs in memvendors.h, so it might make sense to use the SMBIOS vendor if the SPD vendor isn't detected ("NoName" returned by getVendorName in spd.c). The following patch should do this (but only if the SMBIOS is trusted):

 

Platform/smbios: Use SMBIOS RAM vendor if SPD RAM vendor is unknown

 

Yeah, the vendor bank needed updated for a while. Weird thing is that it used to use SMBIOS over SPD if SMBIOS/Trust=true (which it is by default unless your SMBIOS is detected to be totally screwed). So unsure what happened....

Yeah, the vendor bank needed updated for a while. Weird thing is that it used to use SMBIOS over SPD if SMBIOS/Trust=true (which it is by default unless your SMBIOS is detected to be totally screwed). So unsure what happened....

 

I test the smbios.h patch and find vendor correct but there is no "RAM" section in "About This Mac".

 

Does SMBIOS and SPD have 2 different infomation about ram?

I test the smbios.h patch and find vendor correct but there is no "RAM" section in "About This Mac".

 

Does SMBIOS and SPD have 2 different infomation about ram?

Can you do a DarwinDump without the Clover patches, and then one with the patches?

  • Like 1

With no patch shows NoName Vendor but has RAM in About This Mac.

NoName.zip

 

With your patch shows SK Hynix but the RAM in About This Mac was disappeared and the RAM SN Number are wrong.

NoRAM.zip

 

Thanks.

@TheRacerMaster @Sherlocks

 

I found the RAM disappeared is not related with the patch because i update Official Clover R4184 and ram vendor show unknow but still have no RAM in About This Mac.

 

So i think it maybe the platformdata or smbios error or FirmwareFeatures data error cause the RAM disappear.

 

Update:

Sorry for mistake.

 

Thanks to @syscl found the real MacBookPro2017 dont have RAM in About This Mac yet so the "NO RAM" is correct for MBP13x and MBP14x.

 

Thanks.

As reported by @gujiangjiang in the the General discussion thread, Clover doesn't detect the SPD vendor for SK Hynix DDR4 DIMMs. Adding the proper bank/code IDs to memvendors.h should fix that:

 

Platform/memvendors: Add SK Hynix DDR4 vendor bank/code IDs

 

However, it appears that there are only a few bank/code IDs for DDR4 DIMMs in memvendors.h, so it might make sense to use the SMBIOS vendor if the SPD vendor isn't detected ("NoName" returned by getVendorName in spd.c). The following patch should do this (but only if the SMBIOS is trusted):

 

Platform/smbios: Use SMBIOS RAM vendor if SPD RAM vendor is unknown

Thank you for the patches, committed to r4186.

 

@gujiangjiang @TheRacerMaster Actually no memory tab in "About This Mac" is not a bug on newer platforms, I checked Memory tab disappear on my MacBookPro(2017, Kabylake) and Dell Precision M3800(Haswell), they both miss the tab Memory on "About This Mac"

post-950366-0-68095000-1503489827_thumb.jpeg

 

syscl

  • Like 4

The platform-feature changes in Clover are the cause of the memory tab disappearing. In your NoName dump, you were running r4173, which didn't inject a platform-feature value into SMBIOS table type 133. In your NoRAM dump, you were running r4182, which does inject a model-specific platform-feature value into SMBIOS table type 133 (this was enabled in r4175 by Sherlocks). MacBookPro13,3/14,3 use 0x1A (26) as the platform-feature value, which is responsible for the disappearance of the memory tab (which makes sense, as those models have soldered RAM).

 

I did some reversing of AppleSystemInfo.framework & SPMemoryReporter to confirm this. SPMemoryReporter (/System/Library/System Profiler/SPMemoryReporter.spreporter) is responsible for updating the memory section in System Information. In updateDictionary, it sets Upgradeable Memory (in System Information/Memory) to either Yes or No depending on a few factors.

//----- (0000000000001059) ----------------------------------------------------
// SPMemoryReporter - (id)updateDictionary:(id) 
id __cdecl -[SPMemoryReporter updateDictionary:](struct SPMemoryReporter *self, SEL a2, id a3)
{
  ...
  // Get the SMBIOS product name
  CFStringRef v4 = ASI_CopyComputerModelName(true);
  CFStringRef v5 = v4;
  // Check if begins with "MacBookAir" or "MacBookPro10"
  bool v6 = CFStringHasPrefix(v4, CFSTR("MacBookAir"));
  bool v7 = CFStringHasPrefix(v5, CFSTR("MacBookPro10,1"));
  CFRelease(v5);
  // True if platform feature 2 is disabled
  bool v221 = ASI_IsPlatformFeatureEnabled(2) == 0;
  // True if the SMBIOS product name doesn't begin with MacBookAir or MacBookPro10,1
  bool v196 = (v6 | v7) == 0;
 ...

  bool v197 = v221 && v196;
  ...

LABEL_149:
  v168 = v20(classRef_NSMutableDictionary, selRef_alloc);
  v169 = v20(v168, selRef_init);
  v20(v169, selRef_setObject_forKey_, v204, &cfstr__items);
  v20(v204, selRef_release);
  // Set "Upgradeable Memory" in System Information/Memory to "No"
  v170 = CFSTR("No");
  if ( v197 )
    // Set "Upgradeable Memory" in System Information/Memory to "Yes"
    v170 = CFSTR("Yes");
  v20(v169, selRef_setObject_forKey_, v170);
  ...
}

For reference, ASI_CopyComputerModelName(false) returns a CFStringRef of "MacBook Pro" (using localizations). ASI_CopyComputerModelName(true) returns a CFStringRef of the SMBIOS product name (in this case, "MacBookPro14,3").

 

As for ASI_IsPlatformFeatureEnabled, you can see a somewhat complete (excluding the platform override debug case) implementation here (partially reproduced below).

bool ASI_IsPlatformFeatureEnabled(int feature)
{
    int v2 = false;
    int v3 = 0;
    bool v4 = false;
    CFStringRef v5 = NULL;
    CFStringRef v6 = NULL;
    bool v7 = false;
    bool v8 = false;
    bool v9 = false;
    bool v10 = false;

    v3 = (unsigned int) feature & (unsigned int) GetIOPlatformFeature();
    v2 = (v3 == feature);
    v4 = (v3 != (unsigned int) feature);
    if (feature == 2 && v4)
    {
        v5 = ASI_CopyComputerModelName(true);
        v6 = v5;
        if (v5)
        {
            v7 = CFStringHasPrefix(v5, CFSTR("MacBookAir"));
            v8 = CFStringHasPrefix(v6, CFSTR("MacBookPro10"));
            CFRelease(v6);
            v9 = v7 != 0;
            v10 = v8 != 0;
        }
        else
        {
            v9 = false;
            v10 = false;
        }
        if (v9 || v10)
        {
            v2 = true;
        }
    }

    return v2;
}
 

For some feature values (such as feature 2), this is simple a bitwise AND (feature_num AND GetIOPlatformFeature()), with some exceptions (e.g. MacBookPro10,x/MacBookAirX,X). If ASI_IsPlatformFeatureEnabled(2) returns true, the system has soldered RAM (which isn't upgradeable by the user). Setting platform-feature to 0x18 (24, setting the second bit to 0) instead of 0x1A (26) should disable platform feature 2, restoring the memory tab in About This Mac. You could also not inject a platform feature value at all by setting config.plist/SMBIOS/PlatformFeature to 0xFFFF.

 

Edit: Some more info + RE'd implementations can be found in this repo: https://github.com/al3xtjames/AppleSystemInfo

  • Like 9
×
×
  • Create New...