The 'djgpp' mailing list is more active - forwarding this to it:
---------- Forwarded message ----------
From: "lostxwind (
lost...@163.com) [via
djgpp-...@delorie.com]"
<
djgpp-...@delorie.com>
Date: Mon, 1 Aug 2022 06:12:26 +0800 (CST)
Subject: Re:BUGREPORT: ___dpmi_get_raw_mode_switch_addr() modifies SI
register and doesn't save it
To:
djgpp-...@delorie.com
Hi,
I was trying to issue a bug report on delorie official site
(
https://www.delorie.com/djgpp/bugs/create.cgi) but failed as the
database is closed. So I tried to contact you through email.
BUGREPROT:
BACKGROUND:
___dpmi_get_raw_mode_switch_addr() is needed to switch modes for some
reason, instead of the __dpmi_simulate_real_mode_* class.
SYMPTOM:
Random crashes involving switch between real(/v86) mode and protected mode.
REASON:
I found variables or function parameters corrupted after calling
___dpmi_get_raw_mode_switch_addr().
After reading the source code, I believe that the implementation of
___dpmi_get_raw_mode_switch_addr() has missed a single line that saves
the ESI register.
src\libc\dpmi\api\d0306.S, line 2-line 4.
code before fix:
#define USE_EBX
#define USE_EDI
#include "dpmidefs.h"
possible fix:
#define USE_EBX
#define USE_EDI
#define USE_ESI
#include "dpmidefs.h"
Current workaround without bugfix:
Write a alternative implementation;
Or wrap the function call with asm that pushl/popl %esi.
Thanks,
crazii