Jump to content

Clover Problems and Solutions


ErmaC
3,206 posts in this topic

Recommended Posts

Why you dont just install the WebDriver to take care that VRAM & other properties? You are still able to adjust current max port & boot-display with SSDT. Will works with Clover or Ozmosis.

VRAM shows as 0 MB with the WebDriver installed and InjectNvidia=true.

Link to comment
Share on other sites

Ok, so I made a small driver to load from the efi shell at boot, also I had it load before all other drivers in Clover. It produced the same result but crashes clover if it loads it, but not if loaded from the shell and then clover is started. So unsure what is going on there....

OsxMemoryRelocation()
  AllocateRelocationRegion()
    GetMemMap(0x00000000010FE4B8 [0x0000000000000000], NULL, 0x00000000010FE4C8, 0x00000000010FE4C0, 0x010FE4B0)
    Allocating memory map
    GetMemMap(0x00000000010FE4B8 [0x00000000000008D0], 0x00000000C1A63018, 0x00000000010FE4C8, 0x00000000010FE4C0, 0x010FE4B0)
    Searching for best relocation region:
      Region: 0x000000000000005F pages at 0x0000000000000000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because outside limits 0x0000000000100000 - 0x00000000E0000000
      Region: 0x0000000000000001 pages at 0x000000000005F000 Type=0x00000004 Attribute=0x000000000000000F
      Region: 0x000000000000003E pages at 0x0000000000060000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because outside limits 0x0000000000100000 - 0x00000000E0000000
      Region: 0x0000000000000002 pages at 0x000000000009E000 Type=0x00000000 Attribute=0x000000000000000F
      Region: 0x0000000000000F00 pages at 0x0000000000100000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x0000000000000F00 pages at 0x0000000000100000 slide=0
      Region: 0x0000000000000100 pages at 0x0000000001000000 Type=0x00000002 Attribute=0x000000000000000F
      Region: 0x000000000001EF00 pages at 0x0000000001100000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x000000000001EF00 pages at 0x0000000001100000 slide=8
      Region: 0x0000000000000200 pages at 0x0000000020000000 Type=0x00000000 Attribute=0x000000000000000F
      Region: 0x000000000001FE00 pages at 0x0000000020200000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x000000000001FD00 pages at 0x0000000020300000 slide=257
      Region: 0x0000000000000200 pages at 0x0000000040000000 Type=0x00000000 Attribute=0x000000000000000F
      Region: 0x0000000000073E21 pages at 0x0000000040200000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x0000000000020000 pages at 0x0000000040300000 slide=513
      Region: 0x00000000000000F0 pages at 0x00000000B4021000 Type=0x00000001 Attribute=0x000000000000000F
      Region: 0x000000000000D952 pages at 0x00000000B4111000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because the region has less available pages than current relocation region
      Region: 0x00000000000063C6 pages at 0x00000000C1A63000 Type=0x00000004 Attribute=0x000000000000000F
      Region: 0x0000000000000BF7 pages at 0x00000000C7E29000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because the region has less available pages than current relocation region
      Region: 0x000000000000026F pages at 0x00000000C8A20000 Type=0x00000003 Attribute=0x000000000000000F
      Region: 0x00000000000008E6 pages at 0x00000000C8C8F000 Type=0x00000000 Attribute=0x000000000000000F
      Region: 0x000000000000025A pages at 0x00000000C9575000 Type=0x00000000 Attribute=0x000000000000000F
      Region: 0x0000000000000006 pages at 0x00000000C97CF000 Type=0x00000000 Attribute=0x000000000000000F
      Region: 0x0000000000000065 pages at 0x00000000C97D5000 Type=0x00000000 Attribute=0x000000000000000F
      Region: 0x000000000000008A pages at 0x00000000C983A000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because the region does not have a slide position
      Region: 0x00000000000000A4 pages at 0x00000000C98C4000 Type=0x0000000A Attribute=0x000000000000000F
      Region: 0x0000000000000005 pages at 0x00000000C9968000 Type=0x0000000A Attribute=0x000000000000000F
      Region: 0x000000000000000B pages at 0x00000000C996D000 Type=0x0000000A Attribute=0x000000000000000F
      Region: 0x000000000000057F pages at 0x00000000C9978000 Type=0x00000006 Attribute=0x800000000000000F
      Region: 0x000000000000020C pages at 0x00000000C9EF7000 Type=0x00000006 Attribute=0x800000000000000F
      Region: 0x0000000000000017 pages at 0x00000000CA103000 Type=0x00000005 Attribute=0x800000000000000F
      Region: 0x000000000000005D pages at 0x00000000CA11A000 Type=0x00000005 Attribute=0x800000000000000F
      Region: 0x0000000000000001 pages at 0x00000000CA177000 Type=0x00000004 Attribute=0x000000000000000F
      Region: 0x0000000000000043 pages at 0x00000000CA178000 Type=0x0000000A Attribute=0x000000000000000F
      Region: 0x0000000000000151 pages at 0x00000000CA1BB000 Type=0x00000004 Attribute=0x000000000000000F
      Region: 0x00000000000008BB pages at 0x00000000CA30C000 Type=0x00000003 Attribute=0x000000000000000F
      Region: 0x0000000000000005 pages at 0x00000000CABC7000 Type=0x00000004 Attribute=0x000000000000000F
      Region: 0x0000000000000004 pages at 0x00000000CABCC000 Type=0x00000003 Attribute=0x000000000000000F
      Region: 0x000000000000000D pages at 0x00000000CABD0000 Type=0x00000004 Attribute=0x000000000000000F
      Region: 0x0000000000000012 pages at 0x00000000CABDD000 Type=0x00000003 Attribute=0x000000000000000F
      Region: 0x0000000000000007 pages at 0x00000000CABEF000 Type=0x00000004 Attribute=0x000000000000000F
      Region: 0x00000000000003FC pages at 0x00000000CABF6000 Type=0x00000006 Attribute=0x800000000000000F
      Region: 0x000000000000000E pages at 0x00000000CAFF2000 Type=0x00000004 Attribute=0x000000000000000F
      Region: 0x000000000032F600 pages at 0x0000000100000000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because outside limits 0x0000000000100000 - 0x00000000E0000000
      Region: 0x0000000000004200 pages at 0x00000000CB800000 Type=0x00000000 Attribute=0x8000000000000000
      Region: 0x0000000000004000 pages at 0x00000000F8000000 Type=0x0000000B Attribute=0x8000000000000001
      Region: 0x0000000000000001 pages at 0x00000000FEC00000 Type=0x0000000B Attribute=0x8000000000000001
      Region: 0x0000000000000004 pages at 0x00000000FED00000 Type=0x0000000B Attribute=0x8000000000000001
      Region: 0x0000000000000004 pages at 0x00000000FED1C000 Type=0x0000000B Attribute=0x8000000000000001
      Region: 0x0000000000000001 pages at 0x00000000FEE00000 Type=0x0000000B Attribute=0x8000000000000001
      Region: 0x0000000000001000 pages at 0x00000000FF000000 Type=0x0000000B Attribute=0x8000000000000001
    Allocating relocation region - 0x0000000000020000 pages at 0x0000000040300000 slide=513
  AllocateRelocationRegion() => Success
  Overriding start image boot service method
OsxMemoryRelocation() => Success
Image 'FS0:\EFI\CLOVER\OsxMemoryRelocationDxe.efi' loaded at C8A20000 - Success

It found a number of pretty large regions that aren't there later, and it also calculates the slide. You can see the regions:

      Region: 0x0000000000000F00 pages at 0x0000000000100000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x0000000000000F00 pages at 0x0000000000100000 slide=0

      Region: 0x000000000001EF00 pages at 0x0000000001100000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x000000000001EF00 pages at 0x0000000001100000 slide=8

      Region: 0x000000000001FE00 pages at 0x0000000020200000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x000000000001FD00 pages at 0x0000000020300000 slide=257

      Region: 0x0000000000073E21 pages at 0x0000000040200000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x0000000000020000 pages at 0x0000000040300000 slide=513

      Region: 0x000000000000D952 pages at 0x00000000B4111000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because the region has less available pages than current relocation region

      Region: 0x0000000000000BF7 pages at 0x00000000C7E29000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because the region has less available pages than current relocation region

      Region: 0x000000000000008A pages at 0x00000000C983A000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because the region does not have a slide position

So there are definitely three available areas to use falling directly on slides (the one it chooses probably has like a ton still after using 0x20000 pages). There are three other's that are possibilities depending on the size of the relocation needed. Ironically, there is this one region that is just loader data allocations

Region: 0x0000000000000100 pages at 0x0000000001000000 Type=0x00000002 Attribute=0x000000000000000F

Blocking a nice big region available at 0x100000, slide=0.

 

EDIT: If anyone would like to please boot directly into the efi shell, firmware => shell, with nothing in between and provide the output file from loading this driver with the command

load -nc OsxMemoryRelocationDxe.efi > OsxMemoryRelocationDxe.txt

EDIT2: If you can't get directly to the shell from your firmware menu then you can create a fat usb and place the shell binary that works for you (either EFI\CLOVER\tools\Shell64U.efi or EFI\CLOVER\tools\Shell64.efi) at EFI/BOOT/BOOTX64.efi.

  • Like 3
Link to comment
Share on other sites

Sorry, is this due to UEFI memory allocation sucking or Clover memory leaking? I'm not sure when the second output is generated.

 

The problem is that memory is getting fragmented by loading efi images and pool memory allocations. All this output is from directly after post. From loading the driver in efi shell. I want to see this output from users who are getting the allocation error problem because when they get memmap from shell after clover has already started, then all these allocations have been made which fragments the memory. Also it's important that the memory requests are made on slide offsets so the relocation needs to be properly aligned to get rid of the page miscalculation.

 

EDIT: Just to clarify DF, that's one output from the driver in the efi shell. I just split it up to show the available regions that could have been selected and the one allocation that blocks slide=0.

EDIT2: It actually looks like that allocation is the driver code! This is the address of the MemoryMapSize variable and is inside that region blocking slide=0.

GetMemMap(0x00000000010FE4B8 [0x0000000000000000]
Link to comment
Share on other sites

Ok, so I made a small driver to load from the efi shell at boot, also I had it load before all other drivers in Clover. It produced the same result but crashes clover if it loads it, but not if loaded from the shell and then clover is started. So unsure what is going on there....

OsxMemoryRelocation()
  AllocateRelocationRegion()
    GetMemMap(0x00000000010FE4B8 [0x0000000000000000], NULL, 0x00000000010FE4C8, 0x00000000010FE4C0, 0x010FE4B0)
    Allocating memory map
    GetMemMap(0x00000000010FE4B8 [0x00000000000008D0], 0x00000000C1A63018, 0x00000000010FE4C8, 0x00000000010FE4C0, 0x010FE4B0)
    Searching for best relocation region:
      Region: 0x000000000000005F pages at 0x0000000000000000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because outside limits 0x0000000000100000 - 0x00000000E0000000
      Region: 0x0000000000000001 pages at 0x000000000005F000 Type=0x00000004 Attribute=0x000000000000000F
      Region: 0x000000000000003E pages at 0x0000000000060000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because outside limits 0x0000000000100000 - 0x00000000E0000000
      Region: 0x0000000000000002 pages at 0x000000000009E000 Type=0x00000000 Attribute=0x000000000000000F
      Region: 0x0000000000000F00 pages at 0x0000000000100000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x0000000000000F00 pages at 0x0000000000100000 slide=0
      Region: 0x0000000000000100 pages at 0x0000000001000000 Type=0x00000002 Attribute=0x000000000000000F
      Region: 0x000000000001EF00 pages at 0x0000000001100000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x000000000001EF00 pages at 0x0000000001100000 slide=8
      Region: 0x0000000000000200 pages at 0x0000000020000000 Type=0x00000000 Attribute=0x000000000000000F
      Region: 0x000000000001FE00 pages at 0x0000000020200000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x000000000001FD00 pages at 0x0000000020300000 slide=257
      Region: 0x0000000000000200 pages at 0x0000000040000000 Type=0x00000000 Attribute=0x000000000000000F
      Region: 0x0000000000073E21 pages at 0x0000000040200000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x0000000000020000 pages at 0x0000000040300000 slide=513
      Region: 0x00000000000000F0 pages at 0x00000000B4021000 Type=0x00000001 Attribute=0x000000000000000F
      Region: 0x000000000000D952 pages at 0x00000000B4111000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because the region has less available pages than current relocation region
      Region: 0x00000000000063C6 pages at 0x00000000C1A63000 Type=0x00000004 Attribute=0x000000000000000F
      Region: 0x0000000000000BF7 pages at 0x00000000C7E29000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because the region has less available pages than current relocation region
      Region: 0x000000000000026F pages at 0x00000000C8A20000 Type=0x00000003 Attribute=0x000000000000000F
      Region: 0x00000000000008E6 pages at 0x00000000C8C8F000 Type=0x00000000 Attribute=0x000000000000000F
      Region: 0x000000000000025A pages at 0x00000000C9575000 Type=0x00000000 Attribute=0x000000000000000F
      Region: 0x0000000000000006 pages at 0x00000000C97CF000 Type=0x00000000 Attribute=0x000000000000000F
      Region: 0x0000000000000065 pages at 0x00000000C97D5000 Type=0x00000000 Attribute=0x000000000000000F
      Region: 0x000000000000008A pages at 0x00000000C983A000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because the region does not have a slide position
      Region: 0x00000000000000A4 pages at 0x00000000C98C4000 Type=0x0000000A Attribute=0x000000000000000F
      Region: 0x0000000000000005 pages at 0x00000000C9968000 Type=0x0000000A Attribute=0x000000000000000F
      Region: 0x000000000000000B pages at 0x00000000C996D000 Type=0x0000000A Attribute=0x000000000000000F
      Region: 0x000000000000057F pages at 0x00000000C9978000 Type=0x00000006 Attribute=0x800000000000000F
      Region: 0x000000000000020C pages at 0x00000000C9EF7000 Type=0x00000006 Attribute=0x800000000000000F
      Region: 0x0000000000000017 pages at 0x00000000CA103000 Type=0x00000005 Attribute=0x800000000000000F
      Region: 0x000000000000005D pages at 0x00000000CA11A000 Type=0x00000005 Attribute=0x800000000000000F
      Region: 0x0000000000000001 pages at 0x00000000CA177000 Type=0x00000004 Attribute=0x000000000000000F
      Region: 0x0000000000000043 pages at 0x00000000CA178000 Type=0x0000000A Attribute=0x000000000000000F
      Region: 0x0000000000000151 pages at 0x00000000CA1BB000 Type=0x00000004 Attribute=0x000000000000000F
      Region: 0x00000000000008BB pages at 0x00000000CA30C000 Type=0x00000003 Attribute=0x000000000000000F
      Region: 0x0000000000000005 pages at 0x00000000CABC7000 Type=0x00000004 Attribute=0x000000000000000F
      Region: 0x0000000000000004 pages at 0x00000000CABCC000 Type=0x00000003 Attribute=0x000000000000000F
      Region: 0x000000000000000D pages at 0x00000000CABD0000 Type=0x00000004 Attribute=0x000000000000000F
      Region: 0x0000000000000012 pages at 0x00000000CABDD000 Type=0x00000003 Attribute=0x000000000000000F
      Region: 0x0000000000000007 pages at 0x00000000CABEF000 Type=0x00000004 Attribute=0x000000000000000F
      Region: 0x00000000000003FC pages at 0x00000000CABF6000 Type=0x00000006 Attribute=0x800000000000000F
      Region: 0x000000000000000E pages at 0x00000000CAFF2000 Type=0x00000004 Attribute=0x000000000000000F
      Region: 0x000000000032F600 pages at 0x0000000100000000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because outside limits 0x0000000000100000 - 0x00000000E0000000
      Region: 0x0000000000004200 pages at 0x00000000CB800000 Type=0x00000000 Attribute=0x8000000000000000
      Region: 0x0000000000004000 pages at 0x00000000F8000000 Type=0x0000000B Attribute=0x8000000000000001
      Region: 0x0000000000000001 pages at 0x00000000FEC00000 Type=0x0000000B Attribute=0x8000000000000001
      Region: 0x0000000000000004 pages at 0x00000000FED00000 Type=0x0000000B Attribute=0x8000000000000001
      Region: 0x0000000000000004 pages at 0x00000000FED1C000 Type=0x0000000B Attribute=0x8000000000000001
      Region: 0x0000000000000001 pages at 0x00000000FEE00000 Type=0x0000000B Attribute=0x8000000000000001
      Region: 0x0000000000001000 pages at 0x00000000FF000000 Type=0x0000000B Attribute=0x8000000000000001
    Allocating relocation region - 0x0000000000020000 pages at 0x0000000040300000 slide=513
  AllocateRelocationRegion() => Success
  Overriding start image boot service method
OsxMemoryRelocation() => Success
Image 'FS0:\EFI\CLOVER\OsxMemoryRelocationDxe.efi' loaded at C8A20000 - Success

It found a number of pretty large regions that aren't there later, and it also calculates the slide. You can see the regions:

      Region: 0x0000000000000F00 pages at 0x0000000000100000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x0000000000000F00 pages at 0x0000000000100000 slide=0

      Region: 0x000000000001EF00 pages at 0x0000000001100000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x000000000001EF00 pages at 0x0000000001100000 slide=8

      Region: 0x000000000001FE00 pages at 0x0000000020200000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x000000000001FD00 pages at 0x0000000020300000 slide=257

      Region: 0x0000000000073E21 pages at 0x0000000040200000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x0000000000020000 pages at 0x0000000040300000 slide=513

      Region: 0x000000000000D952 pages at 0x00000000B4111000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because the region has less available pages than current relocation region

      Region: 0x0000000000000BF7 pages at 0x00000000C7E29000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because the region has less available pages than current relocation region

      Region: 0x000000000000008A pages at 0x00000000C983A000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because the region does not have a slide position

So there are definitely three available areas to use falling directly on slides (the one it chooses probably has like a ton still after using 0x20000 pages). There are three other's that are possibilities depending on the size of the relocation needed. Ironically, there is this one region that is just loader data allocations

Region: 0x0000000000000100 pages at 0x0000000001000000 Type=0x00000002 Attribute=0x000000000000000F

Blocking a nice big region available at 0x100000, slide=0.

 

EDIT: If anyone would like to please boot directly into the efi shell, firmware => shell, with nothing in between and provide the output file from loading this driver with the command

load -nc OsxMemoryRelocationDxe.efi > OsxMemoryRelocationDxe.txt

EDIT2: If you can't get directly to the shell from your firmware menu then you can create a fat usb and place the shell binary that works for you (either EFI\CLOVER\tools\Shell64U.efi or EFI\CLOVER\tools\Shell64.efi) at EFI/BOOT/BOOTX64.efi.

 

i see short time some log. then i got GUI.

 

i use efi shell. but i saw in txt

load: File not found - 'OsxMemoryRelocationDxe.efi'

 

my step

1.just copy your file in drivers64UEFI folder

2.reboot

3.go shell

4. select save partiton

5. enter "load -nc OsxMemoryRelocationDxe.efi > OsxMemoryRelocationDxe.txt"

Link to comment
Share on other sites

i see short time some log. then i got GUI.

 

i use efi shell. but i saw in txt

load: File not found - 'OsxMemoryRelocationDxe.efi'

 

my step

1.just copy your file in drivers64UEFI folder

2.reboot

3.go shell

4. select save partiton

5. enter "load -nc OsxMemoryRelocationDxe.efi > OsxMemoryRelocationDxe.txt"

It does not matter where the driver is located but definitely do not put it in drivers64UEFI. Here is a better procedure:

  • Create an empty fat usb
  • Put the efi shell at \EFI\BOOT\BOOTX64.efi
  • Put the driver at \OsxMemoryRelocationDxe.efi (just the root of the volume)
  • Restart and UEFI boot from the usb
  • The efi shell should start and print out FS#: and BLK#: (you can page up if you can't see them all)
  • You have to determine which filesystem is the usb by inspecting the file listing to make sure the driver is there. Enter into the shell (where # is one of the filesystem numbers from step 5) for each filesystem:

    > FS#:
    > ls
  • Now that you have found the filesystem with the driver, run the command

    > load -nc OsxMemoryRelocationDxe.efi > OsxMemoryRelocationDxe.txt
    
  • Provide OsxMemoryRelocationDxe.txt

 

EDIT: Spelling. Added to provide the results back.

 

slide=0, OsxAptioFixDrv-64.efi

0:799  0:002  Loading OsxMemoryRelocationDxe.efi  status=Success
3:920  3:121  Loading OsxAptioFixDrv-64.efi  status=Success
3:926  0:005  Loading PartitionDxe-64.efi  status=Success
3:931  0:005   - driver needs connecting

No! Please follow the steps above or something similar, nothing but the efi shell can have started before the driver is loaded.

  • Like 1
Link to comment
Share on other sites

my step

1.just copy your file in drivers64UEFI folder

2.reboot

3.go shell

4. select save partiton

5. enter "load -nc OsxMemoryRelocationDxe.efi > OsxMemoryRelocationDxe.txt"

Obviously you need to place it in the partition root or cd to the directory...

 

EDIT2: It actually looks like that allocation is the driver code! This is the address of the MemoryMapSize variable and is inside that region blocking slide=0.

lol, that sucks. Guess the only 'solution' to that is a resource-expensive AllocatePool override which searches for a free spot in the high mem... though u need to get the MemMap on every alloc. :/

Link to comment
Share on other sites

slide=0, OsxAptioFixDrv-64.efi

0:799  0:002  Loading OsxMemoryRelocationDxe.efi  status=Success
3:920  3:121  Loading OsxAptioFixDrv-64.efi  status=Success
3:926  0:005  Loading PartitionDxe-64.efi  status=Success
3:931  0:005   - driver needs connecting

attachicon.gifnew2OsxMemoryRelocationDxe.txt.zip

 

new2OsxMemoryRelocationDxe.txt This is the log that I got in shellU64  after

load -nc OsxMemoryRelocationDxe.efi > OsxMemoryRelocationDxe.txt
Link to comment
Share on other sites

lol, that sucks. Guess the only 'solution' to that is a resource-expensive AllocatePool override which searches for a free spot in the high mem... though u need to get the MemMap on every alloc. :/

 

I don't understand what you mean.

 

 

new2OsxMemoryRelocationDxe.txt This is the log that I got in shellU64  after

load -nc OsxMemoryRelocationDxe.efi > OsxMemoryRelocationDxe.txt

 

Oh I guess I misunderstood. This looks promising though, slide=8, you have max pages. I just set max at 0x20000, but thats like 512MB or something. I can't imagine needing more.

      Region: 0x00000000000CCBB5 pages at 0x0000000001100000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x0000000000020000 pages at 0x0000000001100000 slide=8
    Allocating relocation region - 0x0000000000020000 pages at 0x0000000001100000 slide=8
  AllocateRelocationRegion() => Success
Link to comment
Share on other sites

I don't understand what you mean.

Well, obviously the Aptio-provided AllocatePool() function tends to allocate fragmented, so the only solution I see to that would be to shim it to call AllocatePages() with information gathered from MemoryMap. It makes most sense to allocate BootServices data as high as possible as it will not be needed during the 32-bit kernel transition.

Link to comment
Share on other sites

It does not matter where the driver is located but definitely do not put it in drivers64UEFI. Here is a better procedure:

  • Create an empty fat usb
  • Put the efi shell at \EFI\BOOT\BOOTX64.efi
  • Put the driver at \OsxMemoryRelocationDxe.efi (just the root of the volume)
  • Restart and UEFI boot from the usb
  • The efi shell should start and print out FS#: and BLK#: (you can page up if you can't see them all)
  • You have to determine which filesystem is the usb by inspecting the file listing to make sure the driver is there. Enter into the shell (where # is one of the filesystem numbers from step 5) for each filesystem:

    > FS#:
    > ls
  • Now that you have found the filesystem with the driver, run the command

    > load -nc OsxMemoryRelocationDxe.efi > OsxMemoryRelocationDxe.txt
    
  • Provide OsxMemoryRelocationDxe.txt

 

EDIT: Spelling. Added to provide the results back.

 

No! Please follow the steps above or something similar, nothing but the efi shell can have started before the driver is loaded.

 

thank you for good instruction.

here is file

 

my dell should be use only OsxAptioFix2Drv-free2000.efi to boot. OsxAptioFix2Drv never boot in my dell laptop.

 

also to avoid random failed boot(with pluged usb before get GUI) , use slide option about 160 or 170(not sure value. can use safe mode too) in my dell laptop.

 

thanks in advance

delllaptop-OsxMemoryRelocationDxe.txt.zip

Link to comment
Share on other sites

Well, obviously the Aptio-provided AllocatePool() function tends to allocate fragmented, so the only solution I see to that would be to shim it to call AllocatePages() with information gathered from MemoryMap. It makes most sense to allocate BootServices data as high as possible as it will not be needed during the 32-bit kernel transition.

 

That's what I did. I inspected the memory map, and found the region most suitable for a relocation then allocate that before anything else has a chance to do anything. This driver has already allocated that region when it's done. Later on it will "free" this region for boot.efi when it's started and will therefore have a reserved slide relocated kernel space. If put into a firmware then ordering it early in loading would allow slide=0 to almost always be the relocation region. Otherwise it would need to be loaded before the boot loader or as one of the first things it does.

 

thank you for good instruction.

here is file

 

my dell should be use only OsxAptioFix2Drv-free2000.efi to boot. OsxAptioFix2Drv never boot in my dell laptop.

 

also to avoid random failed boot(with pluged usb before get GUI) , use slide option about 160 or 170(not sure value. can use safe mode too) in my dell laptop.

 

thanks in advance

 

You have two pretty good regions here with slide=0 and slide=141:

      Region: 0x00000000000118D6 pages at 0x0000000000100000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x00000000000118D6 pages at 0x0000000000100000 slide=0

      Region: 0x000000000001D31D pages at 0x0000000011A16000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x000000000001D233 pages at 0x0000000011B00000 slide=141

It chose slide=141 because it was bigger:

    Allocating relocation region - 0x000000000001D233 pages at 0x0000000011B00000 slide=141
  AllocateRelocationRegion() => Success

For Asus Z-170m-Plus

 

I think that this is pretty obviously going to find a much better relocation from the beginning, and not have to worry about it's allocation failure later:

      Region: 0x000000000000FF00 pages at 0x0000000000100000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x000000000000FF00 pages at 0x0000000000100000 slide=0

      Region: 0x000000000009891F pages at 0x0000000010006000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x0000000000020000 pages at 0x0000000010100000 slide=128

      Region: 0x000000000000F98E pages at 0x00000000A8965000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because the region has less available pages than current relocation region

      Region: 0x0000000000000344 pages at 0x00000000C4924000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because the region has less available pages than current relocation region

      Region: 0x00000000000004B9 pages at 0x00000000C6D22000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because the region has less available pages than current relocation region

    Allocating relocation region - 0x0000000000020000 pages at 0x0000000010100000 slide=128
  AllocateRelocationRegion() => Success

You also have a few regions with decent page counts that could be used, with max at slide=128. But a few that probably wouldn't have enough pages as well.

Link to comment
Share on other sites

That's what I did. I inspected the memory map, and found the region most suitable for a relocation then allocate that before anything else has a chance to do anything. This driver has already allocated that region when it's done. Later on it will "free" this region for boot.efi when it's started and will therefore have a reserved slide relocated kernel space. If put into a firmware then ordering it early in loading would allow slide=0 to almost always be the relocation region. Otherwise it would need to be loaded before the boot loader or as one of the first things it does.

Ohh, was thinking of it as a concept of a 'dynamic slide choice' for AptioFix2, sorry.

 

EDIT: I just remembered aside from the MemoryMapHandoff drop, I also don't understand why exactly SkipOurSysTableRtArea is needed for DefragmentRuntimeServices(). Might these two actually be connected?

Link to comment
Share on other sites

That's what I did. I inspected the memory map, and found the region most suitable for a relocation then allocate that before anything else has a chance to do anything. This driver has already allocated that region when it's done. Later on it will "free" this region for boot.efi when it's started and will therefore have a reserved slide relocated kernel space. If put into a firmware then ordering it early in loading would allow slide=0 to almost always be the relocation region. Otherwise it would need to be loaded before the boot loader or as one of the first things it does.

 

 

You have two pretty good regions here with slide=0 and slide=141:

      Region: 0x00000000000118D6 pages at 0x0000000000100000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x00000000000118D6 pages at 0x0000000000100000 slide=0

      Region: 0x000000000001D31D pages at 0x0000000011A16000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x000000000001D233 pages at 0x0000000011B00000 slide=141
It chose slide=141 because it was bigger:
    Allocating relocation region - 0x000000000001D233 pages at 0x0000000011B00000 slide=141
  AllocateRelocationRegion() => Success

I think that this is pretty obviously going to find a much better relocation from the beginning, and not have to worry about it's allocation failure later:

      Region: 0x000000000000FF00 pages at 0x0000000000100000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x000000000000FF00 pages at 0x0000000000100000 slide=0

      Region: 0x000000000009891F pages at 0x0000000010006000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x0000000000020000 pages at 0x0000000010100000 slide=128

      Region: 0x000000000000F98E pages at 0x00000000A8965000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because the region has less available pages than current relocation region

      Region: 0x0000000000000344 pages at 0x00000000C4924000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because the region has less available pages than current relocation region

      Region: 0x00000000000004B9 pages at 0x00000000C6D22000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because the region has less available pages than current relocation region

    Allocating relocation region - 0x0000000000020000 pages at 0x0000000010100000 slide=128
  AllocateRelocationRegion() => Success
You also have a few regions with decent page counts that could be used, with max at slide=128. But a few that probably wouldn't have enough pages as well.
How can i use best setting?

Aptiofixv2 with slide 141?

Aptiofixv2 with slide 0 was not work before.

 

 

나의 LG-F800S 의 Tapatalk에서 보냄

Link to comment
Share on other sites

Ohh, was thinking of it as a concept of a 'dynamic slide choice' for AptioFix2, sorry.

 

It basically is, either it will just become the region, or will be used to relocate to slide=0. Although maybe I'm too lazy since AptioFix already works to do that for Lion... I have not finished yet obviously, but so far it doesn't seem to have adverse affect on booting anything that I've tried while it's active but it may be a good idea to free the region before booting other oses. I guess just see if the image is a loader type and free the region then.

 

EDIT: I just remembered aside from the MemoryMapHandoff drop, I also don't understand why exactly SkipOurSysTableRtArea is needed for DefragmentRuntimeServices(). Might these two actually be connected?

 

I can't exactly remember why either of those exist, but I'm pretty sure both because of kernel panics, or something.

How can i use best setting?

Aptiofixv2 with slide 141?

Aptiofixv2 with slide 0 was not work before.

 

 

나의 LG-F800S 의 Tapatalk에서 보냄

 

I doubt that slide=141 will help since most likely that memory will be broken up by allocations by then. This was just a test to see if it was possible to find a slide relocation region and reserve for later instead of trying to allocate when it's needed. I'm going to code some more and hopefully boot will be possible with this driver, and working RT for everyone. lol

  • Like 1
Link to comment
Share on other sites

I can't exactly remember why either of those exist, but I'm pretty sure both because of kernel panics, or something.

Does somebody have the XNU debugging skills to check if the new RT pages are mapped correctly when both of those tasks are removed from AF?

Link to comment
Share on other sites

H270M-ITX/ac

load

load -nc

 

Which corresponds to which? The no connect flag to mem2.txt? You have one region that can be used and one that probably can't but might:

      Region: 0x000000000004341E pages at 0x0000000020100000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x0000000000020000 pages at 0x0000000020100000 slide=256

      Region: 0x0000000000000617 pages at 0x00000000739AD000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because the region has less available pages than current relocation region

As far as this, I guess there needs to be a better debug message and probably just a better way to allocate the memory map since I just did a quick pool allocate.

    GetMemMap(0x000000007644E048 [0x0000000000000000], NULL, 0x000000007644E058, 0x000000007644E050, 0x7644E040)
    Allocating memory map
    GetMemMap(0x000000007644E048 [0x0000000000000FC0], 0x0000000074175018, 0x000000007644E058, 0x000000007644E050, 0x7644E040)
  AllocateRelocationRegion() => Buffer Too Small

Since your first was the same size and it succeeded, weird. Guess need to make sure that it adds some padding and tries a few times.

    GetMemMap(0x000000007644E048 [0x0000000000000000], NULL, 0x000000007644E058, 0x000000007644E050, 0x7644E040)
    Allocating memory map
    GetMemMap(0x000000007644E048 [0x0000000000000FC0], 0x0000000078C2D018, 0x000000007644E058, 0x000000007644E050, 0x7644E040)
    Searching for best relocation region:
Link to comment
Share on other sites

Smaller one was -nc

May be idea to print command line in the dump

New test

 

Well interesting results, but really positive still. Your connecting one, which for me does not work because my computer crashes:

      Region: 0x000000000002DF48 pages at 0x0000000020100000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x0000000000020000 pages at 0x0000000020100000 slide=256

      Region: 0x000000000000FAA9 pages at 0x000000004E088000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because the region has less available pages than current relocation region

      Region: 0x0000000000005959 pages at 0x000000005E038000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because the region has less available pages than current relocation region

      Region: 0x0000000000000194 pages at 0x000000007A6BA000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because the region has less available pages than current relocation region

    Allocating relocation region - 0x0000000000020000 pages at 0x0000000020100000 slide=256
  AllocateRelocationRegion() => Success

Looks like it's a pretty predictable result where it's going to find the relocation region. Changing options in my firmware setup menu changes the areas that are available. Which makes sense, probably not loading (or freeing) stuff it doesn't need because disabled. Your not connecting one looks like the perfect result:

      Region: 0x000000000004DF48 pages at 0x0000000000100000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x0000000000020000 pages at 0x0000000000100000 slide=0

      Region: 0x000000000000FAA9 pages at 0x000000004E088000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because the region has less available pages than current relocation region

      Region: 0x0000000000005959 pages at 0x000000005E038000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because the region has less available pages than current relocation region

      Region: 0x0000000000000194 pages at 0x000000007A6BA000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because the region has less available pages than current relocation region

    Allocating relocation region - 0x0000000000020000 pages at 0x0000000000100000 slide=0
  AllocateRelocationRegion() => Success
Link to comment
Share on other sites

My xps15 9550.

OsxMemoryRelocation()
  AllocateRelocationRegion()
    GetMemMap(0x0000000031E27F98 [0x0000000000000000], NULL, 0x0000000031E27FA8, 0x0000000031E27FA0, 0x31E27F90)
    Allocating memory map
    GetMemMap(0x0000000031E27F98 [0x00000000000013B0], 0x0000000036B67018, 0x0000000031E27FA8, 0x0000000031E27FA0, 0x31E27F90)
    Searching for best relocation region:
      Region: 0x0000000000000001 pages at 0x0000000000000000 Type=0x00000006 Attribute=0x800000000000000F
      Region: 0x0000000000000057 pages at 0x0000000000001000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because outside limits 0x0000000000100000 - 0x00000000E0000000
      Region: 0x0000000000000001 pages at 0x0000000000058000 Type=0x00000000 Attribute=0x000000000000000F
      Region: 0x0000000000000044 pages at 0x0000000000059000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because outside limits 0x0000000000100000 - 0x00000000E0000000
      Region: 0x0000000000000002 pages at 0x000000000009D000 Type=0x00000000 Attribute=0x000000000000000F
      Region: 0x0000000000000001 pages at 0x000000000009F000 Type=0x00000006 Attribute=0x800000000000000F
      Region: 0x0000000000013D8B pages at 0x0000000000100000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x0000000000013D8B pages at 0x0000000000100000 slide=0
      Region: 0x0000000000000040 pages at 0x0000000013E8B000 Type=0x00000004 Attribute=0x000000000000000F
      Region: 0x000000000001DB6C pages at 0x0000000013ECB000 Type=0x00000007 Attribute=0x000000000000000F
        Relocation region - 0x000000000001DB37 pages at 0x0000000013F00000 slide=159
      Region: 0x00000000000000F0 pages at 0x0000000031A37000 Type=0x00000001 Attribute=0x000000000000000F
      Region: 0x0000000000001AB9 pages at 0x0000000031B27000 Type=0x00000004 Attribute=0x000000000000000F
      Region: 0x0000000000000001 pages at 0x00000000335E0000 Type=0x0000000A Attribute=0x000000000000000F
      Region: 0x000000000000004A pages at 0x00000000335E1000 Type=0x00000006 Attribute=0x800000000000000F
      Region: 0x0000000000000057 pages at 0x000000003362B000 Type=0x00000004 Attribute=0x000000000000000F
      Region: 0x00000000000007F1 pages at 0x0000000033682000 Type=0x00000006 Attribute=0x800000000000000F
      Region: 0x0000000000000008 pages at 0x0000000033E73000 Type=0x00000004 Attribute=0x000000000000000F
      Region: 0x0000000000001D61 pages at 0x0000000033E7B000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because the region has less available pages than current relocation region
      Region: 0x0000000000003288 pages at 0x0000000035BDC000 Type=0x00000004 Attribute=0x000000000000000F
      Region: 0x0000000000000192 pages at 0x0000000038E64000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because the region has less available pages than current relocation region
      Region: 0x0000000000000658 pages at 0x0000000038FF6000 Type=0x00000003 Attribute=0x000000000000000F
      Region: 0x00000000000003A9 pages at 0x000000003964E000 Type=0x00000000 Attribute=0x000000000000000F
      Region: 0x000000000000003E pages at 0x00000000399F7000 Type=0x00000009 Attribute=0x000000000000000F
      Region: 0x0000000000000424 pages at 0x0000000039A35000 Type=0x0000000A Attribute=0x000000000000000F
      Region: 0x00000000000005DC pages at 0x0000000039E59000 Type=0x00000006 Attribute=0x800000000000000F
      Region: 0x00000000000000CA pages at 0x000000003A435000 Type=0x00000005 Attribute=0x800000000000000F
      Region: 0x0000000000000001 pages at 0x000000003A4FF000 Type=0x00000004 Attribute=0x000000000000000F
      Region: 0x00000000003BE000 pages at 0x0000000100000000 Type=0x00000007 Attribute=0x000000000000000F
        Skipping because outside limits 0x0000000000100000 - 0x00000000E0000000
      Region: 0x0000000000000060 pages at 0x00000000000A0000 Type=0x00000000 Attribute=0x0000000000000000
      Region: 0x0000000000005B00 pages at 0x000000003A500000 Type=0x00000000 Attribute=0x0000000000000000
      Region: 0x0000000000010000 pages at 0x00000000E0000000 Type=0x0000000B Attribute=0x800000000000100D
      Region: 0x0000000000000011 pages at 0x00000000FE000000 Type=0x0000000B Attribute=0x8000000000000001
      Region: 0x0000000000000001 pages at 0x00000000FEC00000 Type=0x0000000B Attribute=0x8000000000000001
      Region: 0x0000000000000001 pages at 0x00000000FEE00000 Type=0x0000000B Attribute=0x800000000000100D
      Region: 0x0000000000001000 pages at 0x00000000FF000000 Type=0x0000000B Attribute=0x800000000000100D
    Allocating relocation region - 0x000000000001DB37 pages at 0x0000000013F00000 slide=159
  AllocateRelocationRegion() => Success
  Overriding start image boot service method
OsxMemoryRelocation() => Success
Image 'FS0:\1.efi' loaded at 38FF6000 - Success

1.txt.zip

Link to comment
Share on other sites

Here's the results from the three machines in my sig. I have to use AptioFixDrv on my Z68 as AptioFix2Drv almost always fails to load. By contrast I rarely have a failed boot with AptioFix2 on my X79 or Samsung laptop.

 

The zips contain two txt files, the one with _nc at the end is the output from "load -nc"

 

I ran the "load -nc" command first and then "load" afterwards. When I did this on my machines it looked as if the shell froze after running "load". But when I rebooted and checked the usb stick the output files were correctly written. Should I be rebooting before running the command again without the -nc parameter? Or is the -nc output the only one that matters?

 

Updated with output from all 3 machines now.

z68.zip

x79.zip

samsung.zip

Link to comment
Share on other sites

×
×
  • Create New...