Re: getting real memory installed and hd size
Re: getting real memory installed and hd size
- Subject: Re: getting real memory installed and hd size
- From: Quinn <email@hidden>
- Date: Fri, 16 Sep 2005 13:37:11 +0100
At 18:49 -0700 15/9/05, Herbert wrote:
Is there a kernel way to get how much memory is really in the machine?
I believe that sysctlbyname with "hw.memsize" is the KPI way of doing this.
And how big the HD's are?
Yes, but my question for you is, why do want to do this from the
kernel? Is it possible to get this information from user space
instead?
Yes yes, I know that the Apple folks keep harping on about this
point, but that's because it's so important. There are a bunch of
reasons why we try to keep folks out of the kernel. We even wrote it
up in our formal documentation:
<http://developer.apple.com/documentation/Darwin/Conceptual/ShouldYou.html>
Looking over your recent posts to the list, it seems that you're
working on some sort of encrypting disk driver. If you'd like to
post details of the overall architecture, the Apple folks on the list
would be happy to comment on it. Once you get the overall
architecture right, solutions to this sort of problem just fall into
place.
As an example of how architecture affects the answer to this problem,
consider the case where you're writing an encrypting IOMedia filter
driver and you're interested in the size of the disk being filtered.
In that case, the answer is easy to find: just call
IOMedia::getSize() on your provider. OTOH, if you want to maintain a
list of disks attached to the computer and their sizes, you really
need to work in user space because the keeper of the volume list is
diskarbitrationd.
If your architecture details are confidential and you don't want to
discuss them on a public list, you could open a DTS tech support
incident instead.
<http://developer.apple.com/technicalsupport/index.html>
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications, Hardware
[DTS is hiring support engineers. Contact me for details.]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden