linux+dosemu with djgpp

linux+dosemu with djgpp

Post by Kristian H|gsberg Kristens » Sun, 28 Jul 1996 04:00:00



Hi,

I heard somebody mentioning that they were running
djgpp under linux+dosemu... How good is this working,
and what andvantages do you get (besides the obvious;
running linux instead of dos).

I'd like to hear more about this setup, and what pitfalls
there may be in setting it up (I tried dosemu v0.60.1
under linux and it didn't seem to stable).

regards,
Kristian Hogsberg

 
 
 

linux+dosemu with djgpp

Post by DJ Delori » Tue, 30 Jul 1996 04:00:00


Quote:> I heard somebody mentioning that they were running djgpp under
> linux+dosemu... How good is this working, and what andvantages do
> you get (besides the obvious; running linux instead of dos).

Works OK for me, but make sure you get the one with the DPMI patch for
djgpp, or get the patch from my web site.

Quote:> I'd like to hear more about this setup, and what pitfalls there may
> be in setting it up (I tried dosemu v0.60.1 under linux and it
> didn't seem to stable).

The worst bug I've found so far is that (at least in my setup) dos
pipes don't work.

 
 
 

linux+dosemu with djgpp

Post by Eli Zaretski » Tue, 30 Jul 1996 04:00:00



Quote:> I'd like to hear more about this setup, and what pitfalls
> there may be in setting it up (I tried dosemu v0.60.1
> under linux and it didn't seem to stable).

Be sure to read the DJGPP FAQ list (v2/faq201b.zip from the same place
you get DJGPP), section 3.4 (and also search for "dosemu").  It tells a
few things about setting up dosemu for DJGPP and points you to a patch
you will have to install.
 
 
 

linux+dosemu with djgpp

Post by Eli Zaretski » Tue, 30 Jul 1996 04:00:00



Quote:> I do it from time to time, and it WORKS! (mostly). Its kinda slow
> (my machine isn't very fast anyway), and GNU Make dies a horrible
> death under DOSEMU, at lest for me. I've posted here a couple of
> times about it but no one has replied.

Did you install the patch that DOSEMU needs to reliably run nested DJGPP
programs?  If not, the DJGPP FAQ list includes in section 3.5 a URL where
you can get that patch.
 
 
 

linux+dosemu with djgpp

Post by Eli Zaretski » Wed, 31 Jul 1996 04:00:00



Quote:> Here's what I get when I run make on a simple makefile:

>    Exiting due to signal SIGFPE
>    Coprocessor Error at eip=00007bb4
>    eax=00023198 ebx=00000000 ecx=0002bf50 edx=000231a0 esi=00005cc6 edi=0006bec9
>    ebp=0006b674 esp=0006b638 cs=0117 ds=011f es=011f fs=00ff gs=0137 ss=011f
>    Call frame traceback EIPs:
>      0x00007bb4
>      0x000068e6
>      0x00015963

Most probably an emulation problem.  If you need this desperately and
right now, the best way is to change Make so it doesn't use floating
point.  (I have this on my todo list for the future port of Make, but
don't hold your breath just yet.)  As far as I remember, the piece of
code that uses floating point computes something (load of the CPU?) that
is both irrelevant on MSDOS and can be done with integers, albeit with a
bit more code.  Just change that part and live happily ever after (or bye
a motherboard with an FPU).
 
 
 

linux+dosemu with djgpp

Post by Orlando Andic » Wed, 31 Jul 1996 04:00:00



<snip>

Quote:>    387=N
>    EMU387=c:\djgpp\bin\emu387.dxe

        ^^^^^^

Maybe this is it? does the machine have a coprocessor or not? I read
somewhere that the Linux developers consider FPU emulation to be a lost
cause, a dangerous land filled with demons, dragons, and bugs..

 
 
 

linux+dosemu with djgpp

Post by Eli Zaretski » Thu, 01 Aug 1996 04:00:00



Quote:> I'd expect that Linux's FP emulator would handle the lack of a co-processor
> even for DJGPP programs, but in fact neither gcc nor programs compiled
> with it will run without that in the environment. WITH it, everything but
> make works. I dunno what's happening.

Do you mean that other programs that use floating point (except Make) run
on your system?  Try to write a trivial program that does some FP
computations and see if it bombs.
 
 
 

linux+dosemu with djgpp

Post by Charles Sandman » Fri, 02 Aug 1996 04:00:00


Quote:> WITH [EMU387], everything but make works. I dunno what's happening.

I suspect the problem is NESTED FP apps.  It may be that a child process
(in either use or FPU detection) has problems after the FPU has been
used.  Since FPU emulation is a DPMI 1.0 extension, and shakey on
documentation, I like Eli's recommendation of removing the useless FPU
operations.
 
 
 

linux+dosemu with djgpp

Post by Sengan.Sh.. » Sat, 03 Aug 1996 04:00:00


Quote:> > > I'd expect that Linux's FP emulator would handle the lack of a co-processor
> > > even for DJGPP programs, but in fact neither gcc nor programs compiled
> > > with it will run without that in the environment. WITH it, everything but
> > > make works. I dunno what's happening.

Basically this could happen if Linux's FPU did not return the values expected
of it when djgpp does the FPU test/cannot because of the linux implementation of
dosemu. I don't think djgpp should be allowed to turn off FPU emulation from
within dosemu: sounds likea security flaw if it could.

Quote:> > Do you mean that other programs that use floating point (except Make) run
> > on your system?  Try to write a trivial program that does some FP
> > computations and see if it bombs.

> Hmmmmm...
> What I thought was happening wasn't as weird as what IS happening.
> It's true that if, under DOSEMU, I don't set both 387=N and
> EMU387=c:\djgpp\bin\emu387.dxe that gcc won't run--it bombs with an
> FP exception.

> What's also true is that (with those vars set) I can compile a program
> such as the following one:

>    #include <stdio.h>
>    main()
>            {
>            float a, b, c;

>            a = 4.0;
>            b = 3.0;
>            c = a*b;
>            }
> andn run it without any crash or other messages. (do I assume it actually
> performed the floating point math?? I'll check it under GDB later.)

> If I add a line like printf ("%f\n", c); to the program it hangs for
> longer than I care to wait. While it's hung, I can see that top shows
> that dosemu is eating about 85% of the CPU. I can ^C out of the program
> then the usage shown by top drops down to a much more reasoanble level.

Since djgpp uses signals, I believe, for FPU emulation, could be that the
the signals are not working properly under dosemu: eg it does not save the
state of the machine to reenter the code, in certain cases. Then it returns
to the wrong place, and CRUNCH!

Since I'm not completely sure of the above, anyone else on the list care to
comment?

Sengan