Coenraad Loubser
22 years ago
This post touches on two issues:
(1) Valid file mapping ranges for the various OS's
(2) Location of stack segment of loaded image file,
access rights, and other issues
Hi, I've been experimenting with file mapping over the last few weeks.
Quite convenient, not having to initialise your runtime data every time
you load.
Now there are certain issues. If you use hardlinked pointers in Windows
mapped images, it seems you are stuck with the OS you created the links in.
Because a range that is valid for Windows 98 is completely invalid for
Windows 2000
and still different on Windows XP.
Can anyone shed more specific light on this?
a) What ranges will windows allocate to your mapping object if you ask it to
b) What ranges are valid for predefined mapping offsets
c) ..slightly off the file mapping topic, maybe. Anyone know how to (under
win32)
create "alias" selectors in your running image? In other words, how can
you make
two regions point to the same data?
which brings us to (2):
I have a cool little routine that creates any app by just repeating a loop
which
pops its needed pointers and data off the stack. So I load my datafile right
onto the stack.
Problem is, I just cant seem to create a segment in my PE exe, that I can
either use as the
stack, or point to load directly onto the stack.
I assume that I can't move the stack to some arbitrary region of memory,
because the loading
thread for my program needs to have access to this region, which it doesnt
and I dont know
how to give it to it, or maybe this region is just not visible from some
other (I wish I knew
which!?) threads that for some reason shares the loaded app's stack.
(Questions e,f and maybe
g are in this paragraph somewhere!)
So, what I ask is:
Information about the stack in windows. (98, NT, XP, 2000, 2003, whatever,
all of them!)
Why, you ask? There are so many other ways to do it.
Well, Anyone ever experimented to see what is quicker, adding a section that
gets mapped to
your PE file, or loading some other file on initialisation of your app?
Popping values off the stack or reading consecutive data from another block?
Any numbers here would be a question h) and i)!
Thanks!
I'll post my little stack routine here when I get some answers. It's really
nice, can load a
a delphi-like application instantly, with all the details and data set up,
custom classes,
fonts, colours, all from just a simple datafile and tiny loader. I've coded
an IDE that's
smaller than 3KB. I like it... imagine how many more apps you'd be able to
fit into your 2Ghz
server's 2gb ram! Instead of being able to host a few hundred 4mb apps, it'd
be able to host
thousands, of say.. tiny custom database query-applications and such.
Coenraad
(1) Valid file mapping ranges for the various OS's
(2) Location of stack segment of loaded image file,
access rights, and other issues
Hi, I've been experimenting with file mapping over the last few weeks.
Quite convenient, not having to initialise your runtime data every time
you load.
Now there are certain issues. If you use hardlinked pointers in Windows
mapped images, it seems you are stuck with the OS you created the links in.
Because a range that is valid for Windows 98 is completely invalid for
Windows 2000
and still different on Windows XP.
Can anyone shed more specific light on this?
a) What ranges will windows allocate to your mapping object if you ask it to
b) What ranges are valid for predefined mapping offsets
c) ..slightly off the file mapping topic, maybe. Anyone know how to (under
win32)
create "alias" selectors in your running image? In other words, how can
you make
two regions point to the same data?
which brings us to (2):
I have a cool little routine that creates any app by just repeating a loop
which
pops its needed pointers and data off the stack. So I load my datafile right
onto the stack.
Problem is, I just cant seem to create a segment in my PE exe, that I can
either use as the
stack, or point to load directly onto the stack.
I assume that I can't move the stack to some arbitrary region of memory,
because the loading
thread for my program needs to have access to this region, which it doesnt
and I dont know
how to give it to it, or maybe this region is just not visible from some
other (I wish I knew
which!?) threads that for some reason shares the loaded app's stack.
(Questions e,f and maybe
g are in this paragraph somewhere!)
So, what I ask is:
Information about the stack in windows. (98, NT, XP, 2000, 2003, whatever,
all of them!)
Why, you ask? There are so many other ways to do it.
Well, Anyone ever experimented to see what is quicker, adding a section that
gets mapped to
your PE file, or loading some other file on initialisation of your app?
Popping values off the stack or reading consecutive data from another block?
Any numbers here would be a question h) and i)!
Thanks!
I'll post my little stack routine here when I get some answers. It's really
nice, can load a
a delphi-like application instantly, with all the details and data set up,
custom classes,
fonts, colours, all from just a simple datafile and tiny loader. I've coded
an IDE that's
smaller than 3KB. I like it... imagine how many more apps you'd be able to
fit into your 2Ghz
server's 2gb ram! Instead of being able to host a few hundred 4mb apps, it'd
be able to host
thousands, of say.. tiny custom database query-applications and such.
Coenraad