delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/07/22/07:07:25

Date: Sun, 22 Jul 2001 14:07:00 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: djgpp AT delorie DOT com
Subject: Re: Sabotage!
In-Reply-To: <3b59ebfb.298502@news.primus.ca>
Message-ID: <Pine.SUN.3.91.1010722140624.6415I-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Sat, 21 Jul 2001, Graaagh the Mighty wrote:

> D:\quickm>gcc -c colorlsm.c -g -O6 -ffast-math -fomit-frame-pointer
> -fforce-addr
>  -funroll-loops -march=k6 -malign-double
> Load error: can't switch mode

This message comes from the stub loader.  It means that a call to the
PM entry procedure failed.  Every DJGPP program calls the PM entry
procedure during startup to switch to protected mode.  The PM entry
procedure's address is returned by the DPMI host in response to a call
to function 1687h of Int 2Fh.

You can easily see the details in stub.asm (part of djlsr203.zip).

> I figure someone here is probably knowledgeable
> enough to identify the above, rather uninformative-looking error
> messages

The messages are short because the stub loader is optimized for size:
it's a 2KB program.

> Perhaps they can even shed some light on exactly what it was that was
> done to my computer while I was out.

Did you invoke the compiler in a DOS box that was already open, or did
you open a new box?  If the former, it's possible that some
DOS-extended program was already running there, and COMMAND.COM was
its child, and that this DOS-extended program was incompatible with
DPMI.

It can also be that the selectors in that DOS box were all exhausted,
due to the fact that Windows 9X leaks selectors like a sieve.  Or
maybe some other resource required for DPMI was exhausted.

Finally, it's possible that somehow the Windows DPMI host was turned
off, although I didn't think it was possible.  (On NT, you could
achieve that effect by removing dosx from autoexec.nt.)  But turning
off DPMI should have generated a different message ("no DPMI"), so
this is probably not the case here.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019