delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/06/15/16:16:16

Sender: nate AT cartsys DOT com
Message-ID: <3766B329.DF976C85@cartsys.com>
Date: Tue, 15 Jun 1999 13:10:17 -0700
From: Nate Eldredge <nate AT cartsys DOT com>
X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.2.10 i586)
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: Q: rebooting PC
References: <Pine DOT SUN DOT 3 DOT 91 DOT 990615140016 DOT 20254A-100000 AT is>
Reply-To: djgpp AT delorie DOT com

Eli Zaretskii wrote:
> 
> On Tue, 15 Jun 1999, Clemens Valens wrote:
> 
> >  * Force a jump to fff0:f000, the PC reset vector.
> 
> Recall that in DJGPP you are in protected mode, where return addresses
> are interpreted differently (as offsets from the CS segment base, not as
> seg:off pointers).  That's why the converted code GPFaults.
> 
> > So my question is: how can I do this in DJGPP, if at all?
> 
> Invoke Int 19h.  I don't remember whether you need to emit a literal
> instruction "INT 19h" or call via __dpmi_int, but one of these ways
> should work.  (The other one is deliberately blocked by CWSDPMI, for
> some obscure reason.)

Or (untested):

__dpmi_regs r;
r.x.cs = 0xfff0;
r.x.ip = 0xf000
r.x.ss = r.x.sp = r.x.flags = 0;
__dpmi_simulate_real_mode_procedure_retf(&r);
-- 

Nate Eldredge
nate AT cartsys DOT com

- Raw text -


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