Jump to content
30960 posts in this topic

Recommended Posts

I posted it a few posts back but r4369 is newest. I also gave method for determining slide if needed a few posts ago.

you mean this ?

 

Once you get into the clover GUI, you need to go into the EFI shell and use the memmap command find the available region that has the largest space and calculate the slide value. You do that by taking the address of the region you found, subtract 0x100000 then divide by 0x200000. Now you have the slide value, you must make sure it is good. Do the calculation 0x100000 + (slide * 0x200000). That should give you the same address of the free area, if not add one to the slide or find another region and repeat.

 

EDIT: It's also ok if address calculated with the slide just offsets slightly into the region as long as there is still enough space for the kernel to load, usually around 0x12000 pages is good enough.

 

i don't understand, im not programmer or coder

would you please to help me??

here is my memmap

 

Type       Start            End              # Pages          Attributes
Available  0000000000000000-000000000003EFFF 000000000000003F 000000000000000F
RT_Data    000000000003F000-000000000003FFFF 0000000000000001 800000000000000F
Available  0000000000040000-000000000009FFFF 0000000000000060 000000000000000F
Available  0000000000100000-000000000FFFFFFF 000000000000FF00 000000000000000F
BS_Code    0000000010000000-000000001000AFFF 000000000000000B 000000000000000F
Available  000000001000B000-00000000A562FFFF 0000000000095625 000000000000000F
LoaderCode 00000000A5630000-00000000A57B9FFF 000000000000018A 000000000000000F
LoaderData 00000000A57BA000-00000000A6EA2FFF 00000000000016E9 000000000000000F
BS_Data    00000000A6EA3000-00000000A6F22FFF 0000000000000080 000000000000000F
LoaderData 00000000A6F23000-00000000AD7A5FFF 0000000000006883 000000000000000F
BS_Data    00000000AD7A6000-00000000B97A5FFF 000000000000C000 000000000000000F
Available  00000000B97A6000-00000000B9A0FFFF 000000000000026A 000000000000000F
BS_Code    00000000B9A10000-00000000BA432FFF 0000000000000A23 000000000000000F
Reserved   00000000BA433000-00000000BB196FFF 0000000000000D64 000000000000000F
ACPI_Recl  00000000BB197000-00000000BB1F6FFF 0000000000000060 000000000000000F
ACPI_NVS   00000000BB1F7000-00000000BD3F7FFF 0000000000002201 000000000000000F
RT_Data    00000000BD3F8000-00000000BDC99FFF 00000000000008A2 800000000000000F
RT_Code    00000000BDC9A000-00000000BDD02FFF 0000000000000069 800000000000000F
BS_Data    00000000BDD03000-00000000BDD03FFF 0000000000000001 000000000000000F
RT_Data    00000000BDD04000-00000000BDD89FFF 0000000000000086 800000000000000F
BS_Data    00000000BDD8A000-00000000BDFFFFFF 0000000000000276 000000000000000F
Available  0000000100000000-000000083FFFFFFF 0000000000740000 000000000000000F
Reserved   00000000BE000000-00000000BEFFFFFF 0000000000001000 0000000000000000
MMIO       00000000E0000000-00000000EFFFFFFF 0000000000010000 8000000000000001
MMIO       00000000FED1C000-00000000FED44FFF 0000000000000029 8000000000000001
MMIO       00000000FF000000-00000000FFFFFFFF 0000000000001000 8000000000000001
 
  Reserved  :          7,524 Pages (30,818,304 Bytes)
  LoaderCode:            394 Pages (1,613,824 Bytes)
  LoaderData:         32,620 Pages (133,611,520 Bytes)
  BS_Code   :          2,606 Pages (10,674,176 Bytes)
  BS_Data   :         49,911 Pages (204,435,456 Bytes)
  RT_Code   :            105 Pages (430,080 Bytes)
  RT_Data   :          2,345 Pages (9,605,120 Bytes)
  ACPI_Recl :             96 Pages (393,216 Bytes)
  ACPI_NVS  :          8,705 Pages (35,655,680 Bytes)
  MMIO      :         69,673 Pages (285,380,608 Bytes)
  MMIO_Port :              0 Pages (0 Bytes)
  PalCode   :              0 Pages (0 Bytes)
  Available :      8,280,110 Pages (33,915,330,560 Bytes)
  Persistent:              0 Pages (0 Bytes)
              -------------- 
Total Memory:         32,722 MB (34,311,749,632 Bytes)

 

 

NVRAM is functional. I used the code you provided and after reboot in NVRAM I see

test value
Sent from my SM-G930F using Tapatalk

 

 

Awesome.

 

you mean this ?

 

Once you get into the clover GUI, you need to go into the EFI shell and use the memmap command find the available region that has the largest space and calculate the slide value. You do that by taking the address of the region you found, subtract 0x100000 then divide by 0x200000. Now you have the slide value, you must make sure it is good. Do the calculation 0x100000 + (slide * 0x200000). That should give you the same address of the free area, if not add one to the slide or find another region and repeat.

 

EDIT: It's also ok if address calculated with the slide just offsets slightly into the region as long as there is still enough space for the kernel to load, usually around 0x12000 pages is good enough.

 

i don't understand, im not programmer or coder

would you please to help me??

here is my memmap

 

 

Type       Start            End              # Pages          Attributes
Available  0000000000000000-000000000003EFFF 000000000000003F 000000000000000F
RT_Data    000000000003F000-000000000003FFFF 0000000000000001 800000000000000F
Available  0000000000040000-000000000009FFFF 0000000000000060 000000000000000F
Available  0000000000100000-000000000FFFFFFF 000000000000FF00 000000000000000F
BS_Code    0000000010000000-000000001000AFFF 000000000000000B 000000000000000F
Available  000000001000B000-00000000A562FFFF 0000000000095625 000000000000000F
LoaderCode 00000000A5630000-00000000A57B9FFF 000000000000018A 000000000000000F
LoaderData 00000000A57BA000-00000000A6EA2FFF 00000000000016E9 000000000000000F
BS_Data    00000000A6EA3000-00000000A6F22FFF 0000000000000080 000000000000000F
LoaderData 00000000A6F23000-00000000AD7A5FFF 0000000000006883 000000000000000F
BS_Data    00000000AD7A6000-00000000B97A5FFF 000000000000C000 000000000000000F
Available  00000000B97A6000-00000000B9A0FFFF 000000000000026A 000000000000000F
BS_Code    00000000B9A10000-00000000BA432FFF 0000000000000A23 000000000000000F
Reserved   00000000BA433000-00000000BB196FFF 0000000000000D64 000000000000000F
ACPI_Recl  00000000BB197000-00000000BB1F6FFF 0000000000000060 000000000000000F
ACPI_NVS   00000000BB1F7000-00000000BD3F7FFF 0000000000002201 000000000000000F
RT_Data    00000000BD3F8000-00000000BDC99FFF 00000000000008A2 800000000000000F
RT_Code    00000000BDC9A000-00000000BDD02FFF 0000000000000069 800000000000000F
BS_Data    00000000BDD03000-00000000BDD03FFF 0000000000000001 000000000000000F
RT_Data    00000000BDD04000-00000000BDD89FFF 0000000000000086 800000000000000F
BS_Data    00000000BDD8A000-00000000BDFFFFFF 0000000000000276 000000000000000F
Available  0000000100000000-000000083FFFFFFF 0000000000740000 000000000000000F
Reserved   00000000BE000000-00000000BEFFFFFF 0000000000001000 0000000000000000
MMIO       00000000E0000000-00000000EFFFFFFF 0000000000010000 8000000000000001
MMIO       00000000FED1C000-00000000FED44FFF 0000000000000029 8000000000000001
MMIO       00000000FF000000-00000000FFFFFFFF 0000000000001000 8000000000000001
 
  Reserved  :          7,524 Pages (30,818,304 Bytes)
  LoaderCode:            394 Pages (1,613,824 Bytes)
  LoaderData:         32,620 Pages (133,611,520 Bytes)
  BS_Code   :          2,606 Pages (10,674,176 Bytes)
  BS_Data   :         49,911 Pages (204,435,456 Bytes)
  RT_Code   :            105 Pages (430,080 Bytes)
  RT_Data   :          2,345 Pages (9,605,120 Bytes)
  ACPI_Recl :             96 Pages (393,216 Bytes)
  ACPI_NVS  :          8,705 Pages (35,655,680 Bytes)
  MMIO      :         69,673 Pages (285,380,608 Bytes)
  MMIO_Port :              0 Pages (0 Bytes)
  PalCode   :              0 Pages (0 Bytes)
  Available :      8,280,110 Pages (33,915,330,560 Bytes)
  Persistent:              0 Pages (0 Bytes)
              -------------- 
Total Memory:         32,722 MB (34,311,749,632 Bytes)

 

 

Is this the memmap from after you enter clover GUI and then use EFI shell? If so then, you're going to want to select this region because it has the most free pages below 0x100000000:

Available  000000001000B000-00000000A562FFFF 0000000000095625 000000000000000F

So to calculate the slide:

0x1000B000 - 0x100000 = 0xFF0B000
0xFF0B000 / 0x200000 = 0x7F

Now need to verify that will give a valid region:

0x7F * 0x200000 = 0xFE00000
0xFE00000 + 0x100000 = 0xFF00000 

0x7F is not valid slide because the address 0xFF00000 < 0x1000B000. Increase slide by one and recalculate:

0x80 * 0x200000 = 0x10000000
0x10000000 + 0x100000 = 0x10100000

0x80 is valid slide because it falls within the region, 0x10100000 >= 0x1000B000. Now calculate the remaining pages in region:

0x1000B000 + (0x95625 * 0x1000) = 0xA5630000
0xA5630000 - 0x10100000 = 0x95530000
0x95530000 / 0x1000 = 0x95530

The region has 0x95530 pages which is definitely more than 0x12000 pages (about ~300MB and usually the size of the kernelcache is less than that). So your slide is 0x80 or 128. Which you already knew but I guess I just mathematically proved for you. Did you try without setting any slide first? If that doesn't work use slide=128.

 

EDIT: Mixed up some numbers but fixed it.

EDIT2: If you get less than 0x12000 pages left over when you do this calculation then try another region and choose the one that yields the highest available pages.

EDIT3: If after you do this to every available region and none even come close to having 0x12000 pages then you have the fragmentation issue. You will have to fallback to AptioFix for now, until that issue is resolved.

EDIT4: Only increase the slide value once per region just because of alignment, move onto the next region after one increase.

  • Like 5

 

Awesome.

 

 

Is this the memmap from after you enter clover GUI and then use EFI shell? If so then, you're going to want to select this region because it has the most free pages below 0x100000000:

Available  000000001000B000-00000000A562FFFF 0000000000095625 000000000000000F

So to calculate the slide:

0x1000B000 - 0x100000 = 0xFF0B000
0xFF0B000 / 0x200000 = 0x7F

Now need to verify that will give a valid region:

0x7F * 0x200000 = 0xFE00000
0xFE00000 + 0x100000 = 0xFF00000 

0x7F is not valid slide because the address 0xFF00000 < 0x1000B000. Increase slide by one and recalculate:

0x80 * 0x200000 = 0x10000000
0x10000000 + 0x100000 = 0x10100000

0x80 is valid slide because it falls within the region, 0x10100000 >= 0x1000B000. Now calculate the remaining pages in region:

0x1000B000 + (0x95625 * 0x1000) = 0xA5630000
0xA5630000 - 0x10100000 = 0x95530000
0x95530000 / 0x1000 = 0x95530

The region has 0x95530 pages which is definitely more than 0x12000 pages (about ~300MB and usually the size of the kernelcache is less than that). So your slide is 0x80 or 128. Which you already knew but I guess I just mathematically proved for you. Did you try without setting any slide first? If that doesn't work use slide=128.

 

EDIT: Mixed up some numbers but fixed it.

EDIT2: If you get less than 0x12000 pages left over when you do this calculation then try another region and choose the one that yields the highest available pages.

EDIT3: If after you do this to every available region and none even come close to having 0x12000 pages then you have the fragmentation issue. You will have to fallback to AptioFix for now, until that issue is resolved.

thanks a lot,

i already tried without slide, "does printf work?" hang.

when i use this memmap, in my UEFI driver still aptiofix 1 not v2, it doesnt matter, right?

  • Like 1

thanks a lot,

i already tried without slide, "does printf work?" hang.

when i use this memmap, in my UEFI driver still aptiofix 1 not v2, it doesnt matter, right?

 

No, you should use AptioFix2 above AptioFix always. If AptioFix2 does not work even with slide value, then fallback to AptioFix. You should be good though with slide=128 with AptioFix2.

 

EDIT: Where is "does printf work??" even from? WTF? That's a weird message. Is that from boot.efi? I don't see where that's in clover....

No, you should use AptioFix2 above AptioFix always. If AptioFix2 does not work even with slide value, then fallback to AptioFix. You should be good though with slide=128 with AptioFix2.

i only can boot with slide=128, i cant if slide=80

so, i must/should use aptiofix2 with slide=128 instead of aptiofix without slide arg?

i only can boot with slide=128, i cant if slide=80

so, i must/should use aptiofix2 with slide=128 instead of aptiofix without slide arg?

 

No, you misunderstood I wrote 0x80 and 128, those are the same number just in hexadecimal and decimal. And yes you should use AptioFix2. It should probably be made to automatically calculate the slide if one is not given.

  • Like 2

No, you misunderstood I wrote 0x80 and 128, those are the same number just in hexadecimal and decimal. And yes you should use AptioFix2. It should probably be made to automatically calculate the slide if one is not given.

Please don't kill "random KASLR", thx ;p

Question about using memmap for slide value calc:

"clover GUI, you need to go into the EFI shell and use the memmap command" ..

Before of using that command,  must i remove any aptiofix..efi driver and reboot? 

Or does the command and later  calc works if an aptiofix..efi driver is used (in the clover driver path)? Thanks

Question about using memmap for slide value calc:

"clover GUI, you need to go into the EFI shell and use the memmap command" ..

Before of using that command, must i remove any aptiofix..efi driver and reboot?

Or does the command and later calc works if an aptiofix..efi driver is used (in the clover driver path)? Thanks

You don't need to remove AF.
  • Like 2

Now i tried newest ..69 Clover.pkg (DLed from SF, installed for test on USB Stick). Used   aptiofix2drv-64.efi  - before i must use the aptiofixdrv-64.efi on my GA-Z77 MB.

Worked!  So no need for me to calc and use an slide value. Thanks

Q: The size of that ..2..efi coming within the .pkg is 23KB, that test version from page 800 is about 52 KB size. Same stuff / code - only bigger by debug code / not size optimized? Or should i try also that test ..2fix.. version from page 800?

Now i tried newest ..69 Clover.pkg (DLed from SF, installed for test on USB Stick). Used aptiofix2drv-64.efi - before i must use the aptiofixdrv-64.efi on my GA-Z77 MB.

Worked! So no need for me to calc and use an slide value. Thanks

Q: The size of that ..2..efi coming within the .pkg is 23KB, that test version from page 800 is about 52 KB size. Same stuff / code - only bigger by debug code / not size optimized? Or should i try also that test ..2fix.. version from page 800?

I don't know why my bin is larger, the toolchain is what makes the diff
  • Like 1

To test whether it is working go into terminal and use the command like

sudo nvram test="value"

Then restart and run

sudo nvram -p

And see if the test variable is there. You can then delete it:

sudo nvram -d test

If the variable is not there you do not have working NVRAM. Would need to get more info then.

Hi there,

 

I've tested r4369 on InsydeH20 and the nvram is not working without the emulation driver :/ 

 

Let me know what info u need.

 

EDIT: Where is "does printf work??" even from? WTF? That's a weird message. Is that from boot.efi? I don't see where that's in clover....

I think it is from apfs.efi.

 

I don't know why my bin is larger, the toolchain is what makes the diff

 

My compilation is 23kb. The toolchain is XCODE5. The sources are from sf.net. RELEASE.

Are you sure you have the same sources?

My compilation is 23kb. The toolchain is XCODE5. The sources are from sf.net. RELEASE.

Are you sure you have the same sources?

 

Yes, I used VS2015x86. Seems to be some bug (or feature :) ) with an edk2 update as bins are larger than they used to be anyway.

@apianti Thank you

Works here HP ProBook 6570b WithOut  EmuV  :thumbsup_anim:

 

captu200.png

First of all thanks to vit9696.

Hi there,

 

I've tested r4369 on InsydeH20 and the nvram is not working without the emulation driver :/ 

 

Let me know what info u need.

This is the solution for Aptio UEFI BIOS (AptioFix), it is not for InsydeH20 BIOS.  :(

  • Like 4

Except for your sleep fix, there is nothing explicitely Aptio-specifc in it.

I don't think so. There is a fix for bug introduced by AMI UEFI BIOS.

As well whole AptioFix was developed to fight with AMI AllocateMemory() stupid function while EDK2 AllocateMemory is good. See legacy Clover == CloverEFI doesn't need AptioFix.

Hm, may be we can do real NVRAM with CloverEFI in the case of using on UEFI machine?!

  • Like 2

I don't think so. There is a fix for bug introduced by AMI UEFI BIOS.

As well whole AptioFix was developed to fight with AMI AllocateMemory() stupid function while EDK2 AllocateMemory is good. See legacy Clover == CloverEFI doesn't need AptioFix.

 

Yes, it because built because of Aptio, but is not exclusive to Aptio. Even today, people use AptioFix on non-AMI machines.

 

Hm, may be we can do real NVRAM with CloverEFI in the case of using on UEFI machine?!

 

You want UEFI to emulate BIOS so that you can load another UEFI environment? With some relocation magic, this really is a non-isse tbh

It is not working in my case (rig in signature)

Last login: Sun Jan  7 17:36:41 on console
fabios-Mac-Pro:~ fabio$ sudo nvram -p
Password:
fakesmc-key-MSWr-ui8	%00
flagstate	%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00
fakesmc-key-RBr -ch8*	j90%00%00%00%00%00
fakesmc-key-EPCI-ui32	%06%f0%f0%00
fakesmc-key-MSAc-ui16	%00%00
efi-boot-device	<array><dict><key>IOMatch</key><dict><key>IOProviderClass</key><string>IOMedia</string><key>IOPropertyMatch</key><dict><key>UUID</key><string>3A55787E-1275-45BE-87EB-0ACF96BC0343</string></dict></dict></dict></array>
fakesmc-key-CLKH-{clh	%00%00p%80%00%01%19@
bootercfg	(%00
fakesmc-key-NATi-ui16	%00%1e
LocationServicesEnabled	%01
fakesmc-key-NTOK-ui8	%01
fakesmc-key-BATP-flag	%00
fakesmc-key-$Num-ui8	%01
fakesmc-key-REV -ch8*	%02 %0f%00%00%18
bluetoothActiveControllerInfo	%0a%18%05%0b%00%00%00%00`%14%f0%03%8c<%b5%a3
fakesmc-key-HI0N-ui8	%10
fmm-computer-name	fabio%e2%80%99s Mac Pro
fakesmc-key-MSTc-ui8	%00
fakesmc-key-MSPS-ui16	%00%03
fakesmc-key-RMde-char	A
csr-active-config	g%00%00%00
fakesmc-key-RPlt-ch8*	j90%00%00%00%00%00
fakesmc-key-BEMB-flag	%00
fakesmc-key-#KEY-ui32	%00%00%00%10
SystemAudioVolume	A
fakesmc-key-MSFW-ui8	%01%00
specialbootdevice	%02%01%0c%00%d0A%03%0a%00%00%00%00%01%01%06%00%02%1f%03%12%0a%00%00%00%ff%ff%00%00%04%01*%00%03%00%00%00%00H%0a%00%00%00%00%00%88%ca%93;%00%00%00%00~xU:u%12%beE%87%eb%0a%cf%96%bc%03C%02%02%04%03$%00%f7%fct%be|%0b%f3I%91G%01%f4%04.hB%ea%00%1f.%994-E%bd%9e%da%ff%12}%c4%a6%7f%ff%04%00
security-mode	none
fakesmc-key-LsBA-ui8	%90
fakesmc-key-$Adr-ui32	%00%00%03%00
nvda_drv	1%00
EFILoginHiDPI	%00%00%00%00
fakesmc-key-CLKT-ui32	%00%00%f7%aa
fakesmc-key-MSDW-ui8	%01
fakesmc-key-BNum-ui8	%00
SystemAudioVolumeDB	%f0
fakesmc-key-NATJ-ui8	%02
efi-boot-device-data	%02%01%0c%00%d0A%03%0a%00%00%00%00%01%01%06%00%02%1f%03%12%0a%00%00%00%ff%ff%00%00%04%01*%00%03%00%00%00%00H%0a%00%00%00%00%00%88%ca%93;%00%00%00%00~xU:u%12%beE%87%eb%0a%cf%96%bc%03C%02%02%04%03$%00%f7%fct%be|%0b%f3I%91G%01%f4%04.hB%ea%00%1f.%994-E%bd%9e%da%ff%12}%c4%a6%7f%ff%04%00
fabios-Mac-Pro:~ fabio$ 

×
×
  • Create New...