Printing a process's memory addresses

42 views
Skip to first unread message

Sara Rehmat

unread,
Feb 21, 2015, 5:44:00 AM2/21/15
to min...@googlegroups.com
Hi all,

I have Minix 3.1.4 installed. I want to print the physical addresses of a process to show how a combined I & D process and a separate I & D process differ. I have implemented a system call in pm server that can access the process table fields like its name and other attributes but since the memory information has been shifted to vm server in this release I am unable to write code that access the memory related information. There are some functions in /usr/src/servers/vm/region.c that print addresses but how to access this function from my sytem call. ]

Thanks a lot in advance.


Antoine LECA

unread,
Feb 24, 2015, 4:43:07 AM2/24/15
to min...@googlegroups.com
On 2015-02-21 10:43Z, Sara Rehmat wrote:
> I have Minix 3.1.4 installed.

May I ask why you are using that specific *un-released* build of MINIX?
First, the obvious but I should write it: did you look into IS, and did
you make sure it does not provide you the information you are after?
(It was a lot of time and I did not use 3.1.4 a lot, but I know a lot of
things were buggy and I won't be surprised IS would be broken.)

Second, there is a pitfall, much of it because MINIX came from a long
practice of using a non-paged virtual memory system: in the VM system of
3.1.4, there are three kind of memory addresses:
- virtual addresses (split by space T, D or S), as seen by the process
- "logical" addresses, as managed by VM, spanning a single 32-bit space
- "paged-in" addresses, as seen by the memory banks after translation
As you probably know, the two translations are done by the i386
hardware, the first (from virtual to "logical") which is done by the
segmentation unit (and present since the beginning of MINIX-86), and the
second (from "logical" to "paginated") which is done by the pagination
unit of the i386 and is driven by VM.
The pitfall is, "physical" addresses in MINIX 3.1.4 (to .7 at least)
refer alternatively to either the second or the third...
Also, if you read about the i386 architecture, you'll see used 'linear'
to the second kind ("logical" in my description), while 'physical'
refers only to the third category ("paged-in" above.)

Then, to your problem, I am asking myself a question: are you really
after the later, the really physical addresses, that is, "paged-in"?
Because it seems strange: the purpose of pagination is to unlink the
requirement for a single linear block of addresses large enough to hold
all the possible virtual addresses for a segment, and it does it
splitting that segment into a (potentially large) number of pages?

So I assume this is not what you are after; then, as far as I remember,
what you are after are the "logical" or 'linear' addresses, those which
are produced after segmentation is resolved; and this did not change
much when VM was added, and it is controlled mostly by kernel and the
system task. And you can refer to the 3rd Ed. book, it has a much better
description of this process than I am able to write :-)


Antoine
Reply all
Reply to author
Forward
0 new messages