Jump to content

Trung_Nguyen

Members
  • Content count

    75
  • Joined

  • Last visited

About Trung_Nguyen

  • Rank
    InsanelyMac Protégé

Profile Information

  • Gender
    Male
  • Location
    Hanoi, Vietnam
  1. Trung_Nguyen

    [pre-release] macOS Mojave

    BTW, I saw Chrome on the Dock after power up (actually, My laptop didn't brick like yours, it simply turn off). Maybe That relates to hibernate??? I leave it 3 since no problem with HS.
  2. Trung_Nguyen

    [pre-release] macOS Mojave

    Hi everyone, my E6230 Mojave unexpectedly shutdown while sleeping with ACPI Power Management in the BIOS Power log. The problem seems to gone once when EC reset but come back later. PLEASE HELP! Thanks Everyone.CLOVER.zip
  3. Trung_Nguyen

    [pre-release] macOS Mojave

    The new AppleALC works pretty good execpt I lost the headphone mic of the IDT92HD93BXX now.
  4. Trung_Nguyen

    [pre-release] macOS Mojave

    BTW, How did you get the audio layout-id, I couldn't find any other working one. Thanks.
  5. Trung_Nguyen

    [pre-release] macOS Mojave

    Still couldn't find a working audio layout-id to replace the layout-id 12 for the IDT92HD93. BTW, I have the layout-id specified in the DSDT.aml of the HDEF device, do I need to change that in order to change the layout-id for the AppleALC? Thanks
  6. Trung_Nguyen

    [pre-release] macOS Mojave

    I lost the Audio for the IDT92XX93(layout 12) after upgrade, the filevault password logon screen doesn't have the background
  7. Trung_Nguyen

    Going Full hotpatch Dell E6230

    Hello, I have been a long time with the DSDT.aml and an old BIOS so I decided to go to full hotpatch in order that I could update my BIOS flawlessly Most things works now(Audio,Brightness slider,...)except the Bluetooth and the Brightness key(IOWMIFamily) The Bluetooth is located on an USB hub and now it said Bluetooth: Not Available and not found in Sysinfo BT sub-page. I tried to patch the _Q66 into XQ66 to add the code the notify the driver but it doesn't seem to work. The brightness key no longer work on it own(as I have patch the _OSI). So the last thing to do is patch the _Q66 to receive the signal. Thanks all Archive.zip
  8. Trung_Nguyen

    Clover General discussion

    Oh I have AptioInputFix now, Why do I need a PS2 Driver anymore? What I'm trying to get now is to get the Alt/Option (modifiers) is recognized when pressed just that key. I think it is possible because in the keyboard viewer, when you pressed a modifier, it still show it. EDIT: Currently I worked around by holding another key with alt(Alt+C) for GUI, what do you think? cmd+R: boot.efi doesn't chain-load to the Recovery's boot.efi. Maybe we have to find a way for it to find the Recovery partition when found the cmd+R
  9. Trung_Nguyen

    Clover General discussion

    I read it. I didn't calling it in a loop. Just once in Refitmain? main.c.zip EDIT: Wait a min, so it write asynchronously to the array which is point in the parameter? I thought it was the immediate result. Sorry
  10. Trung_Nguyen

    Clover General discussion

    Protocol's ReadKeyState will take forever while you hold the combination! Also GRUB's KeyStatus can fetch the state of modifier keys, can it be used?
  11. Trung_Nguyen

    Clover General discussion

    Currently, I'm working to make all Apple Boot Keys works(for AMI Aptio boards, at least for laptops) even the alt key. Trying to make the AptioInputFix more useful , attempt to make it to sent modifier key like Alt for GUI, Shift for Safe Mode.
  12. Trung_Nguyen

    Clover General discussion

    If you couldn't understand what I meant, then run it by your self This is the diff patch, try changing the LazyClover variable: Index: CloverPkg.dec =================================================================== --- CloverPkg.dec (revision 4415) +++ CloverPkg.dec (working copy) @@ -70,6 +70,8 @@ ## Include/Protocol/EmuVariableControl.h gEmuVariableControlProtocolGuid = {0x21f41e73, 0xd214, 0x4fcd, {0x85, 0x50, 0x0d, 0x11, 0x51, 0xcf, 0x8e, 0xfb }} + ## Include/Protocol/AppleKeyState.h + gAppleKeyStateProtocolGuid = {0x5b213447, 0x6e73, 0x4901, {0xa4, 0xf1, 0xb8, 0x64, 0xf3, 0xb7, 0xa1, 0x72}} #Apple's protocols gEfiConsoleControlProtocolGuid = {0xF42F7782, 0x012E, 0x4C12, {0x99, 0x56, 0x49, 0xF9, 0x43, 0x04, 0xF7, 0x21}} Index: Include/Protocol/AppleKeyAggregator.h =================================================================== --- Include/Protocol/AppleKeyAggregator.h (revision 4415) +++ Include/Protocol/AppleKeyAggregator.h (working copy) @@ -5,7 +5,8 @@ // Created by Slice on 26.10.16. // based on CupertinoNet // - +#include <Protocol/AppleKeyState.h> +#include <Protocol/AppleKeyMapDatabase.h> #ifndef _AppleKeyMapAggregator_h #define _AppleKeyMapAggregator_h Index: Protocols/AppleKeyAggregator/AppleKeyAggregator.c =================================================================== --- Protocols/AppleKeyAggregator/AppleKeyAggregator.c (revision 4415) +++ Protocols/AppleKeyAggregator/AppleKeyAggregator.c (working copy) @@ -19,7 +19,7 @@ #include <Protocol/AppleKeyState.h> #include <Protocol/AppleKeyMapDatabase.h> -#include "AppleKeyAggregator.h" +#include <Protocol/AppleKeyAggregator.h> // KeyMapGetKeyStrokesByIndex APPLE_KEY_STROKES_INFO * Index: Protocols/AppleKeyAggregator/AppleKeyAggregator.h =================================================================== --- Protocols/AppleKeyAggregator/AppleKeyAggregator.h (revision 4415) +++ Protocols/AppleKeyAggregator/AppleKeyAggregator.h (nonexistent) @@ -1,81 +0,0 @@ -// -// AppleKeyMapAggregator.h -// -// -// Created by Slice on 26.10.16. -// based on CupertinoNet -// - -#ifndef _AppleKeyMapAggregator_h -#define _AppleKeyMapAggregator_h - -#define APPLE_KEY_MAP_PROTOCOLS_REVISION 0x010000 -#define APPLE_KEY_MAP_AGGREGATOR_SIGNATURE SIGNATURE_32 ('K', 'e', 'y', 'A') - -#define APPLE_KEY_STROKES_INFO_SIGNATURE SIGNATURE_32 ('K', 'e', 'y', 'S') - -#define APPLE_KEY_MAP_AGGREGATOR_PRIVATE_FROM_AGGREGATOR(This) \ - CR ( \ - (This), \ - APPLE_KEY_MAP_AGGREGATOR, \ - AggregatorProtocol, \ - APPLE_KEY_MAP_AGGREGATOR_SIGNATURE \ - ) - -#define APPLE_KEY_MAP_AGGREGATOR_PRIVATE_FROM_DATABASE(This) \ - CR ( \ - (This), \ - APPLE_KEY_MAP_AGGREGATOR, \ - DatabaseProtocol, \ - APPLE_KEY_MAP_AGGREGATOR_SIGNATURE \ - ) - -#define APPLE_KEY_STROKES_INFO_FROM_LIST_ENTRY(Entry) \ -((APPLE_KEY_STROKES_INFO *)( \ - CR ( \ - (Entry), \ - APPLE_KEY_STROKES_INFO_HDR, \ - This, \ - APPLE_KEY_STROKES_INFO_SIGNATURE \ - ) \ -)) -/* -typedef struct _EFI_LIST_ENTRY { - struct _EFI_LIST_ENTRY *ForwardLink; - struct _EFI_LIST_ENTRY *BackLink; -} EFI_LIST_ENTRY; - -typedef EFI_LIST_ENTRY EFI_LIST; -*/ - -// APPLE_KEY_STROKES_INFO_HDR -typedef struct { - UINTN Signature; ///< - LIST_ENTRY This; ///< - UINTN Index; ///< - UINTN KeyBufferSize; ///< - UINTN NumberOfKeys; ///< - APPLE_MODIFIER_MAP Modifiers; ///< -} APPLE_KEY_STROKES_INFO_HDR; - -// APPLE_KEY_STROKES_INFO -typedef struct { - APPLE_KEY_STROKES_INFO_HDR Hdr; ///< - APPLE_KEY Keys; ///< -} APPLE_KEY_STROKES_INFO; - - -// APPLE_KEY_MAP_AGGREGATOR -typedef struct { - UINTN Signature; ///<0 - UINTN NextKeyStrokeIndex; ///<0x08 - APPLE_KEY *KeyBuffer; ///<0x10 - UINTN KeyBuffersSize; ///<0x18 - LIST_ENTRY KeyStrokesInfoList; ///<0x20 - APPLE_KEY_MAP_DATABASE_PROTOCOL DatabaseProtocol; ///<0x30 size=8*4 - APPLE_KEY_STATE_PROTOCOL AggregatorProtocol; ///<0x50 size=8*3 -} APPLE_KEY_MAP_AGGREGATOR; //size=0x68 - - - -#endif Index: Xcode/Clover/Clover.xcodeproj/project.pbxproj =================================================================== --- Xcode/Clover/Clover.xcodeproj/project.pbxproj (revision 4415) +++ Xcode/Clover/Clover.xcodeproj/project.pbxproj (working copy) @@ -1208,7 +1208,6 @@ isa = PBXGroup; children = ( 12AAF5F21DC0F03B00A52B12 /* AppleKeyAggregator.c */, - 12AAF5F31DC0F03B00A52B12 /* AppleKeyAggregator.h */, 12AAF5F41DC0F03B00A52B12 /* AppleKeyAggregator.inf */, ); path = AppleKeyAggregator; @@ -2744,6 +2743,7 @@ 2C794ADC1A0AA85900D845B0 /* Protocol */ = { isa = PBXGroup; children = ( + 12AAF5F31DC0F03B00A52B12 /* AppleKeyAggregator.h */, 2C794AD21A0AA85900D845B0 /* AppleDeviceControl.h */, 2C794AD31A0AA85900D845B0 /* AppleDiskIo.h */, 12AAF5171DBE28B800A52B12 /* AppleEvent.h */, Index: rEFIt_UEFI/Platform/Platform.h =================================================================== --- rEFIt_UEFI/Platform/Platform.h (revision 4415) +++ rEFIt_UEFI/Platform/Platform.h (working copy) @@ -65,6 +65,7 @@ #include <Protocol/EmuVariableControl.h> #include <Protocol/AppleSMC.h> #include <Protocol/AppleImageCodecProtocol.h> +#include <Protocol/AppleKeyAggregator.h> #include "../refit/lib.h" #include "string.h" Index: rEFIt_UEFI/refit/main.c =================================================================== --- rEFIt_UEFI/refit/main.c (revision 4415) +++ rEFIt_UEFI/refit/main.c (working copy) @@ -39,7 +39,6 @@ //#include "../include/Handle.h" #include "Version.h" - #ifndef DEBUG_ALL #define DEBUG_MAIN 1 #else @@ -84,6 +83,8 @@ EMU_VARIABLE_CONTROL_PROTOCOL *gEmuVariableControl = NULL; +APPLE_KEY_STATE_PROTOCOL *gAppleKeyState=NULL; + extern VOID HelpRefit(VOID); extern VOID AboutRefit(VOID); extern BOOLEAN BooterPatch(IN UINT8 *BooterData, IN UINT64 BooterSize, LOADER_ENTRY *Entry); @@ -1868,7 +1869,6 @@ RecIter++; } } - // // main entry point // @@ -1897,7 +1897,10 @@ EFI_TIME Now; BOOLEAN HaveDefaultVolume; CHAR16 *FirstMessage; - + APPLE_MODIFIER_MAP ModifyFlags; + UINTN PressedKeyCount; + APPLE_KEY *Keys=NULL; + BOOLEAN LazyClover=TRUE; // CHAR16 *InputBuffer; //, *Y; // EFI_INPUT_KEY Key; @@ -1908,7 +1911,7 @@ // get TSC freq and init MemLog if needed gCPUStructure.TSCCalibr = GetMemLogTscTicksPerSecond(); //ticks for 1second //GlobalConfig.TextOnly = TRUE; - + // bootstrap gST = SystemTable; gImageHandle = ImageHandle; @@ -2126,8 +2129,29 @@ //DBG("LoadDrivers() start\n"); LoadDrivers(); - //DBG("LoadDrivers() end\n"); - + //DBG("LoadDrivers() end\n"); + //If Clover is too lazy, he will let boot.efi handle the stuff + if(!LazyClover){ + Status=gBS->LocateProtocol(&gAppleKeyStateProtocolGuid,NULL,(VOID**)&gAppleKeyState); + if(EFI_ERROR(Status)) + { + gAppleKeyState=NULL; + } + if(Status==EFI_SUCCESS) + { + DBG("Protocol Located!\n"); + Status=gAppleKeyState->ReadKeyState(gAppleKeyState,&ModifyFlags,&PressedKeyCount,Keys); + if(Status==EFI_SUCCESS) + { + DBG("ReadKeyState Succeesful\n"); + DBG("PressedKeyCount:%d!\n",PressedKeyCount); + for(i=0;i<PressedKeyCount;i++) + { + DBG("Keys:",Keys[i],"\n"); + } + } + }} + /* if (!gFirmwareClover && !gDriversFlags.EmuVariableLoaded) { GetSmcKeys(FALSE); // later we can get here SMC information Index: rEFIt_UEFI/refit.inf =================================================================== --- rEFIt_UEFI/refit.inf (revision 4415) +++ rEFIt_UEFI/refit.inf (working copy) @@ -251,7 +251,7 @@ gMsgLogProtocolGuid gEfiPlatformDriverOverrideProtocolGuid gEmuVariableControlProtocolGuid - + gAppleKeyStateProtocolGuid [FeaturePcd] gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport
  13. Trung_Nguyen

    Clover General discussion

    I don't remove any keys from the buffer, just read it. Inspected with ReadKeyStroke Function, found out that if the protocol is define in CloverPkg.dec & not Located by Clover and then boot.efi will handle it and parse -v/-s but Shift not work, not even by Clover/boot.efi as it is the modifier. Any solutions here?
  14. Trung_Nguyen

    Clover General discussion

    Probably USB HID: Check this out: https://opensource.apple.com/source/IOHIDFamily/IOHIDFamily-1035.41.2/IOHIDFamily/AppleEmbeddedKeyboard.cpp.auto.html
  15. Trung_Nguyen

    Clover General discussion

    humm, I thought Built-in Apple Keyboard on MacBook are connected by PS2? So It is by USB?
×