Jump to content
vit9696

AptioMemoryFix

397 posts in this topic

Recommended Posts

This is a macOS bug. I also have it. Unless the initial installation has prev-lang:kbd set to a correct local language, all the subsequent updates may break the locale of the operating system. If you google it, you could find several reports on apple forums and in other places. Apple Radar is your friend.
okay. i have to keep emul option to avoid language issue. thank you so much:)

나의 LG-F800S 의 Tapatalk에서 보냄

Share this post


Link to post
Share on other sites
Advertisement

I have a problem starting boot.efi on an FV2 APFS partition. I have signed the boot.efi with the secureboot keys and can only get the graphics to work when I enable CSM in the BIOS.

 

Without CSM and with or without FASTBOOT,  MOHandleProtocol doesn't find the GOP (Graphics Output Protocol) on any file descriptor. I managed to find one at startup and save a that value, I checked the framebuffer address too and zeroed it so that I knew that it was valid but still no graphics output.

 

Without my changes I get an 0xE unsupported error. Adding the GOP manually gets me a display that is doing nothing. I can see two calls to the GOP device and no calls to any of the GOP methods.  Normally you see only the Blt call being made when things work.

 

Anyone have any ideas? The BIOS isn't going to be flashed on this device as I am currently repurposing int.

Share this post


Link to post
Share on other sites

Hi, I think it is not related to secure boot, but most likely your BIOS firmware does not properly implement GOP and uses UGA to draw the onscreen content. Perhaps some of the newer code expose parts of GOP (e.g. ConSplitter) but it does not guarantee that t is functional. I would suggest you write a shim betweeen GOP and UGA and submit it as a patch if it works out.

See https://github.com/tianocore/edk2/blob/master/MdePkg/Include/Protocol/UgaDraw.h.

Share this post


Link to post
Share on other sites

Hi, I did a dump of the ACPI tables with CSM enabled and those without CSM enabled. The only difference I could fild was the BGRT table and the annoying vendor logo. Does that ring any bells for anyone?

Share this post


Link to post
Share on other sites
Hi, I did a dump of the ACPI tables with CSM enabled and those without CSM enabled. The only difference I could fild was the BGRT table and the annoying vendor logo. Does that ring any bells for anyone?
ACPI is unrelated

Share this post


Link to post
Share on other sites

Yeah thanks, maybe its the devicetree?  :) Sometimes we cannot see the forest for the trees.

 

Turned out that the stupid efisimplepointer was causing the problem. I have disabled this in MOHandleProtocol thus:

 

  EFI_GUID Spp = { 0x31878C87, 0x0B75, 0x11D5, { 0x9A, 0x4F, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }};

  if (CompareGuid (Protocol, &Spp)) {
  DebugPrint(-1u, "Disabled %g\n", Protocol);
        return EFI_UNSUPPORTED;
  }

 

I even tried disabling the pointer but to no avail. Anyhow thanks for your help. The machine is an IvyBridge and I was thinking that it only had UGA till I started looking at the code.

 

I found it difficult to get debug from the screen so I moved the image to another machine and run this under Qemu. Does anyone know how to get input with qemu and either the PS/2 keyboard and/or USB. I compiled clover with EXIT_USBKB=1 but that didn't help.

 

Thanks again fellas.
 

Share this post


Link to post
Share on other sites

qemu -L ~/Desktop/QEMU-Clover/QEMU -m 2048 -cpu core2duo -bios bios.bin  -machine q35 -device ahci,id=ahc -drive format=raw,file=/Users/sergey/Desktop/QEMU-Clover/QEMU-test2.img -drive format=raw,file=/Users/sergey/Desktop/QEMU-Clover/freedos.img -usb -device usb-mouse,bus=usb-bus.0,port=2 -device usb-kbd,bus=usb-bus.0,port=-serial stdio

 

Снимок экрана 2018-08-17 в 8.05.51.png

Share this post


Link to post
Share on other sites
1 hour ago, Slice said:

qemu -L ~/Desktop/QEMU-Clover/QEMU -m 2048 -cpu core2duo -bios bios.bin  -machine q35 -device ahci,id=ahc -drive format=raw,file=/Users/sergey/Desktop/QEMU-Clover/QEMU-test2.img -drive format=raw,file=/Users/sergey/Desktop/QEMU-Clover/freedos.img -usb -device usb-mouse,bus=usb-bus.0,port=2 -device usb-kbd,bus=usb-bus.0,port=-serial stdio

 

 

 

Yeah impressive, but on linux I can get KVM to work. I used this

qemu-system-x86_64 -enable-kvm -nodefconfig -nodefaults -no-hpet -no-fd-bootchk -no-user-config -L /mnt/work/vm/etc -drive if=pflash,format=raw,readonly,file=./OVMF_CODE.fd -drive if=pflash,format=raw,file=./OVMF_VARS.fd -rtc base=utc,clock=host,driftfix=slew -m 4G -machine q35,accel=kvm,usb=off,vmport=off,kernel_irqchip=on -cpu IvyBridge,-apic,-x2apic,+pclmulqdq,+ssse3,+popcnt,+pclmulqdq,+avx2,+invpcid,+ss,+aes,+sse4.1,+sse4.2,+xsave,+xsaveopt,+avx,+fma,+rdtscp,+pcid,+abm,+movbe,+f16c,+rdrand,+fsgsbase,+tsc-adjust,+smep,+bmi2,+erms,+invpcid,+arat,+bmi1,+kvm-pv-unhalt,+kvmclock,+kvm-asyncpf,+kvm-steal-time,+kvm-pv-eoi,+kvmclock-stable-bit,+invtsc,vmware-cpuid-freq=on,kvm=on,vendor=GenuineIntel -smp cpus=4 -global ICH9-LPC.disable_s3=1 -global ICH9-LPC.disable_s4=1 -smbios '\''type=1,manufacturer=ASUSTeK COMPUTER INC.,product=UX31A,version=1.0,serial=XXXXXXXXXXXXXXX,uuid=XXXXXXXX-XXXX-XXXX-XXXX-RXXXXXXXXXXX,sku=ASUS-NotebookSKU,family=UX'\'' -acpitable file=/mnt/work/vm/etc/MSDM -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=32 -device ahci,id=ahci -drive id=disk0,if=none,format=raw,file=./sda.raw -device ide-drive,bus=ahci.0,drive=disk0,bootindex=1 -device ich9-usb-ehci1,id=ehci1 -device usb-kbd -device usb-tablet -display gtk -device ich9-intel-hda,msi=on,x-pcie-extcap-init=on -device hda-output -monitor none -chardev file,path=log.txt,id=log -chardev stdio,id=std -device isa-serial,iobase=0x3f8,chardev=log -device isa-debugcon,iobase=0x402,chardev=std -parallel none

 

BUT I cannot access FV2 using Qemu. Oh yeah that problem with CSM is for an ASUS UX31. I have tried with PS2 and USB mice but I cannot get password entry into FV2. Anyhow using that config I can pretty much emulate the entire HD on another machine -- even pass the HD graphics via VFIO on Haswell.

 

Is there some kind of trick to get FV2 to accept USB keyboard input?

Hey doesn't anyone know how to tweak the settings with polling for the AptioFixPkg? I notice that I am missing keystrokes and the logging is too verbose, when I enter a password on FV2?

Share this post


Link to post
Share on other sites

UsbKbDxe.efi in Clover repository is the special USB keyboard driver supporting fileVault2. The analogous EDK2 driver does not.

QEMU for macOS is not supporting KVM so all related to it should be cleaned.

As well using Clover no need to bother about SMBIOS.

-display gtk as well not reliable for mac, it is for linux only.

 

I think AptioFixPkg can't be used in QEMU because it corrects AMI UEFI BIOS which QEMU has no.

Share this post


Link to post
Share on other sites
4 minutes ago, Slice said:

UsbKbDxe.efi in Clover repository is the special USB keyboard driver supporting fileVault2. The analogous EDK2 driver does not.

QEMU for macOS is not supporting KVM so all related to it should be cleaned.

As well using Clover no need to bother about SMBIOS.

-display gtk as well not reliable for mac, it is for linux only.

 

I think AptioFixPkg can't be used in QEMU because it corrects AMI UEFI BIOS which QEMU has no.

 

Yeah that was the linux command line. Aptioinput cannot be used on linux nor qemu, because as you say they are not using AMI code. The crappy ASUS uses that bios version 219. I am noticing that sometime some key input is being missed for a few keystrokes. Like when I inter the password, I have to go something like passw (and to get the * for the w I have to hit w 2 to 5 times). Otherwise not a bad effort.

 

As for qemu I might start another thread but I don't need FV2 there. I just find it easier to debug on the emulator.

Share this post


Link to post
Share on other sites

Hello

Id like to report that on H310 board, AptioMemoryFix  dont work, osxaptiofixdrv+emuvariableuefi works though.

This has been the issue with the 300-series boards.

 

Edited by ellaosx

Share this post


Link to post
Share on other sites
1 hour ago, ellaosx said:

Hello

Id like to report that on H310 board, AptioMemoryFix  dont work, osxaptiofixdrv+emuvariableuefi works though.

This has been the issue with the 300-series boards.

 

"don't work", well then...

Share this post


Link to post
Share on other sites
51 minutes ago, Download-Fritz said:

Any errors should be printed to the screen in verbose boot mode.

 

18 minutes ago, ellaosx said:

@Download-Fritz

Ok noted. Il get back to you when im home.

Thanks :)

iir, there was none. Il try to look deeper.

I mean, i can boot with aptiomemoryfix without errors printing on the screen. but it just wont save nvram.

 

Later though, il check what i can find in the log.

 

Share this post


Link to post
Share on other sites
2 minutes ago, ellaosx said:

I mean, i can boot with aptiomemoryfix without errors printing on the screen. but it just wont save nvram.

Oh sorry, that was not clear. I have heard H-series boards sometimes have a NVRAM whitelist, which is out of scope for AptioMemoryFix, at least at the moment

Share this post


Link to post
Share on other sites
20 hours ago, ellaosx said:

Hello

Id like to report that on H310 board, AptioMemoryFix  dont work, osxaptiofixdrv+emuvariableuefi works though.

This has been the issue with the 300-series boards.

 

Try OsxAptioFix3Drv.efi it appears to fix nvram bug on 300 series.

You don't need EmuVariable or rc scripts.

Edited by STLVNUB

Share this post


Link to post
Share on other sites
11 hours ago, vit9696 said:

STLVNUB, do not post nonsense when you are unaware of the basics. It confuses people to the very least.

Sorry just making an observation which appeared to work for me so could work for him.

While OsxAptioFix3Drv.efi did make nvram work ( sort of ) it broke sleep and shutdown so back to OsxAptioFixDrv.efi for me.

Edited by STLVNUB

Share this post


Link to post
Share on other sites
18 hours ago, STLVNUB said:

Try OsxAptioFix3Drv.efi it appears to fix nvram bug on 300 series.

You don't need EmuVariable or rc scripts.

Im currenty using it :)

16 hours ago, vit9696 said:

ellaosx, name your board and link to the bios, might check a patch for it in the future.

H310M S2H

https://www.gigabyte.com/Motherboard/H310M-S2H-rev-11#kf

 

mb_bios_h310m-s2h_v11_fj.zip

Share this post


Link to post
Share on other sites

Your BIOS does not have NVRAM variable whitelist, so the problem is elsewhere. Most likely in some BIOS configuration (check AptioMemoryFix github README for recommendations) or in your hardware. For example, there were precedents of boards with <= 4 GB of RAM having not working NVRAM on APTIO V due to memory allocation problems.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×