Reply 20 of 32, by BloodyCactus
- Rank
- Oldbie
wrote:and i wanna know how mem.exe and chkdsk.exe reports free conventional ram?
well this is just realmode memory. Calculating that is easy.
you can
1 - walk, the MCB chain, remove your current app and count up all free memory. east to do!
2 - do a alloc all in dos which will return largest free memory block. keep allocating blocks until you run out, add them all up.
then test for ems, if present, get the count of free pages, multiply by 16kb since a page is 16kb.
then test for xms, if present, get how much is free.
I wrote a utility to walk the MCB and manipulate memory on my tandy 1000 sx to add blocks in umb to the chain (in dos3.3 there is no umb).
This is part of it I cut down for you as an example, builds with watcom as real mode exe
--/\-[ Stu : Bloody Cactus :: [ https://bloodycactus.com :: http://kråketær.com ]-/\--