[Guide] How to Patch DSDT for a working Battery Meter


EliteMacx86

Administrator
Staff member
Joined
Jul 22, 2018
Messages
481
Motherboard
GIGABYTE Z370 AROUS GAMING 3
CPU
Intel Core i9 9900K
Graphics
2xAMD RX 580 8GB
OS X/macOS
10.14.6
Bootloader
Clover (UEFI)
Mac
MacBook Pro
Mobile Phone
Android, iOS
For a laptop, a working battery meter is must. Enabling Battery meter will help you to monitor your Battery so that you do not over charge your Laptop or you don’t get out of your Battery. In macOS, the battery meter doesn't works out of the box. This is because the laptop battery hardware is not compatible with the AppleSMbus hardware. You need to use ACPI to access the battery state when running macOS on laptop.

RehabMan has developed a kext called ACPIBatteryManager.kext which can be found here: https://github.com/RehabMan/OS-X-ACPI-Battery-Driver
Thanks to him for his great contribution as always for the OS X community.

Many patches is available in the RehabMan repository and can be used for making a battery meter to work for almost any laptop.

Before you start the patching, get to know about your hardware. Read here : https://www.elitemacx86.com/threads/faq-read-first-frequent-questions-related-to-laptop.136/

To start the patching for the battery meter, follow the DSDT and SSDTs patching guide here: https://www.elitemacx86.com/threads/guide-how-to-patch-laptop-dsdt-and-ssdts.142/

After applying the necessary patches, it's time to apply the patches for a working battery matter.

Applying the Patches

To Apply the patch, follow the steps below.
  1. Open your DSDT using MaciASL
  2. The battery patches starts with "[bat]".
  3. Depending on your laptop model, select the patch from the left pane in MaciASL.
  4. Click on Apply
  5. Click on Close
Note:
  • The laptop model no. needs to be exact for the proper functioning of the battery meter.
  • Some laptops model may not be listed. In this case, you'll need to select a patch which is nearest to your laptop model.
For example, typica laptop from ASUS:
Laptop: ASUS VivoBook X510UA
Battery Patch: [bat]

Compiling

After patching the DSDT and SSDTs, you need to compile the files.
Simply click on compile and look for errors. If there's any error, fix it and again click on Compile.
If there's no error, the files will be compiled successfully.

Saving the ACPI files

After compiling, the next step is to save the file for the installation.
  1. Go to File
  2. Select Save as
  3. A dialogue box will appear asking the location and the file extension to save the file.
  4. Select ACPI(ACPI Machine Language)
  5. Click on Save
Note:
  • It's a good idea to save the patched DSDT and SSDTs in any other location than the orginal.
Installing kexts for Battery meter
After patching the DSDT, the next step is to install the Battery kext to serve the purpose.

Downlod
  1. ACPIBatteryManager
Notes :
  • Download the latest version for better support.
Extract the .Zip, copy the kext from the Release folder to your Desktop
Open terminal, type:
Code:
sudo cp -R /Users/yourusername/Desktop/Yourkextname.kext /System/Library/Extensions
When promoted, enter your password
After installing kexts, it's important to rebuild the cache
Type:
Code:
sudo kextcache -i /
Restart your laptop.
The Battery meter should be there.
Credits :
RehabMan
 

Shekhar Kausalye

New member
Joined
Oct 9, 2018
Messages
16
Motherboard
ASUS VivoBook X541UA
CPU
Intel Corei3 7100U 2.4GHz
Graphics
Intel HD Graphics 620
OS X/macOS
10.14.6
Bootloader
Clover (UEFI)
Mac
MacBook Pro
Mobile Phone
Android
Hello
I am having small doubt. I have patched the DSDT & SSDTs. Now as I want to enable Battery Meter I am following this above guide. So which DSDT & SSDTs should I take for patching Battery Meter. Also do I need dsl files of DSDT & SSDTs for this patching (if yes then should I have to create these dsl files form the EFI/CLOVER/ACPI/patched folder and then apply the above patches; because DSDT & SSDTs stored here are latest patched). Or should I directly open the DSDT & SSDTs aml files using MaciASL from EFI/CLOVER/ACPI/patched and apply the above patches then save the file (whether this is allowed or not?).
Also I need to apply above patched in DSDT & All SSDTs????

Sorry for making so much confusion despite of above well explained guide.
Thanking you.
 
Last edited by a moderator:

EliteMacx86

Administrator
Staff member
Joined
Jul 22, 2018
Messages
481
Motherboard
GIGABYTE Z370 AROUS GAMING 3
CPU
Intel Core i9 9900K
Graphics
2xAMD RX 580 8GB
OS X/macOS
10.14.6
Bootloader
Clover (UEFI)
Mac
MacBook Pro
Mobile Phone
Android, iOS
Hello
I am having small doubt. I have patched the DSDT & SSDTs. Now as I want to enable Battery Meter I am following this above guide. So which DSDT & SSDTs should I take for patching Battery Meter. Also do I need dsl files of DSDT & SSDTs for this patching (if yes then should I have to create these dsl files form the EFI/CLOVER/ACPI/patched folder and then apply the above patches; because DSDT & SSDTs stored here are latest patched). Or should I directly open the DSDT & SSDTs aml files using MaciASL from EFI/CLOVER/ACPI/patched and apply the above patches then save the file (whether this is allowed or not?).
Also I need to apply above patched in DSDT & All SSDTs????

Sorry for making so much confusion despite of above well explained guide.
Thanking you.
The guide says to apply the patches in the DSDT not any other SSDTs. If you're starting from scratch, and the DSDT is not patched, you can use the .dsl file and apply all the patches. If already patched, just apply the battery patch to the .aml file of your DSDT, the patched one.
 

Shekhar Kausalye

New member
Joined
Oct 9, 2018
Messages
16
Motherboard
ASUS VivoBook X541UA
CPU
Intel Corei3 7100U 2.4GHz
Graphics
Intel HD Graphics 620
OS X/macOS
10.14.6
Bootloader
Clover (UEFI)
Mac
MacBook Pro
Mobile Phone
Android
Thanks. Now the thing is clear for me. (y)(y)(y).
Will do the patch and reply.


Hey its working. The Battery meter is shown in menu bar.
Thanks.(y)
 
Last edited:

EliteMacx86

Administrator
Staff member
Joined
Jul 22, 2018
Messages
481
Motherboard
GIGABYTE Z370 AROUS GAMING 3
CPU
Intel Core i9 9900K
Graphics
2xAMD RX 580 8GB
OS X/macOS
10.14.6
Bootloader
Clover (UEFI)
Mac
MacBook Pro
Mobile Phone
Android, iOS