Subject: A possible problem with a dos emulator...need help
To: netbsd-ports <>
From: Brett Lymn <>
List: netbsd-ports
Date: 03/18/1994 19:26:07
        When I get the time I am hacking away at a dos emulator.  It
has come time to seriously think about implementation issues for the
emulator itself.  One thing that has me worried at the moment (not the
only thing...;-) is the fact that the DOS land is going to occupy the
bottom 1Meg of the emulator address space.  I can see some problems
with this:

1) The unix exit code of the process will be overwritten by the DOS

2) I think the first couple of pages of the process are protected so
that dereferencing a null pointer will produce a SIGSEGV.

My current thinking is that I can spelunk the crt0.c to make a special
one for the emulator so that the exit code is shifted to above the
1Meg+64K magic limit that DOS knows about.  Linux dosemu got around
the problem by using the shared libraries and linking their code to an
address about the Magic Barrier (tm) - if I used 'current could I do
the same trick?  I would prefer this to hacking crt0 because it is an
ugly hack (hey, IMHO running MS-DOS is pretty ugly :-).  If I can use
the shared libraries to fix the MB (tm) how can I do this?

As for point 2, I am not sure how I can get around this.  I must have
these pages r/w as DOS will insist on it.

Please tell me I am worrying about nothing ;-)  if not any

Brett Lymn, Computer Systems Administrator, AWA Defence Industries
"Where a calculator on the ENIAC is equipped with 18,000 vaccuum tubes
and weighs 30 tons, computers in the future may have only 1,000 vaccuum
tubes and perhaps weigh 1 1/2 tons."
                -- Popular Mechanics, March 1949