Jump to content

Clover General discussion


ErmaC
29,866 posts in this topic

Recommended Posts

Because it also checks modifiers...?

Not really sure. when i turn on logscancodes with appleps2keyboard, it also sent modifier(except Fn) as seperate key :).

Just discovered: If you don't Locate the Apple Key State Protocol, boot.efi will able to handle Cmd+V :) 

Choice should be made here: Key process by clover or boot.efi ?

Link to comment
Share on other sites

You. No, nobody. Yes, rehabman pretty much IS the forum.

If that was sarcastic: anything else I see there are the quadzillionth question or guide regarding "how to install on machine Y". Pretty damn original.

 

 

Not really sure. when i turn on logscancodes with appleps2keyboard, it also sent modifier(except Fn) as seperate key :).

 

Just discovered: If you don't Locate the Apple Key State Protocol, boot.efi will able to handle Cmd+V :)

Choice should be made here: Key process by clover or boot.efi ?

PS/2 is not USB.

Idk what mad black magic clover does again, however this should be non-exclusive.

Link to comment
Share on other sites

If that was sarcastic: anything else I see there are the quadzillionth question or guide regarding "how to install on machine Y". Pretty damn original.

 

 

 

PS/2 is not USB.

Idk what mad black magic clover does again, however this should be non-exclusive.

 

I use all PS/2, I don't have even a single USB Keyboard in my house :)

Anyway, I don't understand what do you mean by non-exclusive here?

Link to comment
Share on other sites

The Apple protocol is based on the USB HID design as that is precisely what Apple uses, and not PS/2

???? What do you mean. I use PS2 Keyboard and it recognized single modifier key too.

Did you mean that the APPLE_KEY_MAP_DATABASE_PROTOCOL was designed for USB HID?

Link to comment
Share on other sites

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

For PS2 mouse and Keyboard ?

Did you try old kext in Clover kext ?

AppleACPIPS2Nub.kext, ApplePS2Controller.kext

Link to comment
Share on other sites

IIRC most (all?) MBPs are USB (don't remember 2016/2017), but the 12" MacBook (Core m) uses SPI.

 

Yes. There has never been a mac with PS/2 support, lol. Not one, ever. They had their own proprietary interface before, kinda the preface to firewire/usb/thunderbolt called apple desktop bus. It was created by steve wozniak and released in 1986 on one of the Apple II redesigns GS or GT or something. PS/2 wasn't released until the following year, with IBM's PS/2 model computer, that was almost positively to compete against the much better ADB over straight twisted pair serial ports.... So they made a serial bus that could only be used for specific purposes, in fact you used to have to specifically plug in the correct device or the protocol to recognize it was not even associated with the port. ADB works more like thunderbolt, only still a serial interface, but in 1986....... That guy is a {censored} genius.

 

EDIT: If you have a PS/2 controller, then you will need to modify the PS2 keyboard driver as well to populate the aggregator and database.

 

EDIT2: Also don't remove any keys from there, just inspect the protocol interfaces.

 

EDIT3: Oh just in case any one is wondering, SPI is Serial Peripheral Interface and is basically all of these put together, lol.

 

EDIT4: It looks like newer MacBookPros, especially with the touch bar probably use SPI too. Well, more specifically it's probably using Intel's proprietary eSPI. But there are evidence of SPI drivers needed for MacBookPro13,1+ in Ubuntu. As well as the afore mentioned newer MacBook.

  • Like 5
Link to comment
Share on other sites

Yes. There has never been a mac with PS/2 support, lol. Not one, ever. They had their own proprietary interface before, kinda the preface to firewire/usb/thunderbolt called apple desktop bus. It was created by steve wozniak and released in 1986 on one of the Apple II redesigns GS or GT or something. PS/2 wasn't released until the following year, with IBM's PS/2 model computer, that was almost positively to compete against the much better ADB over straight twisted pair serial ports.... So they made a serial bus that could only be used for specific purposes, in fact you used to have to specifically plug in the correct device or the protocol to recognize it was not even associated with the port. ADB works more like thunderbolt, only still a serial interface, but in 1986....... That guy is a {censored} genius.

 

EDIT: If you have a PS/2 controller, then you will need to modify the PS2 keyboard driver as well to populate the aggregator and database.

 

EDIT2: Also don't remove any keys from there, just inspect the protocol interfaces.

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?

Edited by Trung_Nguyen
Link to comment
Share on other sites

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 Platform.h & 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?

 

I don't understand what you mean.

 

EDIT: Oh wait, I think I understand. You mean ReadKeyState from the aggregator. I don't know what you mean by define in Platform.h or whatever, but making assumptions, the problem is the protocol definition is hidden in the protocol implementation and needs to be separated out like the other protocols into the include folder. The protocol GUID is not defined outside the implementation of the protocol so search for the other protocol GUIDs and define the GUID in the same place, it is probably somewhere in the platform folder.....  :sick: ...... Anyway, I think it should be pretty clear that if you read the key state information that you got rid of it, so you either have to put it back or need to translate it into options directly to boot.efi (it does not appear to be removed at all, so maybe even using SearchKeyStroke may be a better idea first to determine if there are any relevant keystrokes). Remember the fact that none of this needs to be done if boot.efi is not being autolaunched with timeout=0.

 

EDIT2: After looking at the protocol implementation, I don't think it removes any information, so it should definitely still be there for boot.efi.

 

EDIT3: More clarity, if there are any keys at all and boot.efi is not being autolaunched with timeout=0, then the GUI must show.

 

EDIT4: Ah, this whole comment is non-sense, even I don't know what I meant anymore because I am so confused by what he said and it just gets worse each time I read it.

 

EDIT5:  :blowup:

Link to comment
Share on other sites

EDIT4: It looks like newer MacBookPros, especially with the touch bar probably use SPI too. Well, more specifically it's probably using Intel's proprietary eSPI. But there are evidence of SPI drivers needed for MacBookPro13,1+ in Ubuntu. As well as the afore mentioned newer MacBook.

Yeah, I think you're right - 2016+ MBPs also use SPI for the keyboard/trackpad. I believe this out of tree driver is needed for Linux: https://github.com/cb22/macbook12-spi-driver

Link to comment
Share on other sites

Yeah, I think you're right - 2016+ MBPs also use SPI for the keyboard/trackpad. I believe this out of tree driver is needed for Linux: https://github.com/cb22/macbook12-spi-driver

 

Yes, sir, I don't see how else they could program the touch bars. Some of the models don't have touch bars but why make two different types of main board when you could just not connect a connector? That's way cheaper in mass production.

 

EDIT: Also eSPI may be built into every intel platform chipset from now on. It's definitely in the 100 series chipsets (chapter 17).

EDIT2: It is also part of 200 series, and the Z370 (still chapter 17), so I imagine, that yes, it will be in every intel platform chipset from now on.

Link to comment
Share on other sites

Though why would it work when the protocol is not located? Something is borked...

 

That's why I said I don't understand, I think he was referring to the protocol GUID in the code. The only thing I can think of that makes sense....

Link to comment
Share on other sites

Hello,

any progress about how to fix "org.clover.target.esp" under 10.11.x or below versions?

It uses "/" Root as a target installation instead of EFI Partition since r4399.

Feb  9 10:22:22 MacBookPro installd[614]: ./preinstall: /tmp/PKInstallSandbox.tVnuG1/Scripts/org.clover.target.esp.2dw1nN/preinstall: line 16: cd: //EFIROOTDIR: No such file or directory
...  . ........ ..........
Feb  9 10:22:22 MacBookPro installd[614]: ./preinstall: EFIFolder Pre-Install Script
Feb  9 10:22:22 MacBookPro installd[614]: ./preinstall: ===============================================
Feb  9 10:22:22 MacBookPro installd[614]: ./preinstall: preinstall: Path to installer....... /Users/badruzeus/Downloads/Apps/Clover_v2.4k_r4409.pkg
Feb  9 10:22:22 MacBookPro installd[614]: ./preinstall: preinstall: Path to destination..... /EFIROOTDIR
Feb  9 10:22:22 MacBookPro installd[614]: ./preinstall: preinstall: Path to dest volume..... /
Feb  9 10:22:22 MacBookPro installd[614]: ./preinstall: preinstall: Root of system folder... /

Thanks.  :)

 

 

I just backed old esp installation(it works for all macos before). Its not hold old esp installation. Just temptotally, back old esp installation. If micky new esp is no problem, we just reflect again.

Because badruzeus and chris reported this issue.

Strange. In beta2, diskutil list, can't you see apfs container(preboot,HS,recovery,vm)?

I tested both system and no problem.

And chris and badruzeus reported it works on 10.6.8, 10.11.6

Sorry for my bad english.

 

나의 LG-F800S 의 Tapatalk에서 보냄

 

 

For my part the latest , Clover works on all the OS, I  test of 10.6.8. to 10.13.4 B2 no failure even on APFS.

working also in EFI disque image

My opinion

Clover always work perfectly on all the OS and I do not see why it would not be the case now?

Edit ***  if you need log its not a no problems

Hi guys, maybe is only me to have problems, so can I ask what's your build number string of HS beta? ... I can confirm it works on a fresh installation of 10.13.3 ..but

And just for testing purpose, can you try if the attached build (working for me) is ok for you on different OSes you have?

Clover_v2.4k_r4415.pkg.zip

Link to comment
Share on other sites

Hi guys, maybe is only me to have problems, so can I ask what's your build number string of HS beta? ... I can confirm it works on a fresh installation of 10.13.3 ..but

And just for testing purpose, can you try if the attached build (working for me) is ok for you on different OSes you have?

Test macOS High Sierra bêta 10.13.4 (17E150g) Works

also test in Snow leopard 10.6.8 Works

 

the MountESP, partutil is different of the one from repos

Link to comment
Share on other sites

I don't understand what you mean.

 

EDIT: Oh wait, I think I understand. You mean ReadKeyState from the aggregator. I don't know what you mean by define in Platform.h or whatever, but making assumptions, the problem is the protocol definition is hidden in the protocol implementation and needs to be separated out like the other protocols into the include folder. The protocol GUID is not defined outside the implementation of the protocol so search for the other protocol GUIDs and define the GUID in the same place, it is probably somewhere in the platform folder.....  :sick: ...... Anyway, I think it should be pretty clear that if you read the key state information that you got rid of it, so you either have to put it back or need to translate it into options directly to boot.efi (it does not appear to be removed at all, so maybe even using SearchKeyStroke may be a better idea first to determine if there are any relevant keystrokes). Remember the fact that none of this needs to be done if boot.efi is not being autolaunched with timeout=0.

 

EDIT2: After looking at the protocol implementation, I don't think it removes any information, so it should definitely still be there for boot.efi.

 

EDIT3: More clarity, if there are any keys at all and boot.efi is not being autolaunched with timeout=0, then the GUI must show.

 

EDIT4: Ah, this whole comment is non-sense, even I don't know what I meant anymore because I am so confused by what he said and it just gets worse each time I read it.

 

EDIT5:  :blowup:

 

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
Link to comment
Share on other sites

the MountESP, partutil is different of the one from repos

sure, posting the same exactly stuff will not make sense otherwise.

Test macOS High Sierra bêta 10.13.4 (17E150g) Works

17E150g? I have 17E151f ??  Downloaded from the developer center one week ago. 

EDIT

 

WTH, downloaded/installed the beta on a secondary hack the same way and it show 17E150g like you. just logged now  :worried_anim:, what's going on?

..going to sleep

Edited by vector sigma
Link to comment
Share on other sites

×
×
  • Create New...