Re: How can I determine ram in C ?

From: Walter Roberson (roberson_at_ibd.nrc-cnrc.gc.ca)
Date: 08/29/03

  • Next message: Josh Birnbaum: "Re: Irix 6.2 networking problems"
    Date: 29 Aug 2003 02:44:44 GMT
    
    

    In article <3F4EADAC.FE64635F@ntlworld.com>,
    Dr. David Kirkby <drkirkby@ntlworld.com> wrote:
    :I know the hinv command gives a lot of information about a machine,
    :but is there a way to get the same information in C ?

    Yes.

    :I can get the
    :number of CPUs online using sysconf, but I can't find a way to get the
    :ram.

    getinvent() and go through the returned table looking for inv_class == 3:
    those represent memory of various kind. Look then at inv_type
    for the kind of memory: main memory is type 9. The inv_state for that
    entry is the size of main memory in megabytes.

    :Other information, such as CPU, FPU, cache sizes would be useful
    :too.

    Within inv_class 3, use this table:

      inv_type # type inv_state is in hinv prints as

       3 DCACHE bytes Kb
       4 ICACHE bytes Kb
       6 SDCACHE bytes bytes
       7 SICACHE bytes bytes
       8 SIDCACHE bytes Mb

    I wrote some table-driven code in the IRIX 6.2 timeframe to decode
    inventories; it was an extension to some MO (magento-optical) handling
    tools that I wrote that had to be able to search the inventory to
    figure out where the drives were and then runs SCSI senses on
    them to figure out what kinds of drives they were. If you write me
    in your medphys University incarnation, I can make the source available
    to you for research purposes.

    -- 
       Perposterous!! Where would all the calculators go?!
    

  • Next message: Josh Birnbaum: "Re: Irix 6.2 networking problems"

    Relevant Pages

    • Re: Laptop and an expansion box questions??????
      ... memory directly to the processor, ... I can't predict how Intel will do things. ... There are currently hard drives with SATA III interfaces, ... Analog audio you already understand. ...
      (alt.comp.hardware.pc-homebuilt)
    • Re: Advice Please Re: Hard Drive Speeds Relative to Partition Size
      ... I suppose you might need quite a lot of memory to buffer _all_ 6 ... same ideal for also giving the pagefile exclusive use of a drive of its ... both drives may be the interface: ... virtual memory in the system to avoid real memory being frittered away ...
      (uk.comp.homebuilt)
    • Re: Laptop and an expansion box questions??????
      ... memory directly to the processor, ... There are currently hard drives with SATA III interfaces, ... Three plugs carry 5.1 for say, your movie theater speaker ... It carries audio in digital format. ...
      (alt.comp.hardware.pc-homebuilt)
    • Re: Win XP Pro & Disk Thrashing
      ... No Third Party memory management is in use. ... the file in Windows Explorer and select Send to, ... Drives are fully Defragged. ... I had the swap file set so that Windows ...
      (microsoft.public.windowsxp.perform_maintain)
    • Re: disppearing disk drives, faultly programs and slow performance
      ... under processes as using 0 memory and would not show up under the ... Also, almost immediately, Internet Explorer stopped working, the link ... The computer virtually stopped when I tried to update itunes from ... my Cd-rom/DVD-rom drives disappeared. ...
      (microsoft.public.windowsxp.general)