TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: JONATHAN DE BOYNE POLLARD
from: RICHARD HIRNER
date: 1998-03-26 19:06:00
subject: Loading EXEs into RAM

Hallo!
17 Mar 98  11:35:44: Jonathan de Boyne Pollard -> Richard Hirner, "Loading 
EXEs into RAM"
 RH> I am going to write a 16-bit protected mode program with Borland C++
 RH> *3.1*. All I need from you is to know how to load an EXE program into
 RH> the memory (protected mode!).
 JdBP> Let the operating system worry about that.  I wrote 16-bit OS/2 1.x
 JdBP> programs using Borland C++ 3.1 for DOS several years ago, and all of
 JdBP> the hassle of loading the EXE into memory was dealt with by the
 JdBP> operating system, and wasn't my concern.
 JdBP> If you are targetting a non-protected mode operating system, like DOS,
 JdBP> then let your DOS extender worry about loading the EXE.  It will stick
 JdBP> a stub program on the front of your executable (TLINK can generate NE
 JdBP> format executables, if memory serves) which will deal with loading
 JdBP> your program into memory and switching into protected mode. 
 JdBP> If you aren't using a DOS extender, then you have more worries than
 JdBP> can be dealt with in even a month of echomail messages.   
I don't use any kind of extender, I just want to make a DOS-program that's
task is to switch to 32-bit-protected-mode (I've done that already).
Then it should load another application into the memory and execute it by
a FAR jump. Descriptor allocation and so on is no problem.
So I need the information how I load a simple MZ-EXE-program into the
memory. (Without using the DOS "EXECUTE" function!) That's all!
There's especionally one problem:
How can I find out at which EXE-offset does a new segment begin?
Richard  
--- Blue Wave v2.05 [NR]
---------------
* Origin: Constants aren't (2:310/3)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.