Re: RAM Location and Size in 64bits Machines
Re: RAM Location and Size in 64bits Machines
- Subject: Re: RAM Location and Size in 64bits Machines
- From: Fabio <email@hidden>
- Date: Mon, 23 May 2005 19:02:42 +0200
Hi !
Thank you!
But the bank-size property is not always present, I think it depends
on the system version and the machine type.
And sometimes the "bank-size" property is present but it is empty, I
think we cannot rely on it.
And unfortunately your script won't work on dual-cpu machines for the
reasons I mentioned before.
When it is present, the only difference between the "bank-size" and
the "reg" property is that "reg" is 4 bytes, and bank-sizes is 8 bytes.
At the present time, I look for the "bank-size" property and if it is
empty or not present I use the "Reg" property...
Here's a perl script I wrote to find RAM sizes in each bank. It
calls ioreg and parses the bank-sizes line.
Good luck,
Geoff Zelenka
#!/usr/bin/perl
my $line = `ioreg -p IODeviceTree -n memory -w -S | grep bank-sizes`;
$line =~ /<([0-9a-fA-F]+)>/;
my $banks = $1;
my $sum = 0;
my @bank = ();
for($i=0;$i<8;$i++)
{
$bank[i] = ((hex substr($banks,($i*8),8)) / 1024) / 1024;
$sum += $bank[i];
if($i < 4)
{
print "J1" . $i . ": " . $bank[i] . " MB ";
}
else
{
print "J4" . (($i % 4) + 1) . ": " . $bank[i] . " MB ";
}
}
print " Total: " . ($sum / 1024). " GB\n";
On May 23, 2005, at 10:38 AM, Fabio wrote:
Le 23 mai 05 à 16:02, Alastair Houghton a écrit :
On 23 May 2005, at 14:38, Creed Erickson wrote:
On May 23, 2005, at 3:25 AM, Alastair Houghton wrote:
On 14 May 2005, at 10:12, Fabio wrote:
I know it's very easy to get the RAM location and size on 32
bits machines:
http://developer.apple.com/qa/qa2001/qa1065.html
Now how about 64 bits machines? And dual processors 64 bits
machines?
I was able to built an app that works on most of the computers
but it seems that is doesn't always work and I must confess
that I have no idea how to fix that.
On dual-processors 64 bits machines, it seems that if you have
2x512MB the system will think that you have a single 1GB.
Please help, I don't want to parse System_profiler's result :(
Have you tried sysctl(3)? e.g.
[snip]
I believe the OP is looking to map the size and slot location of
memory SIMMs in the box, similar to the info reported by
system_profiler:
Yes, you're quite right, I should have read it more carefully.
That being the case, Fabio might be better asking on one of the
hardware lists, or even looking through the I/O registry himself
using IORegistryExplorer on a G5 to see what he can see.
Probably both, in fact.
Kind regards,
Alastair.
yes, this is my goal.
I have already explored the ioreg on several G5, and what I'm
doing is getting the RAM size on each slot and then see if there
are "slot pairs" and divide by 2 if necessary the RAM size.
I mean: on dual-G5 powermacs, one slot is physically bound to
another one. This mean that if I have 2x512MB, the ioreg will
report 1x1GB.
That's why I divide by 2. This works just fine on 99% of the
computers, now a user of my software (InforMac) reported me that
it doesn't work on his computer, and I cannot access his hardware
nor his ioreg to see what's wrong.
Thanks
Fabio
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40hotmail.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden