All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stas Sergeev <stsp@aknet.ru>
To: linux-msdos@vger.kernel.org
Subject: Re: experimental LFN support for redirected drives
Date: Mon, 14 Jul 2003 21:29:49 +0400	[thread overview]
Message-ID: <3F12E88D.1040005@aknet.ru> (raw)

[-- Attachment #1: Type: text/plain, Size: 521 bytes --]

Hello.

Bart Oldeman wrote:
> INT 21 now just executes the DOS int21 and never reaches
> the DOSEMU revectored int21 code. I don't know if it's
> safe to transfer to f000:_BL*0x10 for every interrupt.
I am thinking about a less intrusive solution.

> Maybe you do?
OK, I will do (trying right now:)
The attached patch is intended to fix the
problem. I don't have your test-case for it
so I can only guess if it helps or works as
expected.
A quick test against a couple of DPMI progs
shows no regressions.
Does this help?

[-- Attachment #2: dpmi_int.diff --]
[-- Type: text/plain, Size: 2631 bytes --]

--- src/base/async/int.c	Sun Jun 15 03:01:24 2003
+++ src/base/async/int.c	Mon Jul 14 21:14:22 2003
@@ -1941,6 +1941,13 @@
   LWORD(esp) -= 4;
 }
 
+void fake_call_to(int cs, int ip)
+{
+  fake_call(REG(cs), LWORD(eip));
+  REG(cs) = cs;
+  REG(eip) = ip;
+}
+
 void fake_pusha(void)
 {
 #ifdef X86_EMULATOR
--- src/dosext/dpmi/dpmi.c	Sun Jun 15 19:43:23 2003
+++ src/dosext/dpmi/dpmi.c	Mon Jul 14 21:15:13 2003
@@ -1581,15 +1581,6 @@
       REG(ds) = rmreg->ds;
       REG(fs) = rmreg->fs;
       REG(gs) = rmreg->gs;
-      if (_LWORD(eax)==0x0300) {
-        if (_LO(bx)==0x21)
-          D_printf("DPMI: int 0x21 fn %04x\n",LWORD(eax));
-	REG(cs) = ((us *) 0)[(_LO(bx) << 1) + 1];
-	REG(eip) = ((us *) 0)[_LO(bx) << 1];
-      } else {
-	REG(cs) = rmreg->cs;
-	REG(eip) = (long) rmreg->ip;
-      }
       if (!(rmreg->sp==0)) {
 	REG(ss) = rmreg->ss;
 	REG(esp) = (long) rmreg->sp;
@@ -1606,36 +1597,29 @@
       if (tmp) E_MPROT_STACK(tmp_ssp);
 #endif
       LWORD(esp) -= 2 * (_LWORD(ecx));
-      if (_LWORD(eax)==0x0301)
-	       LWORD(esp) -= 4;
-      else {
-	LWORD(esp) -= 6;
-#ifdef X86_EMULATOR
-	tmp_ssp = rm_ssp+rm_sp;
-	tmp = E_MUNPROT_STACK(tmp_ssp);
-#endif
-	pushw(rm_ssp, rm_sp, LWORD(eflags));
-#ifdef X86_EMULATOR
-	if (tmp) E_MPROT_STACK(tmp_ssp);
-#endif
-	REG(eflags) &= ~(IF|TF);
+      in_dpmi_dos_int=1;
+      REG(cs) = DPMI_SEG;
+      LWORD(eip) = DPMI_OFF + HLT_OFF(DPMI_return_from_realmode);
+      switch (_LWORD(eax)) {
+        case 0x0300:
+          if (_LO(bx)==0x21)
+            D_printf("DPMI: int 0x21 fn %04x\n",LWORD(eax));
+	  do_int(_LO(bx));
+	  break;
+        case 0x0301:
+	  fake_call_to(rmreg->cs, rmreg->ip);
+	  break;
+        case 0x0302:
+	  fake_int_to(rmreg->cs, rmreg->ip);
+	  break;
       }
+
 /* --------------------------------------------------- 0x300:
      RM |  FC90C   |
 	| dpmi_seg |
 	|  flags   |
 	| cx words |
    --------------------------------------------------- */
-#ifdef X86_EMULATOR
-      tmp_ssp = rm_ssp+rm_sp;
-      tmp = E_MUNPROT_STACK(tmp_ssp);
-#endif
-      pushw(rm_ssp, rm_sp, DPMI_SEG);
-      pushw(rm_ssp, rm_sp, DPMI_OFF + HLT_OFF(DPMI_return_from_realmode));
-#ifdef X86_EMULATOR
-      if (tmp) E_MPROT_STACK(tmp_ssp);
-#endif
-      in_dpmi_dos_int=1;
     }
 #ifdef SHOWREGS
     if (debug_level('e')==0) {
--- src/include/int.h	Mon Jul 14 21:15:01 2003
+++ src/include/int.h	Mon Jul 14 21:15:09 2003
@@ -20,6 +20,7 @@
 void fake_int(int, int);
 void fake_int_to(int cs, int ip);
 void fake_call(int, int);
+void fake_call_to(int cs, int ip);
 void fake_pusha(void);
 void setup_interrupts(void);
 void version_init(void);

             reply	other threads:[~2003-07-14 17:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-14 17:29 Stas Sergeev [this message]
2003-07-14 18:07 ` experimental LFN support for redirected drives Bart Oldeman
  -- strict thread matches above, loose matches on Subject: below --
2003-07-13 19:59 Stas Sergeev
2003-07-13 19:34 ` Bart Oldeman
2003-07-13 15:09 Bart Oldeman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F12E88D.1040005@aknet.ru \
    --to=stsp@aknet.ru \
    --cc=linux-msdos@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.