🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.ibm.pc.programmer
2 messages
2 total messages Started by Thomas Dwyer III Thu, 19 Jul 1990 00:58
memory control blocks?
#991
Author: Thomas Dwyer III
Date: Thu, 19 Jul 1990 00:58
10 lines
892 bytes
How does one "follow the chain of memory control blocks" to determine
what program is using what memory?  I would like to write my own program
which determines where all my memory is going.  If I use INT 21, AH=52
to get the first block, how do I get to the next block, etc?

Thanks,
Thomas Dwyer III                            TOMIII   @ MTUS5.BITNET
Network Programmer                          DWYERIII @ MTUS5.BITNET
Computing Technology Services
Michigan Technological University
Re: memory control blocks?
#995
Author: walt dixon
Date: Thu, 19 Jul 1990 20:45
35 lines
1979 bytes
In <90199.195855TOMIII@MTUS5.BITNET> Thomas Dwyer III asks:

>How does one "follow the chain of memory control blocks" to determine
>what program is using what memory?  I would like to write my own program
>which determines where all my memory is going.  If I use INT 21, AH=52
>to get the first block, how do I get to the next block, etc?

For DOS 3.x,  int 21h AH=52 returns a pointer to a list of DOS data structures
in es:bx.  es:[bx-2] contains the paragraph of the first memory control
block.  Each memory control block has the following structure:

Field		Size	Use
Signature	BYTE	A value of 'M' indicates a normal Memory control block
			A value of 'Z' indicates the last Memory control block
Owner		WORD	PSP of block owner
			0 if not allocated
Size		WORD	size in paragraphs of MCB (not including header)
Unused		BYTE[11]

To get from one MCB to the next add the size+1 to the paragraph of the
current header.  You must check the signature field to find the end of
the chain.  A value of zero in the owner field indicates a free block.
NB that there are some strange values for MCBs allocated to device drivers
(8, from memory) that don't correspond to a PSP but still indicate
the block is owned.

I hope this helps

Walt Dixon	{internet:	dixon@crd.ge.com	}
		{us mail:	ge crd			}
		{		po box 8		}
		{		schenectady, ny 12301	}
		{phone:		518-387-5798 (W)	}
		{		518-875-6203 (H)	}
Walt Dixon dixon@crd.ge.com
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads