22.02.2014 Views

with DOS/4GW? - Open Watcom

with DOS/4GW? - Open Watcom

with DOS/4GW? - Open Watcom

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>DOS</strong> Programming Guide<br />

}<br />

int386x( DPMI INT, &regs, &regs, &sregs );<br />

printf( "Largest available block (in bytes): %lu\n",<br />

MemInfo.LargestBlockAvail );<br />

printf( "Maximum unlocked page allocation: %lu\n",<br />

MemInfo.MaxUnlockedPage );<br />

printf( "Pages that can be allocated and locked: "<br />

"%lu\n", MemInfo.LargestLockablePage );<br />

printf( "Total linear address space including "<br />

"allocated pages: %lu\n",<br />

MemInfo.LinAddrSpace );<br />

printf( "Number of free pages available: %lu\n",<br />

MemInfo.NumFreePagesAvail );<br />

printf( "Number of physical pages not in use: %lu\n",<br />

MemInfo.NumPhysicalPagesFree );<br />

printf( "Total physical pages managed by host: %lu\n",<br />

MemInfo.TotalPhysicalPages );<br />

printf( "Free linear address space (pages): %lu\n",<br />

MemInfo.FreeLinAddrSpace );<br />

printf( "Size of paging/file partition (pages): %lu\n",<br />

MemInfo.SizeOfPageFile );<br />

Please refer to the chapter entitled "Interrupt 31H DPMI Functions" on page 67 for more<br />

information on DPMI services.<br />

5.3.2 Getting Free Memory Information under the Phar Lap<br />

386|<strong>DOS</strong>-Extender<br />

Phar Lap provides memory statistics through 386|<strong>DOS</strong>-Extender System Call 0x2520. The<br />

following example illustrates how to use this system call from a 32-bit program.<br />

/*<br />

MEMPLS40.C - This is an example of how to get the<br />

amount of physical memory present under Phar Lap<br />

386|<strong>DOS</strong>-Extender v4.0.<br />

Compile & Link: wcl386 /l=pharlap MEMPLS40<br />

*/<br />

#include <br />

#include <br />

typedef struct {<br />

unsigned data[25];<br />

} pharlap mem status;<br />

24 How do I get information about free memory in the 32-bit environment?

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!