Contribute
Register

[Guide] How to patch DSDT for working battery status

RehabMan, Thanks for the instructions.
by following it I was able to to make my battery indicator working like a charm.
I used the same exact file from your LAPTop-DSDT-Patch, battery repository. I found this file name 'battery_Samsung-Series3-NP300.txt' which worked in my situation on Samsung NP900X3C Series 9 Laptop.

Attached is my original DSDT.dsl. Extracted DSDT files with UBUNTU OS.

View attachment 202107 View attachment 202108
Screen-shoots with/without the power supply plugged.

Please fill out your profile so we know what additional laptop that patch applies to. I will add it to the comments within the patch...

Please provide complete details in your profile/signature
(Profile/Settings link in upper right corner of this site)

Mobo: manufacturer/model + bootloader(Clover/Chameleon/Chimera)
CPU: detailed CPU model + motherboard chipset
Graphics: all graphics devices + laptop internal screen resolution

For example, typical Ivy laptop:
Mobo: HP ProBook 4540s (Clover)
CPU: i5-3320m/HM76
Graphics: HD4000, 1366x768

Use CPU-Z on Windows to find CPU (Core iX-xxx) and motherboard chipset (HMxx), and graphics capabilities. For a laptop, these details are important and affect critical installation procedures.

Note: When specifying your bootloader, if using Clover legacy, please be sure to specify "Clover legacy"). Specifying "Clover" will be assumed as "Clover UEFI"
 
Hi Rehabman.
I have a problem when i try to patch dsdt for battery.
There are "only" three positions with 16bits. I do the first step without problems:

into device label H_EC code_regex B1CC,\s+16, replace_matched begin 1CC0,8,1CC1,8, end;
into device label H_EC code_regex B1FC,\s+16, replace_matched begin 1FC0,8,1FC1,8, end;
into device label H_EC code_regex B1FV,\s+16, replace_matched begin 1FV0,8,1FV1,8, end;

After, also without problems:
into method label B1B2 remove_entry;
into definitionblock code_regex . insert
begin
Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n
end;


But when i try to do the final step, it's no possible: Apply buttom is out.

into method label GBTI code_regex \(B1CC, replaceall_matched begin (B1B2(1CC0,1CC1), end;
into method label GBTI code_regex \(B1FC, replaceall_matched begin (B1B2(1FC0,1FC1), end;
into method label GBTI code_regex \(B1FV, replaceall_matched begin (B1B2(1FV0,1FV1), end;

All of this i do it in DSDT.dsl, because i read that is better (also i try in dsdt.aml)

What I'm doing wrong?
Thanks
Konakan
 

Attachments

  • EFI.zip
    2.8 MB · Views: 101
  • extensions.zip
    935 bytes · Views: 72
  • KextStat.zip
    825 bytes · Views: 74
  • MacBook Air.zip
    421.8 KB · Views: 82
  • RehabMan.zip
    36.2 KB · Views: 80
Hi Rehabman.
I have a problem when i try to patch dsdt for battery.
There are "only" three positions with 16bits. I do the first step without problems:

into device label H_EC code_regex B1CC,\s+16, replace_matched begin 1CC0,8,1CC1,8, end;
into device label H_EC code_regex B1FC,\s+16, replace_matched begin 1FC0,8,1FC1,8, end;
into device label H_EC code_regex B1FV,\s+16, replace_matched begin 1FV0,8,1FV1,8, end;

After, also without problems:
into method label B1B2 remove_entry;
into definitionblock code_regex . insert
begin
Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n
end;


But when i try to do the final step, it's no possible: Apply buttom is out.

into method label GBTI code_regex \(B1CC, replaceall_matched begin (B1B2(1CC0,1CC1), end;
into method label GBTI code_regex \(B1FC, replaceall_matched begin (B1B2(1FC0,1FC1), end;
into method label GBTI code_regex \(B1FV, replaceall_matched begin (B1B2(1FV0,1FV1), end;

All of this i do it in DSDT.dsl, because i read that is better (also i try in dsdt.aml)

What I'm doing wrong?
Thanks
Konakan

B1CC reference appears in method named _BST, not GBTI.
B1FC reference appears in method named _BIF and _BTP, not GBTI.
B1FV reference appears in method named _BTP, not GBTI.

--

Please provide complete details in your profile/signature
(Profile/Settings link in upper right corner of this site)

Mobo: manufacturer/model + bootloader(Clover/Chameleon/Chimera)
CPU: detailed CPU model + motherboard chipset
Graphics: all graphics devices + laptop internal screen resolution

For example, typical Ivy laptop:
Mobo: HP ProBook 4540s (Clover)
CPU: i5-3320m/HM76
Graphics: HD4000, 1366x768

Use CPU-Z on Windows to find CPU (Core iX-xxx) and motherboard chipset (HMxx), and graphics capabilities. For a laptop, these details are important and affect critical installation procedures.

Note: When specifying your bootloader, if using Clover legacy, please be sure to specify "Clover legacy"). Specifying "Clover" will be assumed as "Clover UEFI"
 
Mobo:_ Hasee E570 (Clover)
CPU: i7 4710MQ / HM86
Graphics: HD4600, 1366x768


Here it is!!
 
Mobo:_ Hasee E570 (Clover)
CPU: i7 4710MQ / HM86
Graphics: HD4600, 1366x768


Here it is!!

Please, in your profile, as requested.
 
Now, after apply the patchs, when I try to compile it, there are several errors.
I attach it.



into method label _BST code_regex \(B1CC, replaceall_matched begin (B1B2(1CC0,1CC1), end;
into method label _BIF code_regex \(B1FC, replaceall_matched begin (B1B2(1FC0,1FC1), end;
into method label _BTP code_regex \(B1FC, replaceall_matched begin (B1B2(1FC0,1FC1), end;
into method label _BTP code_regex \(B1FV, replaceall_matched begin (B1B2(1FV0,1FV1), end;

Thank you for your attention
Konakan
 

Attachments

  • error.png
    error.png
    47.1 KB · Views: 118
Now, after apply the patchs, when I try to compile it, there are several errors.
I attach it.



into method label _BST code_regex \(B1CC, replaceall_matched begin (B1B2(1CC0,1CC1), end;
into method label _BIF code_regex \(B1FC, replaceall_matched begin (B1B2(1FC0,1FC1), end;
into method label _BTP code_regex \(B1FC, replaceall_matched begin (B1B2(1FC0,1FC1), end;
into method label _BTP code_regex \(B1FV, replaceall_matched begin (B1B2(1FV0,1FV1), end;

Thank you for your attention
Konakan

You will need to look at the code to determine why your patch causes an error.
 
Yes, all are 6126, syntax error. There are several patches in your repository named parseop, but no one fix this.

15909 - 6126 - syntax error, unexpected PARSEOP_INTEGER, expecting ',' or ')'
16164 - 6126 - syntax error, unexpected PARSEOP_NAMESEG, expecting ',' or ')'
16178 - 6126 - syntax error, unexpected PARSEOP_NAMESEG, expecting ',' or ')'
16451 - 6126 - syntax error, unexpected PARSEOP_DEVICE, expecting $end and premature End-of-file
 
Yes, all are 6126, syntax error. There are several patches in your repository named parseop, but no one fix this.

15909 - 6126 - syntax error, unexpected PARSEOP_INTEGER, expecting ',' or ')'
16164 - 6126 - syntax error, unexpected PARSEOP_NAMESEG, expecting ',' or ')'
16178 - 6126 - syntax error, unexpected PARSEOP_NAMESEG, expecting ',' or ')'
16451 - 6126 - syntax error, unexpected PARSEOP_DEVICE, expecting $end and premature End-of-file

The problem is your patch. Fix your patch instead of looking for a patch to fix your mistake...

You must be certain that any patch you create/apply results in code that conforms to the ACPI spec. For example, ACPI identifiers cannot begin with a digit. If you look at your patches carefully, you'll see they do not conform to this rule.
 
Last edited:
Thank you, RehabMan. Surely it's my problem. I apply the lines that I was send you before. I don't know how do it better.
Best Regards
 
Back
Top