Re: Memory maps

Eric W. Biederman (ebiederm@xmission.com)
03 Apr 2001 06:57:22 -0600


Fu-hau Hsu <fhsu@ic.sunysb.edu> writes:

> Dear freinds:
>
> I have following questions about memory maps. I appreciate any
> suggestion.
>
> Q. (1)When a process is running, how can I get the range of data, stack,
> and code segments, say the stack segment is from address 0x..... to
> 0x..... so do data segments and code segments?
> PS: Under ELF format, there are several seperaed code and data
> segments, but the process control table has only one pair of
> pointers for each, Are the pointers still useful?

Sort of, you can currently confuse the elf loader with multiple bss segments.
The stack, and the brk pointer are still used.

> (2) /proc/*/maps will show us those info, but how does it get these
> info?

This is a reflection of what areas of memory the kernel sees. In principle
every thing is now handled by mmap, and this /proc/maps is a reflection
of that. See under the files in mm/*.c

Eric
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/