www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/02/26/13:28:52

Date: Mon, 26 Feb 1996 13:21:41 -0500
From: dj (DJ Delorie)
Message-Id: <199602261821.NAA16654@delorie.com>
To: oandico AT eee DOT upd DOT edu DOT ph
CC: djgpp AT delorie DOT com
In-reply-to: <Pine.SOL.3.91.960226135501.2185B-100000@gollum> (message from Orlando Andico on Mon, 26 Feb 1996 13:55:52 -0800 (GMT))
Subject: Re: DOSemu

>   Since DOSemu has a DPMI mode, is it possible to run DJGPP under Linux? 
> has anyone tried this?

I've done lots of djgpp development in dosemu.  You need this patch:

Xref: news-dnh.mv.net comp.os.linux.announce:1659
Path: news-dnh.mv.net!mv!news.sprintlink.net!howland.reston.ans.net!newsfeed.internetmci.com!chi-news.cic.net!nntp.coast.net!news00.sunet.se!sunic!news99.sunet.se!news.funet.fi!news.helsinki.fi!usenet
From: Michael Leodolter <michael AT lab1 DOT psy DOT univie DOT ac DOT at>
Newsgroups: comp.os.linux.announce
Subject: DPMI Patch against plain 0.60.4
Followup-To: comp.os.linux.development.system
Date: Mon, 11 Dec 95 23:25:03 GMT
Organization: Vienna University, Austria
Lines: 120
Approved: linux-announce AT news DOT ornl DOT gov (Lars Wirzenius)
Message-ID: <cola-liw-818724303-29707-1 AT oravannahka DOT helsinki DOT fi>
NNTP-Posting-Host: kruuna.helsinki.fi
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

-----BEGIN PGP SIGNED MESSAGE-----


Hi all DOSEMU-Users/Developers,
with the following patch it is possible to run PM make/compiler
compinations.
I tried it with DJ200 make on a dir with 15 obj-files, and it works fine.

- ----- cut here -----
*** dpmi/dpmi.c.orig	Sat Nov  4 18:46:44 1995
- --- dpmi/dpmi.c	Wed Dec  6 11:33:33 1995
***************
*** 190,195 ****
- --- 190,205 ----
  #define vm86_regs sigcontext
  #endif
  unsigned long RealModeContext;
+ /*
+  * With this stack nested PM programs like DJ200's make/compiler work fine
+  * (maybe Borkland's protected mode make/compiler too).
+  * For do_int31
+  * 	0x0300:	Simulate Real Mode Interrupt
+  * 	0x0301:	Call Real Mode Procedure With Far Return Frame
+  * 	0x0302:	Call Real Mode Procedure With Iret Frame
+  */
+ unsigned long RealModeContext_Stack[DPMI_max_rec_rm_func];
+ unsigned long RealModeContext_Running = 0;
  
  static INTDESC Interrupt_Table[0x100];
  static INTDESC Exception_Table[0x20];
***************
*** 982,987 ****
- --- 992,1013 ----
    /*2ch*/	*++lp = 0xffffffff;
  }
  
+ static inline void save_rm_context()
+ {
+   if (RealModeContext_Running >= DPMI_max_rec_rm_func) {
+     error("DPMI: RealModeContext_Running = 0x%4x\n",RealModeContext_Running++);
+     return;
+   }
+   RealModeContext_Stack[RealModeContext_Running++] = RealModeContext;
+ }
+ 
+ static inline void restore_rm_context()
+ {
+   if (RealModeContext_Running-- > DPMI_max_rec_rm_func)
+     return;
+   RealModeContext = RealModeContext_Stack[RealModeContext_Running];
+ }
+ 
  static inline void save_rm_regs()
  {
    if (DPMI_rm_procedure_running >= DPMI_max_rec_rm_func) {
***************
*** 1231,1236 ****
- --- 1257,1263 ----
    case 0x0301:	/* Call Real Mode Procedure With Far Return Frame */
    case 0x0302:	/* Call Real Mode Procedure With Iret Frame */
      save_rm_regs();
+     save_rm_context();
      RealModeContext = GetSegmentBaseAddress(_es) + (DPMIclient_is_32 ? _edi : _LWORD(edi));
      {
        struct RealModeCallStructure *rmreg = (struct RealModeCallStructure *) RealModeContext;
***************
*** 2088,2094 ****
    my_sp = LWORD(esp);
    NOCARRY;
  
!   save_rm_regs();
  
    REG(cs) = DPMI_SEG;
    REG(eip) = DPMI_OFF + HLT_OFF(DPMI_return_from_dos);
- --- 2115,2123 ----
    my_sp = LWORD(esp);
    NOCARRY;
  
!   if(!in_dpmi) { /* Don't eat rm regs if already in dpmi */
!     save_rm_regs();
!   }
  
    REG(cs) = DPMI_SEG;
    REG(eip) = DPMI_OFF + HLT_OFF(DPMI_return_from_dos);
***************
*** 2944,2949 ****
- --- 2973,2979 ----
  
    } else if (lina == (unsigned char *) (DPMI_ADD + HLT_OFF(DPMI_return_from_realmode))) {
      struct RealModeCallStructure *rmreg = (struct RealModeCallStructure *) RealModeContext;
+     restore_rm_context();
  
      D_printf("DPMI: Return from Real Mode Procedure\n");
  #ifdef SHOWREGS

- ----- cut here -----
- -------------------------------------------------------
- -  Michael Leodolter         Brain Research Lab (BRL)  -
- -  Inst. of Psychologie               Univ. of Vienna  -
- -  EMail:       <Michael DOT Leodolter AT univie DOT ac DOT at>       -
- -  or       <Michael DOT Leodolter AT lab1 DOT psy DOT univie DOT ac DOT at>  -
- -  Tel: <+43-222-40103-2436> Fax: <+43-222-406 64 22>  -	
- -------------------------------------------------------- 


-----BEGIN PGP SIGNATURE-----
Version: 2.6.2i

iQCVAwUBMMy5Y4QRll5MupLRAQEdswQAs1iQy4Zm481Cje1jnKdDkkEZ0nZ5qtmU
d/7WXJmhjNoJuKQRsTmUYM2YRMN5jQ5i09LqRmrFVTUmIXh8zTfEbVCn+ZTuZzuS
UyfkrSNgFlGUnnqyL7jL8aA3a/ZwQ58lVy+2pBeUEO8mThM2SArbnoKBJ/JmUNJS
7Z10KvM89U8=
=uBl9
-----END PGP SIGNATURE-----

-- 
This article has been digitally signed by the moderator, using PGP.
Finger wirzeniu AT kruuna DOT helsinki DOT fi for PGP key needed for validating signature.
Send submissions for comp.os.linux.announce to: linux-announce AT news DOT ornl DOT gov
PLEASE remember a short description of the software and the LOCATION.

- Raw text -


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