Add routine to retrieve installed memory size
All checks were successful
Builds / ExectOS (i686, debug) (push) Successful in 30s
Builds / ExectOS (amd64, debug) (push) Successful in 32s
Builds / ExectOS (amd64, release) (push) Successful in 45s
Builds / ExectOS (i686, release) (push) Successful in 43s

This commit is contained in:
2026-01-15 19:09:10 +01:00
parent c3607ea943
commit 46c24e653e
2 changed files with 16 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ namespace MM
STATIC PFN_NUMBER NumberOfSystemPtes;
public:
STATIC XTAPI ULONG_PTR GetInstalledMemorySize(VOID);
STATIC XTAPI PMMMEMORY_LAYOUT GetMemoryLayout(VOID);
STATIC XTAPI PFN_NUMBER GetNumberOfSystemPtes();
STATIC XTAPI VOID InitializeMemoryLayout(VOID);

View File

@@ -10,6 +10,21 @@
#include <xtos.hh>
/**
* Retrieves the amount of total available memory in the system.
*
* @return This routine returns the amount of available memory in the system in megabytes.
*
* @since XT 1.0
*/
XTAPI
ULONG_PTR
MM::Manager::GetInstalledMemorySize(VOID)
{
/* Return the amount of installed memory */
return (MM::Pfn::GetNumberOfPhysicalPages() * MM_PAGE_SIZE) / 1048576;
}
/**
* Retrieves a pointer to the system's virtual memory layout structure.
*