Public feed
#723667
the general idea is:
the windows ce memory map (wm5/wm6 for now) is such that the xip and
imgfs module dlls (exe is very different), will load somewhere
between 0x0 and 0x3fffffff and they will not load anywhere else other
than what their base addresses specify. this is from the times when
devices had execute in place rom chips. (not so any more.)
now, the still so called xip slot (in ce4, and now imgfs modules too)
is 0x02000000-0x3fffffff, this is read only. whatever module doesnt
fit here can go below 0x02000000, but of course there has to be some
space left for the current process (which is running from 0x0).
below the start address of imgfs there is the current process and all
of its loaded dlls, heap, whatnot. the memory available for it is less
than 32mb because imgfs (and xip) goes below 02000000 too.
because the modules wont load anywhere else than their hard coded
addresses, an overlap will be a problem.
more important stuff: writable sections (0xC0000040 flag, data
sections usually) must go below 02000000.
then, it is important that xip and imgfs modules share the same memory
space. so you need to examine the map for both to see if everything is
right.
it can be automated by having an app look in every dll's (and cpl)
imageinfo, and the base addresses for ALL sections of the modules
(not just e32_vbase) then building a map from that and see if
everything is right, if not, then it could rearrange the modules to
fix the overlaps by rebasing the problematic dlls.
also, there is this .ROM and .VM which specify where imgfs memory
space starts and ends, also where the writable part ends (somewhere
near below 02000000), while xip has the dllfirst and dlllast for
writable parts. xip has to be between dllfirst and dlllast addresses
and over the highest address in imgfs.
the imgfs .ROM/.VM also tell where the part starts that only has those
writable sections of imgfs modules that are otherwise over 02000000.
that is important, when rebasing, if a module e32 vbase is over
02000000, then the writable section(s) will be separate. but if the
module is below 02000000, then it can stay as one (no separate
sections).
don't know how much of this was new to you, did it make anything
clearer?