Jump to content

iStatPro working with VoodooBattery and Mountain Lion Fix

iStatPro

  • Please log in to reply
16 replies to this topic

#1
Marchrius

Marchrius

    Lo scippatore di emozioni

  • Pandora Team
  • 319 posts
  • Gender:Male
  • Location:Ferrara, Italia
  • Interests:Studente di Informatica.
    Passione/Hobby: Informatica in generale, hackintosh, musica Rock...

Hi guys!

 

I've adapted the last version of iStatPro (widget) to work with VoodooBattery too

I've tested it on Mountain Lion 10.8.4 with VoodooBattery v1.3.3
 
I've applied also the fix for Mountain Lion process list.
 
I post it with both source and binaries.
 
Extract the zip and open the widget. Please tell me, in a post, if the widget works. :) Thanks!
 
Source: Attached File  iStatPro_Source.zip   190.48KB   58 downloads

 

Binaries: Download

 

This widget is abandoned by the original developer (iSlayer  :guitar: ) but it's released under GPL license.
 
License:

Spoiler


#2
beta992

beta992

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 338 posts
  • Gender:Male

Hi Marchrius,

 

 

Could you please add a screenshot? :)

 

I also have an question about iStat. I'm seeing that their is a newer version (v4), but this isn't from iSlayer. What are the differences?

 

Thanks. :)



#3
Marchrius

Marchrius

    Lo scippatore di emozioni

  • Pandora Team
  • 319 posts
  • Gender:Male
  • Location:Ferrara, Italia
  • Interests:Studente di Informatica.
    Passione/Hobby: Informatica in generale, hackintosh, musica Rock...

Hi Marchrius,

 

 

Could you please add a screenshot? :)

 

I also have an question about iStat. I'm seeing that their is a newer version (v4), but this isn't from iSlayer. What are the differences?

 

Thanks. :)

Hi beta992,

this version is downloaded from macupdate and it's a iSlayer (I suppose from the donation button) creation.

 

This is the screenshots..

Attached File  Schermata 2013-06-30 alle 02.21.11.png   51.52KB   10 downloadsAttached File  Schermata 2013-06-30 alle 02.21.23.png   59.17KB   8 downloads

 

The difference is the VoodooBattery support and the fix for processes list in mountain lion...



#4
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 2,976 posts
  • Gender:Male
  • Location:Moscow

Great!
I have another Hackintosh version adopted to AppleAcpiBatteryManager. It was before ML. What you mean "ML processes list"?
There is also a question about HWSensors compatibility. Did you check with v3 or v5?

 

See source file smc.c line 339

Why

    totalKeys = SMCReadIndexCount();
	totalKeys = 500;

Because SMCReadIndexCount() returns wrong value? 

Yes, the procedure 

UInt32 _strtoul(char *str, int size, int base)
{
    UInt32 total = 0;
    int i;

    for (i = 0; i < size; i++)
    {
        if (base == 16)
            total += str[i] << (size - 1 - i) * 8;
        else
           total += (unsigned char) (str[i] << (size - 1 - i) * 8);
    }
    return total;
}

is wrong because str[i] can be negative value.

 

My variant

UInt32 SMCReadIndexCount(void)
{
    SMCVal_t val;
	int num = 0;

    SMCReadKey("#KEY", &val);
//	num = _strtoul(val.bytes, val.dataSize, 10);
	num = ((int)val.bytes[2] << 8) + ((unsigned)val.bytes[3] & 0xff);
	printf("Num: b0=%x b1=%x b2=%x b3=%x size=%d\n",
		   val.bytes[0], val.bytes[1], val.bytes[2], val.bytes[3], val.dataSize);
//    return _strtoul(val.bytes, 4 /*val.dataSize*/, 10);
	return num;
}

 

Best regards


#5
Marchrius

Marchrius

    Lo scippatore di emozioni

  • Pandora Team
  • 319 posts
  • Gender:Male
  • Location:Ferrara, Italia
  • Interests:Studente di Informatica.
    Passione/Hobby: Informatica in generale, hackintosh, musica Rock...

Great!
I have another Hackintosh version adopted to AppleAcpiBatteryManager.

Can you post the code here? I would implement it...

It was before ML. What you mean "ML processes list"?

This fix
http://forums.macrum...89&postcount=20

There is also a question about HWSensors compatibility. Did you check with v3 or v5? See source file smc.c line 339Why

totalKeys = SMCReadIndexCount();	totalKeys = 500;
Because SMCReadIndexCount() returns wrong value? Yes, the procedure 
UInt32 _strtoul(char *str, int size, int base){    UInt32 total = 0;    int i;    for (i = 0; i < size; i++)    {        if (base == 16)            total += str[i] << (size - 1 - i) * 8;        else           total += (unsigned char) (str[i] << (size - 1 - i) * 8);    }    return total;}
is wrong because str[i] can be negative value. My variant
UInt32 SMCReadIndexCount(void){    SMCVal_t val;	int num = 0;    SMCReadKey("#KEY", &val);//	num = _strtoul(val.bytes, val.dataSize, 10);	num = ((int)val.bytes[2] << 8) + ((unsigned)val.bytes[3] & 0xff);	printf("Num: b0=%x b1=%x b2=%x b3=%x size=%d\n",		   val.bytes[0], val.bytes[1], val.bytes[2], val.bytes[3], val.dataSize);//    return _strtoul(val.bytes, 4 /*val.dataSize*/, 10);	return num;}
 Best regards

No, I have not checked the smc compatibility. I haven't error for the smc values, is same as HWMonitor. Is there only that error?

#6
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 2,976 posts
  • Gender:Male
  • Location:Moscow

Can you post the code here? I would implement it...

It was original codes with replaced "AppleSmartBattery" -> "AppleACPIBatteryDevice". That's all.

This fix
http://forums.macrum...89&postcount=20

Strange fix. My iStatPro worked in 10.8.4 and I see no lacks.

No, I have not checked the smc compatibility. I haven't error for the smc values, is same as HWMonitor. Is there only that error?

I think there is only this error. It leads to spam in kernel.log until all 500 keys will be checked.
It will be better to correct strtoul procedure as follow

UInt32 _strtoul(char *str, int size, int base)
{
    UInt32 total = 0;
    int i;

    for (i = 0; i < size; i++)
    {
        if (base == 16)
            total += str[i] << (size - 1 - i) * 8;
        else
         /*  total += (unsigned char) (str[i] << (size - 1 - i) * 8); */
          total += (((UInt32)str[i] & 0xFF) << (size - 1 - i) * 8);
    }
    return total;
}

Checking needed. The mistake may be compiler dependent.


This is what I have now

Attached File  Снимок экрана 2013-07-01 в 14.07.30.png   66.4KB   10 downloads

MacBook:Clover slice$ sudo kextstat | grep atter
Password:
   37    0 0x34662000 0x5000     0x4000     com.apple.driver.AppleACPIBatteryManager (1.1) <13 5 4 3 1>
MacBook:Clover slice$ 

It is old  and doesn't contain ML fixes.

Attached File  iStatPro.tar.lzma.zip   2.08MB   16 downloads



#7
Marchrius

Marchrius

    Lo scippatore di emozioni

  • Pandora Team
  • 319 posts
  • Gender:Male
  • Location:Ferrara, Italia
  • Interests:Studente di Informatica.
    Passione/Hobby: Informatica in generale, hackintosh, musica Rock...

It was original codes with replaced "AppleSmartBattery" -> "AppleACPIBatteryDevice". That's all.

Ok, I've added support for AppleACPIBatteryDevice. Is this kext only for Hackintosh or it's present in original Mac? The plugin check for the SmartBattery, then for the AppleACPIBatteryDevice and if the Mac is an hack it looks also for VoodooBattery...

Strange fix. My iStatPro worked in 10.8.4 and I see no lacks.

If you add the "Processes" view in the widget it shows you the processes correctly?

I think there is only this error. It leads to spam in kernel.log until all 500 keys will be checked.
It will be better to correct strtoul procedure as follow

UInt32 _strtoul(char *str, int size, int base)
{
    UInt32 total = 0;
    int i;

    for (i = 0; i < size; i++)
    {
        if (base == 16)
            total += str[i] << (size - 1 - i) * 8;
        else
         /*  total += (unsigned char) (str[i] << (size - 1 - i) * 8); */
          total += (((UInt32)str[i] & 0xFF) << (size - 1 - i) * 8);
    }
    return total;
}

Checking needed. The mistake may be compiler dependent.

Added the fix, the value is the same. I leave it there. If I have problem I return to original one.

This is what I have now
attachicon.gifСнимок экрана 2013-07-01 в 14.07.30.png

MacBook:Clover slice$ sudo kextstat | grep atter
Password:
   37    0 0x34662000 0x5000     0x4000     com.apple.driver.AppleACPIBatteryManager (1.1) <13 5 4 3 1>
MacBook:Clover slice$ 

It is old  and doesn't contain ML fixes.
attachicon.gifiStatPro.tar.lzma.zip

Seems to work very well...
Thanks Slice for the code, opinions, trick and help! :)

#8
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 2,976 posts
  • Gender:Male
  • Location:Moscow

About processes... what I should to see here?

Attached File  Снимок экрана 2013-07-07 в 8.08.18.png   77.65KB   3 downloads

 

And yes, it is Hackintosh but original sources from real Mac with a very few changes as stated above.

 

Did you forget to exclude totalKeys = 500; ?



#9
lenn4rd

lenn4rd

    InsanelyMac Protégé

  • Members
  • Pip
  • 7 posts
  • Gender:Male
  • Location:Germany

Thanks for your work! I tried at least two other ports in the past but only yours correctly shows the network traffic.

 

There is a fix to show the external IP address as well. In scripts/core.js change line 244 to this:

ipURL = 'http://ifconfig.me/ip';

The Network section now looks like this:

 

Attached File  iStat Pro Widget.png   66.41KB   10 downloads



#10
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 2,976 posts
  • Gender:Male
  • Location:Moscow

Thanks for your work! I tried at least two other ports in the past but only yours correctly shows the network traffic.

 

There is a fix to show the external IP address as well. In scripts/core.js change line 244 to this:

ipURL = 'http://ifconfig.me/ip';

The Network section now looks like this:

 

attachicon.gifiStat Pro Widget.png

Thanks, it works!



#11
ddrum2000

ddrum2000

    InsanelyMac Protégé

  • Members
  • Pip
  • 4 posts

I downloaded your fixed istatpro and the network meter seems to work fine but the processes and the battery do not seem to be working correctly.  Originally I had modified istatpro to enable the prcesses and the external IP funcion but the netwrm meter did work correctly.  Granted I'm not using OSx86.  I'm happy to make changes to my original widget to enable the network meter to work.  Could you document those for the netwrok meter?  FYI, I'm using a 2013 Macbook Air with 10.8.5.  Thanks.

Attached Files



#12
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 2,976 posts
  • Gender:Male
  • Location:Moscow

This is latest sources and binaries according all discussions above.

 

Sorry, but the forum again is not accepted uploads.



#13
ddrum2000

ddrum2000

    InsanelyMac Protégé

  • Members
  • Pip
  • 4 posts

This is latest sources and binaries according all discussions above.

 

Sorry, but the forum again is not accepted uploads.

Sorry but I don't think I understand your comment.  I don't mind building from source if necessary but is this source modified from the original for OSx86 such that it does not work correctly on stock 10.8.5.  Can any comment on this?



#14
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 2,976 posts
  • Gender:Male
  • Location:Moscow

Sorry but I don't think I understand your comment.  I don't mind building from source if necessary but is this source modified from the original for OSx86 such that it does not work correctly on stock 10.8.5.  Can any comment on this?

These sources works in 10.8.5. Binary also included.

Attached File  iStatPro-mod.tar.lzma.zip   1004.85KB   25 downloads



#15
ddrum2000

ddrum2000

    InsanelyMac Protégé

  • Members
  • Pip
  • 4 posts

These sources works in 10.8.5. Binary also included.

attachicon.gifiStatPro-mod.tar.lzma.zip

that worked great.  Thanks.



#16
ddrum2000

ddrum2000

    InsanelyMac Protégé

  • Members
  • Pip
  • 4 posts

These sources works in 10.8.5. Binary also included.

attachicon.gifiStatPro-mod.tar.lzma.zip

So I've noticed after some use that Processes and Network work correctly but the battery health, cycles, and charge do not work correctly.  I there another change I need to make.  I'm on a 2013 MBA with 10.8.5.  Thanks.



#17
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 2,976 posts
  • Gender:Male
  • Location:Moscow

Battery get information from DSDT. It is black hole where you should search you problem.







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy