ProjectOSX

Welcome Guest!

Returning User? Login here.

Want membership privileges? Register here.

2 Pages V  < 1 2  
Start a new topic Add Reply
> Applesmartbatterymanager, Time to fix it...
THe KiNG
post Jul 29 2011, 06:36 AM
Post #21
QUOTE (gsly @ Jul 29 2011, 05:23 AM) *
Now that I see how Slice's system works, it should be easy to write some Methods that would mimic the SMBus type commands and return the same data to the kext by using SMI/SMM.

The only down side is that this will likely be system specific sad.gif (I need to look at some more SMI/SMM examples)

Thoughts?

That can be implemented, and it can be "helped" with plist entrys for SMI/SMM stuff.
Slice
post Jul 29 2011, 11:58 AM
Post #22
Emulate SMBus methods by ACPI methods to write AppleSmartBattery instead of AppeAcpiBattery? For a what?

Dell has own specific technology to control all hardware by SMI
http://support.dell.com/support/edocs/stor...SMI/ref_smi.pdf
http://blip.tv/social-media-influence/smi-...ng-dell-3899985 biggrin.gif

And I found an opensource project I8kfan that can control FAN speed on Dell notebooks by SMM methods. While I have no one FakeSMC plugin to do it.
i3-2120 GA-H61M-S1 UEFI, Radeon HD6670-UEFI, ALC887(VoodooHDA 2.8.6), OS⌘10.9.5, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
THe KiNG
post Jul 29 2011, 03:27 PM
Post #23
QUOTE (Slice @ Jul 29 2011, 02:58 PM) *
Emulate SMBus methods by ACPI methods to write AppleSmartBattery instead of AppeAcpiBattery? For a what?

To have one single driver that can cover any PC scenarious, and apple expect to find on mobile platform...
You know already the problems with our old stuff and Lion.
Slice
post Jul 29 2011, 08:08 PM
Post #24
I stil has no Lion and dunno what is a problem with old stuff, but I have an idea. May be Lion wants to see Battery device not on ACPI but on EC device as AppleSmartBattery? This can be easy corrected by info.plist.
i3-2120 GA-H61M-S1 UEFI, Radeon HD6670-UEFI, ALC887(VoodooHDA 2.8.6), OS⌘10.9.5, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
gsly
post Jul 30 2011, 08:26 PM
Post #25
QUOTE (Slice @ Jul 29 2011, 01:08 PM) *
I stil has no Lion and dunno what is a problem with old stuff, but I have an idea. May be Lion wants to see Battery device not on ACPI but on EC device as AppleSmartBattery? This can be easy corrected by info.plist.

I was able to get Lion GM installed to a second partition the other day but I still have to do some tweaking and install Xcode, but I do plan on seeing what Apple broke in the ACPI driver before I switch over to getting EC/SMBus working.

Hack 1: HP DV8 Laptop - OSX 10.9.3, OSX 10.7.5, Windows 8.1 Pro, Ubuntu 14.04 (GPT/EFI)
Hack 2: Asus UX32VD Laptop - OSX 10.8.3, Windows 8, Ubuntu 13.10 (GPT/EFI)
Hack 3: Gigabyte GA-Z68XP-UD5 Desktop - OSX 10.7.2, Windows 7 Ultimate
Hack 4: Acer X3990 Desktop - Work In Progress, Windows 7 Ultimate
THe KiNG
post Jul 31 2011, 08:31 AM
Post #26
QUOTE (Slice @ Jul 29 2011, 11:08 PM) *
I stil has no Lion and dunno what is a problem with old stuff, but I have an idea. May be Lion wants to see Battery device not on ACPI but on EC device as AppleSmartBattery? This can be easy corrected by info.plist.

I have only DP1 installed since atom 32 bit CPU.
ACPIBatteryManager loads just fine, it is registered under BAT0 device but does nothing, no battery info in system profiler and an X on menu bar.
Anyway I could stay with old driver since I may never see GM Lion working on this crap Atom, but i'm not thinking like that, ACPIBatteryManager is old and have bugs, like laptop never goes to hibernate when battery is in critical low power and it lacks full battery info.
I know it can be improved, but I want the real deal, not using simple hacks, like I saw people using acpi/iopci from 10.6.7 on 10.6.8 or Lion, that can work until next update when Apple will "take care" of that...

QUOTE (gsly @ Jul 30 2011, 11:26 PM) *
I was able to get Lion GM installed to a second partition the other day but I still have to do some tweaking and install Xcode, but I do plan on seeing what Apple broke in the ACPI driver before I switch over to getting EC/SMBus working.

I included your files into the project, now only 70 errors left smile.gif
Too bad I'm n00b when it comes to coding, need help tongue.gif
gsly
post Aug 4 2011, 02:12 PM
Post #27
I updated the ACPI battery driver for 3.x/4.x and non-standard support at:

http://www.insanelymac.com/forum/index.php?showtopic=264597

King, you should be able to make your own _BST, _BIF or _BIX (or BBIX for non-standard things like temperature) and use this driver. Methods just have to return structure according to the ACPI standard (except my BBIX method of course)
Hack 1: HP DV8 Laptop - OSX 10.9.3, OSX 10.7.5, Windows 8.1 Pro, Ubuntu 14.04 (GPT/EFI)
Hack 2: Asus UX32VD Laptop - OSX 10.8.3, Windows 8, Ubuntu 13.10 (GPT/EFI)
Hack 3: Gigabyte GA-Z68XP-UD5 Desktop - OSX 10.7.2, Windows 7 Ultimate
Hack 4: Acer X3990 Desktop - Work In Progress, Windows 7 Ultimate
THe KiNG
post Aug 27 2011, 01:37 AM
Post #28
QUOTE (gsly @ Aug 4 2011, 05:12 PM) *
I updated the ACPI battery driver for 3.x/4.x and non-standard support at:

http://www.insanelymac.com/forum/index.php?showtopic=264597

King, you should be able to make your own _BST, _BIF or _BIX (or BBIX for non-standard things like temperature) and use this driver. Methods just have to return structure according to the ACPI standard (except my BBIX method of course)

I deleted my previous post since I was wrong, the effect is the same since we do replace the original driver anyway.
Very good job, congrats! smile.gif

Now I am curious what Windows OS will panic on _BIX method LOL
I will test starting with XP, curious if linux will use the extra info.

I have some ideas how to bypass Lion ACPI EC SMBus stuff, we might need to implement a fake SMB0 device and put there the SMRD method as Apple does with the hope it will not block it...
AFAIK I can test only on Lion DP1, dunno how diff is ACPIPlatform b/w DP1 and GM.

L.E. Tested and is not/will not work ever on Lion.
I even tested latest apple code from mbair and it prints same errors when debug=0xffff, so the code is still there for other OS but not Lion.
Only thing they care is to find the SMB0 device with 0x0f status, rest is driver job...

It is a very good solution for Snow but that's it, as far I can see Apple will not allow anything on SMBus within ACPI, or they rushed things, or the plan was to break it.

So, lets get back to the topic tongue.gif
robi
post Aug 30 2011, 09:49 AM
Post #29
In my case appleacpibatterymanager is better

which I downloaded from this forum

smartbattery manager does not give me info about battery shows time on battery menu but on percentage tell me 0%

the other one shows me everything ok except in system info I get the error There was an error while gathering this information.

But In ioreg it shows all details about battery

Attached File  battery.jpeg ( 145.86K ) Number of downloads: 56
THe KiNG
post Aug 30 2011, 11:36 AM
Post #30
The extended AppleACPIBatteryManager(the driver classes and kext have been renamed to the same as Apple's Smart Battery Manager and therefore allows some 3rd party application such as iStat Menus and coconutBattery to work.) require you to fix own DSDT for it, I guess you didn't tried the debug version to see what is wrong and correct in DSDT.

gsly provided an example how to do it, look on it and read the battery sections on ACPI specification and you will see what you did wrong.
robi
post Aug 30 2011, 11:47 AM
Post #31
I tried to fix my dsdt with both methods from bc9 and one from gsly both give me compile errors also some arguments like scope do not exist on my dsdt


my bat is called cmb1



this is kernel log of debug version

CODE
Aug 30 13:53:01 localhost kernel[0]: InitPool: offset= 0x08000000 size = 0x08000000
Aug 30 13:53:04 localhost kernel[0]: AppleSmartBattery::pollingTimeOut called
Aug 30 13:53:04 localhost kernel[0]: AppleSmartBattery::pollBatteryState: path = 0x2
Aug 30 13:53:04 localhost kernel[0]: AppleSmartBattery::pollBatteryState: path = 0x1
Aug 30 13:53:04 localhost kernel[0]: AppleSmartBatteryManager::getBatterySTA called
Aug 30 13:53:04 localhost kernel[0]: AppleSmartBattery::setBatterySTA: battery_status = 0x1f
Aug 30 13:53:04 localhost kernel[0]: AppleSmartBatteryManager::getBatteryBIX called
Aug 30 13:53:04 localhost kernel[0]: AppleSmartBatteryManager::getBatteryBBIX called
Aug 30 13:53:04 localhost kernel[0]: AppleSmartBatteryManager::getBatteryBST called
Aug 30 13:53:04 localhost kernel[0]: AppleSmartBattery::setBatteryBST: acpibat_bst size = 4
Aug 30 13:53:04 localhost kernel[0]: AppleSmartBattery::setBatteryBST: fPowerUnit = 0x0
Aug 30 13:53:04 localhost kernel[0]: AppleSmartBattery::setBatteryBST: currentStatus = 0x2
Aug 30 13:53:04 localhost kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentRate = 0x69e
Aug 30 13:53:04 localhost kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentCapacity = 0x11a8
Aug 30 13:53:04 localhost kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentVoltage = 0x2f2a
Aug 30 13:53:04 localhost kernel[0]: AppleSmartBattery::setBatteryBST: Calculating for WATTS
Aug 30 13:53:04 localhost kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentRate = 1694
Aug 30 13:53:04 localhost kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentCapacity = 0
Aug 30 13:53:04 localhost kernel[0]: AppleSmartBattery::setBatteryBST: fAverageRate = 0x69e
Aug 30 13:53:04 localhost kernel[0]: AppleSmartBattery: Battery is charging.
Aug 30 13:53:04 localhost kernel[0]: AppleSmartBattery::constructAppleSerialNumber called
Aug 30 13:53:04 localhost kernel[0]: AppleSmartBattery::rebuildLegacyIOBatteryInfo called
Aug 30 13:53:08 localhost kernel[0]: display: Not usable
Aug 30 13:53:22 localhost kernel[0]: HFS: Very Low Disk: freeblks: 0, dangerlimit: 13
Aug 30 13:53:34 localhost kernel[0]: AppleSmartBattery::pollingTimeOut called
Aug 30 13:53:34 localhost kernel[0]: AppleSmartBattery::pollBatteryState: path = 0x2
Aug 30 13:53:34 localhost kernel[0]: AppleSmartBattery::pollBatteryState: path = 0x1
Aug 30 13:53:34 localhost kernel[0]: AppleSmartBatteryManager::getBatterySTA called
Aug 30 13:53:34 localhost kernel[0]: AppleSmartBattery::setBatterySTA: battery_status = 0x1f
Aug 30 13:53:34 localhost kernel[0]: AppleSmartBatteryManager::getBatteryBIX called
Aug 30 13:53:34 localhost kernel[0]: AppleSmartBatteryManager::getBatteryBBIX called
Aug 30 13:53:34 localhost kernel[0]: AppleSmartBatteryManager::getBatteryBST called
Aug 30 13:53:34 localhost kernel[0]: AppleSmartBattery::setBatteryBST: acpibat_bst size = 4
Aug 30 13:53:34 localhost kernel[0]: AppleSmartBattery::setBatteryBST: fPowerUnit = 0x0
Aug 30 13:53:34 localhost kernel[0]: AppleSmartBattery::setBatteryBST: currentStatus = 0x2
Aug 30 13:53:34 localhost kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentRate = 0x689
Aug 30 13:53:34 localhost kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentCapacity = 0x11a8
Aug 30 13:53:34 localhost kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentVoltage = 0x2f34
Aug 30 13:53:34 localhost kernel[0]: AppleSmartBattery::setBatteryBST: Calculating for WATTS
Aug 30 13:53:34 localhost kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentRate = 1673
Aug 30 13:53:34 localhost kernel[0]: AppleSmartBattery::setBatteryBST: fCurrentCapacity = 0
Aug 30 13:53:34 localhost kernel[0]: AppleSmartBattery::setBatteryBST: fAverageRate = 0x693
Aug 30 13:53:34 localhost kernel[0]: AppleSmartBattery: Battery is charging.
Aug 30 13:53:34 localhost kernel[0]: AppleSmartBattery::constructAppleSerialNumber called
Aug 30 13:53:34 localhost kernel[0]: AppleSmartBattery::rebuildLegacyIOBatteryInfo called


This post has been edited by robi: Aug 31 2011, 08:28 AM
THe KiNG
post Aug 30 2011, 12:36 PM
Post #32
QUOTE (robi @ Aug 30 2011, 02:47 PM) *
I tried to fix my dsdt with both methods from bc9 and one from gsly both give me compile errors also some arguments like scope do not exist on my dsdt

I don't want to be rude, but I know this will come(posting your DSDT and ask for help), you didn't tried enough.
Or you wait for someone with same laptop to fix it or get involved and start reading the ACPI specifications.
Laptops ACPI is pure crap in general and fixing that is very time consuming, do not expect someone else to spend time and do your job.
Simple as that, at least you have good(working) example to compare and you don't have to start from zero, be thankful to gsly for that.
robi
post Aug 30 2011, 05:27 PM
Post #33
QUOTE (THe KiNG @ Aug 30 2011, 02:36 PM) *
I don't want to be rude, but I know this will come(posting your DSDT and ask for help), you didn't tried enough.
Or you wait for someone with same laptop to fix it or get involved and start reading the ACPI specifications.
Laptops ACPI is pure crap in general and fixing that is very time consuming, do not expect someone else to spend time and do your job.
Simple as that, at least you have good(working) example to compare and you don't have to start from zero, be thankful to gsly for that.


I know that it is time consuming since i installed Lion on my fujitsu which I started from 0 I managed to get brightness and sleep working that took me a week

I also managet to get a patched al262 hda working on my system the only thing I was referring to some of the scopes used by the 2 fixes are not present on my system I guess I have to do a lot of Goggleing and more sleepless nights wink.gif

I managed to display time remaining on battery by changing infoplist of kext in ioreg it shows info of battery but getting same error in system profiler

only thing with this kext show cycles of battery as 0 other one showed 30 is it purely cosmetic????

Good thing about this kext shows info with coconut battery and Istat menu rolleyes.gif

This post has been edited by robi: Aug 31 2011, 12:47 PM
gsly
post Aug 31 2011, 02:32 PM
Post #34
QUOTE (robi @ Aug 30 2011, 10:27 AM) *
only thing with this kext show cycles of battery as 0 other one showed 30 is it purely cosmetic????

Good thing about this kext shows info with coconut battery and Istat menu rolleyes.gif

If your system has a SmartBattery subsystem (SBS) then there is a standard API call to retrieve the number of cycles from the battery and that is what my driver does, so no its not cosmetic.

THe KiNG is correct about most DSDT code being crap. Once I learned and understood the code, I've seem lots of bad code in the stock DSDT, not only in my HP, but in other's I've looked at as well. If you post your DSDT/debug log in the driver thread over on Insanely Mac, hopefully I can find some time to have a look (no guarantees)
Hack 1: HP DV8 Laptop - OSX 10.9.3, OSX 10.7.5, Windows 8.1 Pro, Ubuntu 14.04 (GPT/EFI)
Hack 2: Asus UX32VD Laptop - OSX 10.8.3, Windows 8, Ubuntu 13.10 (GPT/EFI)
Hack 3: Gigabyte GA-Z68XP-UD5 Desktop - OSX 10.7.2, Windows 7 Ultimate
Hack 4: Acer X3990 Desktop - Work In Progress, Windows 7 Ultimate
robi
post Aug 31 2011, 09:05 PM
Post #35
Ok Ill do that
thanks

2 Pages V  < 1 2
Add Reply Start a new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members: