Advertisement

Getting system info

Started by August 09, 2000 01:37 PM
2 comments, last by Sludge 24 years, 5 months ago
I would like to receive the following information: -Total system memory (RAM) in bytes (or Kbytes). -The CPU speed in Mhz. I know that you can get the CPU info using the CPUID instruction. But what should I put in EAX before calling the instruction, and in which register can I find the speed? I have no idea on how to get the information about the memory. Sludge Software www.sludgesoft.com Developing a secret of mana style role-playing-game
Sludge Softwarewww.sludgesoft.comDeveloping a secret of mana style role-playing-game
I don't believe you can get CPU speed or memory using CPUID. I looked at the "Intel Architecture Software Developers Manual", and under CPUID, there was nothing about processor speed.

Martee
Magnum Games


Edited by - Martee on August 9, 2000 2:43:45 PM
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers
Advertisement
Regarding the mem question, if you are under win32 try:

From MSDN:

VOID GlobalMemoryStatus(
LPMEMORYSTATUS lpBuffer // pointer to the memory status structure
);

typedef struct _MEMORYSTATUS { // mst
DWORD dwLength; // sizeof(MEMORYSTATUS)
DWORD dwMemoryLoad; // percent of memory in use
DWORD dwTotalPhys; // bytes of physical memory
DWORD dwAvailPhys; // free physical memory bytes
DWORD dwTotalPageFile; // bytes of paging file
DWORD dwAvailPageFile; // free bytes of paging file
DWORD dwTotalVirtual; // user bytes of address space
DWORD dwAvailVirtual; // free user bytes
} MEMORYSTATUS, *LPMEMORYSTATUS;

Remarks
You can use the GlobalMemoryStatus function to determine how much memory your application can allocate without severely impacting other applications.

The information returned by the GlobalMemoryStatus function is volatile. There is no guarantee that two sequential calls to this function will return the same information.

Header: Declared in winbase.h.
Import Library: Use kernel32.lib.
Ries
Martee: you''re right. After several tries with the registers I couldn''t get the right value.
Any other methods to retrieve the processor speed?

Claus hansen ries: Thanks, it worked.

Sludge Software
www.sludgesoft.com
Developing a secret of mana style role-playing-game
Sludge Softwarewww.sludgesoft.comDeveloping a secret of mana style role-playing-game

This topic is closed to new replies.

Advertisement