Jump to content

AptioMemoryFix


vit9696
595 posts in this topic

Recommended Posts

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.
 

Link to comment
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

  • Like 1
Link to comment
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?

Link to comment
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.

Link to comment
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.

Link to comment
Share on other sites

  • 4 weeks later...
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.

 

Link to comment
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

  • Like 2
Link to comment
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
  • Like 1
Link to comment
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
Link to comment
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

Link to comment
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.

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

@vit9696

first of all, thank you for your cleannvram.efi.

i received report that users have freeze system when using cleannvram.efi

not sure where freeze system issue happen. seems haswell board under?

https://github.com/acidanthera/AptioFixPkg/blob/master/Application/CleanNvram/CleanNvram.c#L125

125

126

zeromem seems properly not working in some system.

 

in my case(phoenix bios), have little freeze about 3sec(not hold). but feature is perfectly working.

Edited by Sherlocks
Link to comment
Share on other sites

I do not believe that the UDK-provided ZeroMem could be of any issue. If it is, then it should reported to edk2-devel.
right. in do part, there is something wrong in some bios.
zeromem is no problem. i checked it again.
Pavo has freeze when using cleannvram.efi.
maybe he can help you for debug.
[mention=980913]Sherlocks[/mention],
I have not looked at code. Just wild guess -- may be SMM code trying to protect integrity of NVRAM?
no. seems logic has some wrong part that causes freeze.

나의 LG-F800S 의 Tapatalk에서 보냄

Link to comment
Share on other sites

11 hours ago, Sherlocks said:

no. seems logic has some wrong part that causes freeze.

I just went through it and while one aspect seems to be borked, I don't see anything that should cause a stall.

Maybe GetNextVariableName() never returns EFI_NOT_FOUND on that machine? We'll need more information on the issue.

  • Like 3
Link to comment
Share on other sites

I just went through it and while one aspect seems to be borked, I don't see anything that should cause a stall.

Maybe GetNextVariableName() never returns EFI_NOT_FOUND on that machine? We'll need more information on the issue.

 

maybe. not sure. i can't debug correctly.

i fixed this issue like this.

 

maybe some system never stop do funtion(?). Pavo system has freeze issue.

cleannvram efi is no problem on my system.

https://sourceforge.net/p/cloverefiboot/code/4718/tree//rEFIt_UEFI/Platform/Nvram.c#l341

 

 

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...