dosemu-cvs Mailing List for DOSEMU for Linux
Brought to you by:
bartoldeman
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(58) |
Jul
(52) |
Aug
(90) |
Sep
(166) |
Oct
(55) |
Nov
(18) |
Dec
(7) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(135) |
Feb
(135) |
Mar
(142) |
Apr
(40) |
May
(127) |
Jun
(57) |
Jul
(121) |
Aug
(84) |
Sep
(83) |
Oct
(140) |
Nov
(175) |
Dec
(31) |
| 2005 |
Jan
(44) |
Feb
(42) |
Mar
(48) |
Apr
(59) |
May
(127) |
Jun
(69) |
Jul
(255) |
Aug
(80) |
Sep
(123) |
Oct
(52) |
Nov
(54) |
Dec
(105) |
| 2006 |
Jan
(129) |
Feb
(63) |
Mar
(14) |
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(71) |
Nov
(62) |
Dec
(2) |
| 2007 |
Jan
|
Feb
(1) |
Mar
(13) |
Apr
(20) |
May
(61) |
Jun
(11) |
Jul
|
Aug
|
Sep
(6) |
Oct
|
Nov
|
Dec
(1) |
| 2008 |
Jan
|
Feb
(1) |
Mar
(19) |
Apr
(7) |
May
(2) |
Jun
|
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
(20) |
May
(2) |
Jun
(5) |
Jul
(10) |
Aug
(10) |
Sep
(64) |
Oct
(9) |
Nov
(7) |
Dec
(3) |
| 2010 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
(1) |
Apr
(8) |
May
(37) |
Jun
(6) |
Jul
|
Aug
(1) |
Sep
(2) |
Oct
(7) |
Nov
|
Dec
(3) |
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
(16) |
May
(13) |
Jun
(22) |
Jul
(24) |
Aug
(48) |
Sep
(4) |
Oct
(16) |
Nov
(11) |
Dec
(31) |
| 2013 |
Jan
(46) |
Feb
(23) |
Mar
(10) |
Apr
(12) |
May
(6) |
Jun
(32) |
Jul
(40) |
Aug
(14) |
Sep
|
Oct
(17) |
Nov
(23) |
Dec
(10) |
| 2014 |
Jan
(48) |
Feb
(16) |
Mar
(6) |
Apr
(16) |
May
(37) |
Jun
(16) |
Jul
|
Aug
(5) |
Sep
(9) |
Oct
(1) |
Nov
|
Dec
|
|
From: Stas S. <st...@us...> - 2014-10-04 19:32:10
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "dosemu".
The branch, devel has been updated
via 18f6f5cdf1beceae8c7532718bfaf423e4a44f6a (commit)
from cc971eae4738016c22b3d2e1b3473df2176c8e29 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/dosemu/code/ci/18f6f5cdf1beceae8c7532718bfaf423e4a44f6a
commit 18f6f5cdf1beceae8c7532718bfaf423e4a44f6a
Author: Stas Sergeev <st...@us...>
Date: Sat Oct 4 23:28:52 2014 +0400
add sanity checks to rmapfile() to avoid crash [sf bug #548]
diff --git a/src/arch/linux/debugger/mhpdbgc.c b/src/arch/linux/debugger/mhpdbgc.c
index c0b63dc..8576f59 100644
--- a/src/arch/linux/debugger/mhpdbgc.c
+++ b/src/arch/linux/debugger/mhpdbgc.c
@@ -364,6 +364,10 @@ static void mhp_rusermap(int argc, char *argv[])
last_symbol2++;
}
fclose(ifp);
+ if (!last_symbol2) {
+ mhp_printf("failed to read symbols from map file\n");
+ return;
+ }
/*symbl2_end = symbl2_table[last_symbol2-1].addr;*/
mhp_printf("%d symbol(s) processed\n", last_symbol2);
mhp_printf("highest address %04x:%04x(%s)\n",
@@ -426,6 +430,10 @@ static void mhp_rmapfile(int argc, char *argv[])
}
else
fclose(ifp);
+ if (!last_symbol) {
+ mhp_printf("failed to read symbols from map file\n");
+ return;
+ }
addrmax = symbol_table[last_symbol-1].addr;
mhp_printf("%d symbol(s) processed\n", last_symbol);
mhp_printf("highest address %08lx(%s)\n", addrmax, getname(addrmax));
-----------------------------------------------------------------------
Summary of changes:
src/arch/linux/debugger/mhpdbgc.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
hooks/post-receive
--
dosemu
|
|
From: Stas S. <st...@us...> - 2014-09-28 07:56:03
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "dosemu".
The branch, devel has been updated
via cc971eae4738016c22b3d2e1b3473df2176c8e29 (commit)
from c441dcee6acf18cce2d2b00826a3ea96a4eb95e9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/dosemu/code/ci/cc971eae4738016c22b3d2e1b3473df2176c8e29
commit cc971eae4738016c22b3d2e1b3473df2176c8e29
Author: Stas Sergeev <st...@us...>
Date: Sun Sep 28 11:46:36 2014 +0400
clarify the right to run DOS software under dosemu...
You thought running DOS software under dosemu is illegal, did you? :)
Anyway, this addresses the concerns expressed in this posting:
https://www.mail-archive.com/dos...@li.../msg00328.html
---
The essence of clause 5 is that if your have a weird lawyer that
interprets the GPL this way you are still fine, because we the authors
explicitly say it is not a problem.
Use of a program is not always allowed. You have to make a copy of a
program to use it, and furthermore it can be considered a perforamnce.
Both things that depending of your exact copyright law are regulated.
---
diff --git a/COPYING.DOSEMU b/COPYING.DOSEMU
index 7878e0f..60f6011 100644
--- a/COPYING.DOSEMU
+++ b/COPYING.DOSEMU
@@ -45,6 +45,9 @@
the DOSEMU distribution or any derivative work. This file and
the GPL in the file COPYING must not be separated.
+6. There are no restrictions to run any (proprietary or free) DOS software
+ under dosemu, unless the license of that software says otherwise.
+
The copyrights referred to in clause 3 are from:
--- The Mach DOS Emulator
-----------------------------------------------------------------------
Summary of changes:
COPYING.DOSEMU | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
hooks/post-receive
--
dosemu
|
|
From: Stas S. <st...@us...> - 2014-09-25 08:53:59
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "dosemu".
The branch, devel has been updated
via c441dcee6acf18cce2d2b00826a3ea96a4eb95e9 (commit)
from 74813032a684767c7b6e22f95fbd19783e489e12 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/dosemu/code/ci/c441dcee6acf18cce2d2b00826a3ea96a4eb95e9
commit c441dcee6acf18cce2d2b00826a3ea96a4eb95e9
Author: Stas Sergeev <st...@us...>
Date: Thu Sep 25 12:53:29 2014 +0400
lpt: more logging
diff --git a/src/base/dev/misc/lpt.c b/src/base/dev/misc/lpt.c
index ad623d6..d191c68 100644
--- a/src/base/dev/misc/lpt.c
+++ b/src/base/dev/misc/lpt.c
@@ -129,6 +129,9 @@ static void printer_io_write(ioport_t port, Bit8u value)
if (((lpt[i].control & (CTS_CTRL_NOT_STROBE | CTS_CTRL_NOT_SELECT)) == 0)
&& (value & CTS_CTRL_NOT_STROBE)) {
/* STROBE rising */
+ if (debug_level('p') >= 9)
+ p_printf("LPT%d: STROBE, sending %#x (%c)\n", i+1, lpt[i].data,
+ lpt[i].data);
printer_write(i, lpt[i].data);
lpt[i].status &= ~CTS_STAT_NOT_ACKing;
lpt[i].status |= CTS_STAT_BUSY;
@@ -226,11 +229,13 @@ static int pipe_printer_write(int prnum, Bit8u outchar)
return write(lpt[prnum].file.to_child, &outchar, 1);;
}
-int printer_write(int prnum, int outchar)
+int printer_write(int prnum, Bit8u outchar)
{
if (!lpt[prnum].opened)
printer_open(prnum);
lpt[prnum].remaining = lpt[prnum].delay;
+ if (debug_level('p') >= 9)
+ p_printf("LPT%d: writing %#x (%c)\n", prnum+1, outchar, outchar);
return lpt[prnum].fops.write(prnum, outchar);
}
diff --git a/src/include/lpt.h b/src/include/lpt.h
index ff9a4cb..88536a1 100644
--- a/src/include/lpt.h
+++ b/src/include/lpt.h
@@ -34,7 +34,7 @@ struct printer {
int printer_open(int prnum);
int printer_close(int prnum);
int printer_flush(int prnum);
-int printer_write(int prnum, int outchar);
+int printer_write(int prnum, Bit8u outchar);
ioport_t get_lpt_base(int lptnum);
void printer_config(int prnum, struct printer *pptr);
void printer_print_config(int prnum, void (*print)(const char *, ...));
-----------------------------------------------------------------------
Summary of changes:
src/base/dev/misc/lpt.c | 7 ++++++-
src/include/lpt.h | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
hooks/post-receive
--
dosemu
|
|
From: Stas S. <st...@us...> - 2014-09-24 21:09:11
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "dosemu".
The branch, devel has been updated
via 74813032a684767c7b6e22f95fbd19783e489e12 (commit)
from 72f1d4bdd90ce7947e743ff1b800a95457af03b5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/dosemu/code/ci/74813032a684767c7b6e22f95fbd19783e489e12
commit 74813032a684767c7b6e22f95fbd19783e489e12
Author: Stas Sergeev <st...@us...>
Date: Thu Sep 25 01:07:07 2014 +0400
lpt: make timeout 0-based and improved logging
diff --git a/src/base/dev/misc/lpt.c b/src/base/dev/misc/lpt.c
index 7842c75..ad623d6 100644
--- a/src/base/dev/misc/lpt.c
+++ b/src/base/dev/misc/lpt.c
@@ -208,9 +208,9 @@ static int pipe_printer_close(int prnum)
int printer_close(int prnum)
{
if (lpt[prnum].opened && lpt[prnum].fops.close) {
- p_printf("LPT: closing printer %d\n", prnum);
+ p_printf("LPT%i: closing printer\n", prnum+1);
lpt[prnum].fops.close(prnum);
- lpt[prnum].remaining = -1;
+ lpt[prnum].remaining = 0;
}
lpt[prnum].opened = 0;
return 0;
@@ -271,19 +271,19 @@ printer_init(void)
io_device.fd = -1;
for (i = 0; i < NUM_PRINTERS; i++) {
+ lpt[i].opened = 0;
+ lpt[i].remaining = 0; /* mark not accessed yet */
if (!lpt[i].dev && !lpt[i].prtcmd)
continue;
p_printf("LPT%i: initializing printer %s\n", i+1,
lpt[i].dev ? lpt[i].dev : lpt[i].prtcmd);
- lpt[i].opened = 0;
- lpt[i].remaining = -1; /* mark not accessed yet */
if (lpt[i].dev)
lpt[i].fops = dev_pfops;
else if (lpt[i].prtcmd)
lpt[i].fops = pipe_pfops;
if (i >= min(config.num_lpt, NUM_LPTS)) lpt[i].base_port = 0;
- if (lpt[i].base_port != 0 && lpt[i].fops.open) {
+ if (lpt[i].base_port != 0) {
io_device.start_addr = lpt[i].base_port;
io_device.end_addr = lpt[i].base_port + 2;
port_register_handler(io_device, 0);
@@ -297,6 +297,8 @@ close_all_printers(void)
int loop;
for (loop = 0; loop < NUM_PRINTERS; loop++) {
+ if (!lpt[loop].opened)
+ continue;
p_printf("LPT: closing printer %d (%s)\n", loop,
lpt[loop].dev ? lpt[loop].dev : lpt[loop].prtcmd);
printer_close(loop);
@@ -309,8 +311,9 @@ printer_tick(u_long secno)
int i;
for (i = 0; i < NUM_PRINTERS; i++) {
- if (lpt[i].remaining >= 0) {
- p_printf("LPT: doing real tick for %d\n", i);
+ if (lpt[i].remaining > 0) {
+ if (debug_level('p') >= 9)
+ p_printf("LPT%i: doing tick %d\n", i+1, lpt[i].remaining);
if (lpt[i].remaining) {
reset_idle(2);
lpt[i].remaining--;
@@ -330,7 +333,6 @@ void printer_config(int prnum, struct printer *pptr)
destptr = &lpt[prnum];
destptr->prtcmd = pptr->prtcmd;
destptr->dev = pptr->dev;
- destptr->remaining = pptr->remaining;
destptr->delay = pptr->delay;
}
}
-----------------------------------------------------------------------
Summary of changes:
src/base/dev/misc/lpt.c | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
hooks/post-receive
--
dosemu
|
|
From: Stas S. <st...@us...> - 2014-09-24 19:31:40
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "dosemu".
The branch, devel has been updated
via 72f1d4bdd90ce7947e743ff1b800a95457af03b5 (commit)
from 47884700f3a0573f2d94350a27afda883999589e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/dosemu/code/ci/72f1d4bdd90ce7947e743ff1b800a95457af03b5
commit 72f1d4bdd90ce7947e743ff1b800a95457af03b5
Author: Stas Sergeev <st...@us...>
Date: Wed Sep 24 23:29:41 2014 +0400
lpt: skip undefined printers
diff --git a/src/base/dev/misc/lpt.c b/src/base/dev/misc/lpt.c
index 869df84..7842c75 100644
--- a/src/base/dev/misc/lpt.c
+++ b/src/base/dev/misc/lpt.c
@@ -271,7 +271,10 @@ printer_init(void)
io_device.fd = -1;
for (i = 0; i < NUM_PRINTERS; i++) {
- p_printf("LPT: initializing printer %s\n", lpt[i].dev ? lpt[i].dev : lpt[i].prtcmd);
+ if (!lpt[i].dev && !lpt[i].prtcmd)
+ continue;
+ p_printf("LPT%i: initializing printer %s\n", i+1,
+ lpt[i].dev ? lpt[i].dev : lpt[i].prtcmd);
lpt[i].opened = 0;
lpt[i].remaining = -1; /* mark not accessed yet */
if (lpt[i].dev)
@@ -327,7 +330,6 @@ void printer_config(int prnum, struct printer *pptr)
destptr = &lpt[prnum];
destptr->prtcmd = pptr->prtcmd;
destptr->dev = pptr->dev;
- destptr->file = pptr->file;
destptr->remaining = pptr->remaining;
destptr->delay = pptr->delay;
}
-----------------------------------------------------------------------
Summary of changes:
src/base/dev/misc/lpt.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
hooks/post-receive
--
dosemu
|
|
From: Stas S. <st...@us...> - 2014-09-24 19:25:47
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "dosemu".
The branch, devel has been updated
via 47884700f3a0573f2d94350a27afda883999589e (commit)
via 69fff26f5622f1566230f540774fc552314e3216 (commit)
via 9c1511605ef987800473f64426c6a430cabc1d3e (commit)
from 8558963ad25e3875a3712c02df27f8fd39befe35 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/dosemu/code/ci/47884700f3a0573f2d94350a27afda883999589e
commit 47884700f3a0573f2d94350a27afda883999589e
Author: Stas Sergeev <st...@us...>
Date: Wed Sep 24 23:23:46 2014 +0400
lpt: logging fixes
diff --git a/src/base/dev/misc/lpt.c b/src/base/dev/misc/lpt.c
index 2547e9d..869df84 100644
--- a/src/base/dev/misc/lpt.c
+++ b/src/base/dev/misc/lpt.c
@@ -86,7 +86,7 @@ static Bit8u printer_io_read(ioport_t port)
case 0:
val = lpt[i].data; /* simple unidirectional port */
if (debug_level('p') >= 5)
- p_printf("LPT%d: Reading data byte %#x\n", i, val);
+ p_printf("LPT%d: Reading data byte %#x\n", i+1, val);
break;
case 1: /* status port, r/o */
val = lpt[i].status ^ LPT_STAT_INV_MASK;
@@ -95,12 +95,12 @@ static Bit8u printer_io_read(ioport_t port)
lpt[i].status |= CTS_STAT_NOT_ACKing | LPT_STAT_NOT_IRQ;
lpt[i].status &= ~CTS_STAT_BUSY;
if (debug_level('p') >= 5)
- p_printf("LPT%d: Reading status byte %#x\n", i, val);
+ p_printf("LPT%d: Reading status byte %#x\n", i+1, val);
break;
case 2:
val = lpt[i].control ^ LPT_CTRL_INV_MASK;
if (debug_level('p') >= 5)
- p_printf("LPT%d: Reading control byte %#x\n", i, val);
+ p_printf("LPT%d: Reading control byte %#x\n", i+1, val);
break;
default:
val = 0xff;
@@ -117,14 +117,14 @@ static void printer_io_write(ioport_t port, Bit8u value)
switch (port - lpt[i].base_port) {
case 0:
if (debug_level('p') >= 5)
- p_printf("LPT%d: Writing data byte %#x\n", i, value);
+ p_printf("LPT%d: Writing data byte %#x\n", i+1, value);
lpt[i].data = value;
break;
case 1: /* status port, r/o */
break;
case 2:
if (debug_level('p') >= 5)
- p_printf("LPT%d: Writing control byte %#x\n", i, value);
+ p_printf("LPT%d: Writing control byte %#x\n", i+1, value);
value ^= LPT_CTRL_INV_MASK; // convert to Centronics
if (((lpt[i].control & (CTS_CTRL_NOT_STROBE | CTS_CTRL_NOT_SELECT)) == 0)
&& (value & CTS_CTRL_NOT_STROBE)) {
@@ -144,7 +144,7 @@ static int dev_printer_open(int prnum)
lpt[prnum].dev_fd = open(lpt[prnum].dev, O_WRONLY);
umask(um);
if (lpt[prnum].dev_fd == -1) {
- error("LPT%i: error opening %s: %s\n", prnum, lpt[prnum].dev,
+ error("LPT%i: error opening %s: %s\n", prnum+1, lpt[prnum].dev,
strerror(errno));
return -1;
}
@@ -159,7 +159,7 @@ static void pipe_callback(void *arg)
int n = read(lpt[num].file.from_child, buf, sizeof(buf));
if (n > 0) {
buf[n] = 0;
- error("LPT%i: %s\n", num, buf);
+ error("LPT%i: %s\n", num+1, buf);
}
}
@@ -271,7 +271,7 @@ printer_init(void)
io_device.fd = -1;
for (i = 0; i < NUM_PRINTERS; i++) {
- p_printf("LPT: initializing printer %s\n", lpt[i].dev ? lpt[i].dev : "<<NODEV>>");
+ p_printf("LPT: initializing printer %s\n", lpt[i].dev ? lpt[i].dev : lpt[i].prtcmd);
lpt[i].opened = 0;
lpt[i].remaining = -1; /* mark not accessed yet */
if (lpt[i].dev)
@@ -295,7 +295,7 @@ close_all_printers(void)
for (loop = 0; loop < NUM_PRINTERS; loop++) {
p_printf("LPT: closing printer %d (%s)\n", loop,
- lpt[loop].dev ? lpt[loop].dev : "<<NODEV>>");
+ lpt[loop].dev ? lpt[loop].dev : lpt[loop].prtcmd);
printer_close(loop);
}
}
http://sourceforge.net/p/dosemu/code/ci/69fff26f5622f1566230f540774fc552314e3216
commit 69fff26f5622f1566230f540774fc552314e3216
Author: Stas Sergeev <st...@us...>
Date: Wed Sep 24 23:21:08 2014 +0400
fix popen2() to handle also stderr
diff --git a/src/base/misc/utilities.c b/src/base/misc/utilities.c
index 7722b6f..fb34153 100644
--- a/src/base/misc/utilities.c
+++ b/src/base/misc/utilities.c
@@ -753,6 +753,7 @@ int popen2(const char *cmdline, struct popen2 *childinfo)
close(pipe_stdin[0]);
close(pipe_stdout[0]);
dup2(pipe_stdout[1], 1);
+ dup2(pipe_stdout[1], 2);
close(pipe_stdout[1]);
execl("/bin/sh", "sh", "-c", cmdline, NULL);
perror("execl"); exit(99);
http://sourceforge.net/p/dosemu/code/ci/9c1511605ef987800473f64426c6a430cabc1d3e
commit 9c1511605ef987800473f64426c6a430cabc1d3e
Author: Stas Sergeev <st...@us...>
Date: Wed Sep 24 23:09:51 2014 +0400
forgotten change of prev commit
diff --git a/src/base/init/parser.y.in b/src/base/init/parser.y.in
index 54846aa..9665369 100644
--- a/src/base/init/parser.y.in
+++ b/src/base/init/parser.y.in
@@ -1927,7 +1927,6 @@ static void start_printer(void)
{
pptr->prtcmd = NULL;
pptr->dev = NULL;
- pptr->file = NULL;
pptr->remaining = -1;
pptr->delay = 10;
}
-----------------------------------------------------------------------
Summary of changes:
src/base/dev/misc/lpt.c | 18 +++++++++---------
src/base/init/parser.y.in | 1 -
src/base/misc/utilities.c | 1 +
3 files changed, 10 insertions(+), 10 deletions(-)
hooks/post-receive
--
dosemu
|
|
From: Stas S. <st...@us...> - 2014-09-24 14:05:26
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "dosemu".
The branch, devel has been updated
via 8558963ad25e3875a3712c02df27f8fd39befe35 (commit)
via 09a4973c2a1c6f9d13f82e7e77e05d23c6e8ac8b (commit)
from 6e93aab071762536f89b58db7cdbf9ac11cd9a35 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/dosemu/code/ci/8558963ad25e3875a3712c02df27f8fd39befe35
commit 8558963ad25e3875a3712c02df27f8fd39befe35
Author: Stas Sergeev <st...@us...>
Date: Wed Sep 24 18:04:10 2014 +0400
lpt: use popen2() to get feedback from printer command
diff --git a/src/base/dev/misc/lpt.c b/src/base/dev/misc/lpt.c
index 130609e..2547e9d 100644
--- a/src/base/dev/misc/lpt.c
+++ b/src/base/dev/misc/lpt.c
@@ -27,8 +27,6 @@
#include "utilities.h"
#include "dos2linux.h"
-static int stub_printer_write(int, int);
-
/* status bits, Centronics */
#define CTS_STAT_NOIOERR LPT_STAT_NOIOERR
#define CTS_STAT_ONLINE LPT_STAT_ONLINE
@@ -143,90 +141,96 @@ static void printer_io_write(ioport_t port, Bit8u value)
static int dev_printer_open(int prnum)
{
int um = umask(026);
- lpt[prnum].file = fopen(lpt[prnum].dev, "a");
+ lpt[prnum].dev_fd = open(lpt[prnum].dev, O_WRONLY);
umask(um);
+ if (lpt[prnum].dev_fd == -1) {
+ error("LPT%i: error opening %s: %s\n", prnum, lpt[prnum].dev,
+ strerror(errno));
+ return -1;
+ }
+ p_printf("LPT: opened printer %d to %s\n", prnum, lpt[prnum].dev);
return 0;
}
+static void pipe_callback(void *arg)
+{
+ char buf[1024];
+ int num = (long)arg;
+ int n = read(lpt[num].file.from_child, buf, sizeof(buf));
+ if (n > 0) {
+ buf[n] = 0;
+ error("LPT%i: %s\n", num, buf);
+ }
+}
+
static int pipe_printer_open(int prnum)
{
+ int err;
+ err = popen2(lpt[prnum].prtcmd, &lpt[prnum].file);
+ if (err) {
+ error("system(\"%s\") in lpt.c failed, cannot print! "
+ "Command returned error %s\n", lpt[prnum].prtcmd, strerror(errno));
+ return err;
+ }
p_printf("LPT: doing printer command ..%s..\n", lpt[prnum].prtcmd);
-
- lpt[prnum].file = popen(lpt[prnum].prtcmd, "w");
- if (lpt[prnum].file == NULL)
- error("system(\"%s\") in lpt.c failed, cannot print!\
- Command returned error %s\n", lpt[prnum].prtcmd, strerror(errno));
- return 0;
+ add_to_io_select(lpt[prnum].file.from_child, pipe_callback, (void *)(long)prnum);
+ return err;
}
int printer_open(int prnum)
{
int rc;
- if (lpt[prnum].file != NULL)
+ if (lpt[prnum].opened) {
+ dosemu_error("opening printer %i twice\n", prnum);
return 0;
-
- if (lpt[prnum].fops.open == NULL)
- return -1;
+ }
rc = lpt[prnum].fops.open(prnum);
- /* use line buffering so we don't need to have a long wait for output */
- setvbuf(lpt[prnum].file, NULL, _IOLBF, 0);
- p_printf("LPT: opened printer %d to %s, file %p\n", prnum,
- lpt[prnum].dev ? lpt[prnum].dev : "<<NODEV>>",
- (void *) lpt[prnum].file);
+ if (!rc)
+ lpt[prnum].opened = 1;
+ else
+ error("Error opening printer %i\n", prnum);
return rc;
}
static int dev_printer_close(int prnum)
{
- if (lpt[prnum].file != NULL)
- fclose(lpt[prnum].file);
- return 0;
+ return close(lpt[prnum].dev_fd);
}
static int pipe_printer_close(int prnum)
{
- if (lpt[prnum].file != NULL)
- pclose(lpt[prnum].file);
- lpt[prnum].file = NULL;
- return 0;
+ remove_from_io_select(lpt[prnum].file.from_child);
+ return pclose2(&lpt[prnum].file);
}
int printer_close(int prnum)
{
- if (lpt[prnum].fops.close) {
- p_printf("LPT: closing printer %d, %s\n", prnum,
- lpt[prnum].dev ? lpt[prnum].dev : "<<NODEV>>");
-
+ if (lpt[prnum].opened && lpt[prnum].fops.close) {
+ p_printf("LPT: closing printer %d\n", prnum);
lpt[prnum].fops.close(prnum);
- lpt[prnum].file = NULL;
lpt[prnum].remaining = -1;
}
- lpt[prnum].fops.write = stub_printer_write;
+ lpt[prnum].opened = 0;
return 0;
}
-static int stub_printer_write(int prnum, int outchar)
+static int dev_printer_write(int prnum, Bit8u outchar)
{
- printer_open(prnum);
-
- /* from now on, use real write */
- lpt[prnum].fops.write = lpt[prnum].fops.realwrite;
-
- return printer_write(prnum, outchar);
+ return write(lpt[prnum].dev_fd, &outchar, 1);
}
-static int file_printer_write(int prnum, int outchar)
+static int pipe_printer_write(int prnum, Bit8u outchar)
{
- lpt[prnum].remaining = lpt[prnum].delay;
-
- fputc(outchar, lpt[prnum].file);
- return 0;
+ return write(lpt[prnum].file.to_child, &outchar, 1);;
}
int printer_write(int prnum, int outchar)
{
+ if (!lpt[prnum].opened)
+ printer_open(prnum);
+ lpt[prnum].remaining = lpt[prnum].delay;
return lpt[prnum].fops.write(prnum, outchar);
}
@@ -240,16 +244,14 @@ int printer_write(int prnum, int outchar)
static struct p_fops dev_pfops =
{
dev_printer_open,
- stub_printer_write,
+ dev_printer_write,
dev_printer_close,
- file_printer_write
};
static struct p_fops pipe_pfops =
{
pipe_printer_open,
- stub_printer_write,
+ pipe_printer_write,
pipe_printer_close,
- file_printer_write
};
void
@@ -270,7 +272,7 @@ printer_init(void)
for (i = 0; i < NUM_PRINTERS; i++) {
p_printf("LPT: initializing printer %s\n", lpt[i].dev ? lpt[i].dev : "<<NODEV>>");
- lpt[i].file = NULL;
+ lpt[i].opened = 0;
lpt[i].remaining = -1; /* mark not accessed yet */
if (lpt[i].dev)
lpt[i].fops = dev_pfops;
@@ -311,8 +313,6 @@ printer_tick(u_long secno)
lpt[i].remaining--;
if (!lpt[i].remaining)
printer_close(i);
- else if (lpt[i].file != NULL)
- fflush(lpt[i].file);
}
}
}
diff --git a/src/include/lpt.h b/src/include/lpt.h
index 1f5be10..ff9a4cb 100644
--- a/src/include/lpt.h
+++ b/src/include/lpt.h
@@ -7,11 +7,12 @@
#ifndef LPT_H
#define LPT_H 1
+#include "utilities.h"
+
struct p_fops {
int (*open) (int prtnum);
- int (*write) (int prtnum, int data);
+ int (*write) (int prtnum, Bit8u data);
int (*close) (int prtnum);
- int (*realwrite) (int prnum, int data);
};
struct printer {
@@ -21,10 +22,10 @@ struct printer {
ioport_t base_port; /* Base port address handled by device */
/* end of user-set options */
- FILE *file;
- int remaining;
-
+ struct popen2 file;
+ int dev_fd;
struct p_fops fops;
+ int opened, remaining;
Bit8u data, status, control;
};
http://sourceforge.net/p/dosemu/code/ci/09a4973c2a1c6f9d13f82e7e77e05d23c6e8ac8b
commit 09a4973c2a1c6f9d13f82e7e77e05d23c6e8ac8b
Author: Stas Sergeev <st...@us...>
Date: Wed Sep 24 17:22:25 2014 +0400
lpt: make printer struct private
diff --git a/src/base/bios/int17.c b/src/base/bios/int17.c
index fff8e90..dae576c 100644
--- a/src/base/bios/int17.c
+++ b/src/base/bios/int17.c
@@ -68,7 +68,7 @@ printer_mem_setup(void)
int i;
for (i = 0; i < NUM_LPTS; i++) {
/* set the port address for each printer in bios */
- WRITE_WORD(BIOS_ADDRESS_LPT1 + i * 2, lpt[i].base_port);
+ WRITE_WORD(BIOS_ADDRESS_LPT1 + i * 2, get_lpt_base(i));
WRITE_BYTE(BIOS_LPT1_TIMEOUT + i, 20);
}
}
diff --git a/src/base/dev/misc/lpt.c b/src/base/dev/misc/lpt.c
index 565b4d0..130609e 100644
--- a/src/base/dev/misc/lpt.c
+++ b/src/base/dev/misc/lpt.c
@@ -52,13 +52,21 @@ static int stub_printer_write(int, int);
#define DEFAULT_CTRL (CTS_CTRL_NOT_INIT | CTS_CTRL_NOT_AUTOLF | \
CTS_CTRL_NOT_STROBE)
-struct printer lpt[NUM_PRINTERS] =
+#define NUM_PRINTERS 9
+static struct printer lpt[NUM_PRINTERS] =
{
{NULL, NULL, 5, 0x378, .control = DEFAULT_CTRL, .status = DEFAULT_STAT},
{NULL, NULL, 5, 0x278, .control = DEFAULT_CTRL, .status = DEFAULT_STAT},
{NULL, NULL, 10, 0x3bc, .control = DEFAULT_CTRL, .status = DEFAULT_STAT}
};
+ioport_t get_lpt_base(int lptnum)
+{
+ if (lptnum >= NUM_LPTS)
+ return -1;
+ return lpt[lptnum].base_port;
+}
+
static int get_printer(ioport_t port)
{
int i;
diff --git a/src/include/lpt.h b/src/include/lpt.h
index 9f0cad7..1f5be10 100644
--- a/src/include/lpt.h
+++ b/src/include/lpt.h
@@ -34,6 +34,7 @@ int printer_open(int prnum);
int printer_close(int prnum);
int printer_flush(int prnum);
int printer_write(int prnum, int outchar);
+ioport_t get_lpt_base(int lptnum);
void printer_config(int prnum, struct printer *pptr);
void printer_print_config(int prnum, void (*print)(const char *, ...));
@@ -54,9 +55,6 @@ void printer_print_config(int prnum, void (*print)(const char *, ...));
#define LPT_CTRL_AUTOLF 0x2
#define LPT_CTRL_STROBE 0x1
-#define NUM_PRINTERS 9
-extern struct printer lpt[NUM_PRINTERS];
-
#define NUM_LPTS 3
#endif /* LPT_H */
-----------------------------------------------------------------------
Summary of changes:
src/base/bios/int17.c | 2 +-
src/base/dev/misc/lpt.c | 110 +++++++++++++++++++++++++----------------------
src/include/lpt.h | 15 +++---
3 files changed, 67 insertions(+), 60 deletions(-)
hooks/post-receive
--
dosemu
|
|
From: Stas S. <st...@us...> - 2014-09-19 13:58:18
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "dosemu".
The branch, devel has been updated
via 6e93aab071762536f89b58db7cdbf9ac11cd9a35 (commit)
from fbc7f4321a0e76aceed2ed1c62cb8ceb38b72835 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/dosemu/code/ci/6e93aab071762536f89b58db7cdbf9ac11cd9a35
commit 6e93aab071762536f89b58db7cdbf9ac11cd9a35
Author: Stas Sergeev <st...@us...>
Date: Fri Sep 19 00:00:06 2014 +0400
disable xf86vm extension by default [fixes #547]
It seems it only causes problems these days.
Lets see if someone wants it back and will object.
There are the very strange artifacts with XResizeWindow() after the
mode switch, and if dosemu crash, the entire desktop is unusable.
The downside is some performance drop and, more importantly, the degraded
graphics quality. Without a mode switch there is no more interpolation
done by monitor. But this should be fixed with the software filtering in
the future.
xrandr should be investigated as an alternative.
But this patch allows to get something functional quickly.
diff --git a/compiletime-settings b/compiletime-settings
index abf3e9b..9a35260 100644
--- a/compiletime-settings
+++ b/compiletime-settings
@@ -2,7 +2,7 @@ config {
experimental off
sbemu on
mitshm on
- vidmode on
+ vidmode off
x on
net on
debug off
diff --git a/compiletime-settings.devel b/compiletime-settings.devel
index 9afd5ee..4a82288 100644
--- a/compiletime-settings.devel
+++ b/compiletime-settings.devel
@@ -2,7 +2,7 @@ config {
experimental on
sbemu on
mitshm on
- vidmode on
+ vidmode off
x on
net on
debug on
diff --git a/configure b/configure
index b7f106e..1faf59f 100755
--- a/configure
+++ b/configure
@@ -1381,7 +1381,7 @@ Optional Features:
--enable-linkstatic make statically linked binaries
--disable-dlplugins do NOT use dynamically loaded plugins
--disable-mitshm do NOT use the MITSHM X extension
- --disable-vidmode do NOT use the XF86 vidmode extension
+ --enable-vidmode use XF86 vidmode extension
--enable-experimental enable configuration of EXPERIMENTAL stuff
--enable-debug compile with debug info
--disable-aspi do NOT compile with ASPI support
@@ -5833,7 +5833,7 @@ if test "${enable_vidmode+set}" = set; then :
enableval=$enable_vidmode;
fi
- if test "$enable_vidmode" != "no" ; then
+ if test "$enable_vidmode" = "yes" ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XF86VidModeSwitchToMode in -lXxf86vm" >&5
$as_echo_n "checking for XF86VidModeSwitchToMode in -lXxf86vm... " >&6; }
if ${ac_cv_lib_Xxf86vm_XF86VidModeSwitchToMode+:} false; then :
@@ -5877,7 +5877,7 @@ else
fi
fi
- if test "$enable_vidmode" = "no"; then
+ if test "$enable_vidmode" != "yes"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Compiling without the XF86 video mode extension" >&5
$as_echo "$as_me: Compiling without the XF86 video mode extension" >&6;}
else
diff --git a/configure.ac b/configure.ac
index 574a892..a5b4df9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -363,11 +363,11 @@ if test "$have_x" = "yes" ; then
LIBS="-lXext $LIBS"
AC_ARG_ENABLE(vidmode,
- [ --disable-vidmode do NOT use the XF86 vidmode extension])
- if test "$enable_vidmode" != "no" ; then
+ [ --enable-vidmode use XF86 vidmode extension])
+ if test "$enable_vidmode" = "yes" ; then
AC_CHECK_LIB(Xxf86vm, XF86VidModeSwitchToMode, enable_vidmode="yes", enable_vidmode="no")
fi
- if test "$enable_vidmode" = "no"; then
+ if test "$enable_vidmode" != "yes"; then
AC_MSG_NOTICE(Compiling without the XF86 video mode extension)
else
AC_CHECK_HEADER(X11/extensions/xf86vmode.h,
diff --git a/default-configure b/default-configure
index 8432add..5f1ad25 100755
--- a/default-configure
+++ b/default-configure
@@ -57,7 +57,7 @@ while [ "$1" != "" ]; do
if [ "$2" = "off" ]; then STRING="$STRING --disable-mitshm"; fi
;;
vidmode)
- if [ "$2" = "off" ]; then STRING="$STRING --without-vidmode"; fi
+ if [ "$2" = "off" ]; then STRING="$STRING --disable-vidmode"; fi
;;
sbemu)
if [ "$2" = "off" ]; then STRING="$STRING --disable-sbemu"; fi
-----------------------------------------------------------------------
Summary of changes:
compiletime-settings | 2 +-
compiletime-settings.devel | 2 +-
configure | 6 +++---
configure.ac | 6 +++---
default-configure | 2 +-
5 files changed, 9 insertions(+), 9 deletions(-)
hooks/post-receive
--
dosemu
|
|
From: Stas S. <st...@us...> - 2014-09-17 22:13:57
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "dosemu".
The branch, devel has been updated
via fbc7f4321a0e76aceed2ed1c62cb8ceb38b72835 (commit)
via 03b84bda85556a2fb342c797bc78e2719445d25c (commit)
from 020758c1527764544c986ea77e81cce60f576bd6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/dosemu/code/ci/fbc7f4321a0e76aceed2ed1c62cb8ceb38b72835
commit fbc7f4321a0e76aceed2ed1c62cb8ceb38b72835
Author: Stas Sergeev <st...@us...>
Date: Thu Sep 18 02:02:15 2014 +0400
X: XResizeWindow needs +1 for sizes [sf bug #547]
Not sure why... but that works.
diff --git a/src/plugin/X/X.c b/src/plugin/X/X.c
index 8d54ab3..8e188c8 100644
--- a/src/plugin/X/X.c
+++ b/src/plugin/X/X.c
@@ -1358,8 +1358,8 @@ static void toggle_fullscreen_mode(int init)
X_vidmode(x_res, y_res, &resize_width, &resize_height);
mainwindow = fullscreenwindow;
if (vga.mode_class == GRAPH || use_bitmap_font) {
- XResizeWindow(display, mainwindow, resize_width, resize_height);
- XResizeWindow(display, drawwindow, resize_width, resize_height);
+ XResizeWindow(display, mainwindow, resize_width+1, resize_height+1);
+ XResizeWindow(display, drawwindow, resize_width+1, resize_height+1);
} else {
shift_x = (resize_width - w_x_res) / 2;
shift_y = (resize_height - w_y_res) / 2;
@@ -1383,8 +1383,8 @@ static void toggle_fullscreen_mode(int init)
mainwindow = normalwindow;
X_vidmode(-1, -1, &resize_width, &resize_height);
if (vga.mode_class == GRAPH || use_bitmap_font) {
- XResizeWindow(display, mainwindow, resize_width, resize_height);
- XResizeWindow(display, drawwindow, resize_width, resize_height);
+ XResizeWindow(display, mainwindow, resize_width+1, resize_height+1);
+ XResizeWindow(display, drawwindow, resize_width+1, resize_height+1);
}
XMapWindow(display, mainwindow);
XReparentWindow(display, drawwindow, mainwindow, 0, 0);
@@ -1706,7 +1706,7 @@ static void X_handle_events(void)
}
if(resize_event && mainwindow == normalwindow) {
- XResizeWindow(display, drawwindow, resize_width, resize_height);
+ XResizeWindow(display, drawwindow, resize_width+1, resize_height+1);
resize_ximage(resize_width, resize_height);
dirty_all_video_pages();
if (vga.mode_class == TEXT)
@@ -2088,14 +2088,14 @@ static void lock_window_size(unsigned wx_res, unsigned wy_res)
if (mainwindow == fullscreenwindow)
X_vidmode(x_res, y_res, &x_fill, &y_fill);
- XResizeWindow(display, mainwindow, x_fill, y_fill);
+ XResizeWindow(display, mainwindow, x_fill+1, y_fill+1);
if(vga.mode_class == TEXT && !use_bitmap_font) {
x_fill = w_x_res;
y_fill = w_y_res;
}
- XResizeWindow(display, drawwindow, x_fill, y_fill);
+ XResizeWindow(display, drawwindow, x_fill+1, y_fill+1);
X_printf("Resizing our window to %dx%d image\n", x_fill, y_fill);
if (use_bitmap_font) {
@@ -2277,8 +2277,8 @@ int X_set_videomode(int mode_class, int text_width, int text_height)
if(config.X_fixed_aspect || config.X_aspect_43) sh.flags |= PAspect;
XSetNormalHints(display, normalwindow, &sh);
- XResizeWindow(display, mainwindow, w_x_res, w_y_res);
- XResizeWindow(display, drawwindow, w_x_res, w_y_res);
+ XResizeWindow(display, mainwindow, w_x_res+1, w_y_res+1);
+ XResizeWindow(display, drawwindow, w_x_res+1, w_y_res+1);
}
/* unconditionally update the palette */
http://sourceforge.net/p/dosemu/code/ci/03b84bda85556a2fb342c797bc78e2719445d25c
commit 03b84bda85556a2fb342c797bc78e2719445d25c
Author: Stas Sergeev <st...@us...>
Date: Thu Sep 18 00:40:41 2014 +0400
X: implement fullscreen without xf86vm extension
diff --git a/src/plugin/X/X.c b/src/plugin/X/X.c
index 8a84331..8d54ab3 100644
--- a/src/plugin/X/X.c
+++ b/src/plugin/X/X.c
@@ -2321,29 +2321,39 @@ void X_resize_text_screen()
*/
static void X_vidmode(int w, int h, int *new_width, int *new_height)
{
- int nw, nh, dw, dh, mx, my, shift_x, shift_y;
+ int nw, nh, mx, my, shift_x, shift_y;
- nw = dw = DisplayWidth(display, screen);
- nh = dh = DisplayHeight(display, screen);
+ nw = DisplayWidth(display, screen);
+ nh = DisplayHeight(display, screen);
#ifdef HAVE_XVIDMODE
if (xf86vm_ok) {
static XF86VidModeModeLine vidmode_modeline;
static int viewport_x, viewport_y, dotclock;
- int vx = 0, vy = 0;
int i, j, restore_dotclock = 0;
-
+ int vx = 0, vy = 0;
+#else
+ {
+#endif
+ static int prev_w, prev_h;
if (w == -1 && h == -1) { /* need to perform reset to windowed mode */
- w = vidmode_modeline.hdisplay;
- h = vidmode_modeline.vdisplay;
+ w = prev_w;
+ h = prev_h;
+#ifdef HAVE_XVIDMODE
vx = viewport_x;
vy = viewport_y;
restore_dotclock = 1;
+#endif
} else if (mainwindow != fullscreenwindow) {
+#ifdef HAVE_XVIDMODE
XF86VidModeGetModeLine(display,screen,&dotclock,&vidmode_modeline);
XF86VidModeGetViewPort(display,screen,&viewport_x,&viewport_y);
+#endif
+ prev_w = nw;
+ prev_h = nh;
mainwindow = fullscreenwindow;
}
+#ifdef HAVE_XVIDMODE
j = -1;
for (i=0; i<modecount; i++) {
if ((vidmode_modes[i]->hdisplay >= w) &&
@@ -2370,12 +2380,8 @@ static void X_vidmode(int w, int h, int *new_width, int *new_height)
X_printf("X: vidmode asking for (%d,%d); setting (%d,%d)\n", w, h, nw, nh);
XF86VidModeSwitchToMode(display,screen,vidmode_modes[j]);
XF86VidModeSetViewPort (display,screen,vx,vy);
- } else {
- error("X: mode switch requested but does not work\n");
- }
-#else
- error("X: mode switch requested but is not compiled in\n");
#endif
+ }
if (mainwindow == normalwindow) {
nw = w_x_res;
-----------------------------------------------------------------------
Summary of changes:
src/plugin/X/X.c | 48 +++++++++++++++++++++++++++---------------------
1 files changed, 27 insertions(+), 21 deletions(-)
hooks/post-receive
--
dosemu
|
|
From: Stas S. <st...@us...> - 2014-09-17 13:10:59
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "dosemu".
The branch, devel has been updated
via 020758c1527764544c986ea77e81cce60f576bd6 (commit)
from c8f96f31f44fac65467a826bfb0e11119f70b1c9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/dosemu/code/ci/020758c1527764544c986ea77e81cce60f576bd6
commit 020758c1527764544c986ea77e81cce60f576bd6
Author: Stas Sergeev <st...@us...>
Date: Wed Sep 17 17:01:43 2014 +0400
X: print error if mode switch not available
diff --git a/src/plugin/X/X.c b/src/plugin/X/X.c
index b3871f4..8a84331 100644
--- a/src/plugin/X/X.c
+++ b/src/plugin/X/X.c
@@ -2370,7 +2370,11 @@ static void X_vidmode(int w, int h, int *new_width, int *new_height)
X_printf("X: vidmode asking for (%d,%d); setting (%d,%d)\n", w, h, nw, nh);
XF86VidModeSwitchToMode(display,screen,vidmode_modes[j]);
XF86VidModeSetViewPort (display,screen,vx,vy);
+ } else {
+ error("X: mode switch requested but does not work\n");
}
+#else
+ error("X: mode switch requested but is not compiled in\n");
#endif
if (mainwindow == normalwindow) {
-----------------------------------------------------------------------
Summary of changes:
src/plugin/X/X.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
hooks/post-receive
--
dosemu
|
|
From: Stas S. <st...@us...> - 2014-08-10 20:56:06
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "dosemu".
The branch, devel has been updated
via c8f96f31f44fac65467a826bfb0e11119f70b1c9 (commit)
from d2b55cdcb824d607fdd18acdf0cea10d819c18a9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/dosemu/code/ci/c8f96f31f44fac65467a826bfb0e11119f70b1c9
commit c8f96f31f44fac65467a826bfb0e11119f70b1c9
Author: Stas Sergeev <st...@us...>
Date: Mon Aug 11 00:53:14 2014 +0400
CPUEMU: fix error logic of "stack patch failure, fix source code!" msg
diff --git a/src/emu-i386/simx86/cpatch.c b/src/emu-i386/simx86/cpatch.c
index 95ce111..6ea4974 100644
--- a/src/emu-i386/simx86/cpatch.c
+++ b/src/emu-i386/simx86/cpatch.c
@@ -438,7 +438,9 @@ int Cpatch(struct sigcontext_struct *scp)
if (*p==0x66) w16=1,p++; else w16=0;
v = *((int *)p) & 0xffffff;
- while (v==0x0e0489) { // stack: never fail
+ if (v==0x0e0489) { // stack: never fail
+ int cnt = 0;
+ do {
// mov %%{e}ax,(%%esi,%%ecx,1)
// we have a sequence: 66 89 04 0e
// or 89 04 0e
@@ -454,11 +456,11 @@ int Cpatch(struct sigcontext_struct *scp)
p += 9;
if (*p==0x66) w16=1,p++; else w16=0;
v = *((int *)p) & 0xffffff;
- /* extra check: should not fail */
- if (v!=0x0e0489) {
+ cnt++;
+ } while (v==0x0e0489);
+ if (cnt < 2)
dbug_printf("CPUEMU: stack patch failure, fix source code!\n");
- return 1;
- }
+ return 1;
}
if (v==0x900788) { // movb %%al,(%%edi)
// we have a sequence: 88 07 90
-----------------------------------------------------------------------
Summary of changes:
src/emu-i386/simx86/cpatch.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
hooks/post-receive
--
dosemu
|
|
From: Stas S. <st...@us...> - 2014-08-10 18:47:46
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "dosemu".
The branch, devel has been updated
via d2b55cdcb824d607fdd18acdf0cea10d819c18a9 (commit)
via ca0067c60407e5a7c669ac9088cf146720d268eb (commit)
via 256266350e3d2d5ae4ca8b2efa9c68d96a584ad6 (commit)
from fbb014c08e2354a6b9de389a09095eaafff25319 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/dosemu/code/ci/d2b55cdcb824d607fdd18acdf0cea10d819c18a9
commit d2b55cdcb824d607fdd18acdf0cea10d819c18a9
Author: Stas Sergeev <st...@us...>
Date: Sun Aug 10 22:43:18 2014 +0400
X: disable KeymapNotify event processing
It sometimes causes duplicate keypresses.
Should fix sf bug #542
diff --git a/src/plugin/X/X.c b/src/plugin/X/X.c
index ce7666e..b3871f4 100644
--- a/src/plugin/X/X.c
+++ b/src/plugin/X/X.c
@@ -1575,12 +1575,14 @@ static void X_handle_events(void)
keyrel_pending = 1;
break;
+#if 0
case KeymapNotify:
X_printf("X: KeymapNotify event\n");
/* don't process keys when doing fullscreen switching (this generates
two events for fullscreen and one back to windowed mode )*/
X_process_keys(&e.xkeymap);
break;
+#endif
/* A keyboard mapping has been changed (e.g., with xmodmap). */
case MappingNotify:
diff --git a/src/plugin/X/keyb_X.c b/src/plugin/X/keyb_X.c
index 1a63282..44cd39b 100644
--- a/src/plugin/X/keyb_X.c
+++ b/src/plugin/X/keyb_X.c
@@ -243,6 +243,7 @@ void X_sync_shiftstate(Boolean make, KeyCode kc, unsigned int e_state)
}
static int initialized= 0;
+#if 0
void X_process_keys(XKeymapEvent *e)
{
if (!initialized) {
@@ -254,6 +255,7 @@ void X_process_keys(XKeymapEvent *e)
return;
}
}
+#endif
void map_X_event(Display *display, XKeyEvent *e, struct mapped_X_event *result)
{
diff --git a/src/plugin/X/keyb_X_keycode.c b/src/plugin/X/keyb_X_keycode.c
index 060a3ec..f3d0985 100644
--- a/src/plugin/X/keyb_X_keycode.c
+++ b/src/plugin/X/keyb_X_keycode.c
@@ -580,7 +580,7 @@ static void put_keycode(int make, int keycode, t_keysym sym)
move_keynum(make, keynum, sym);
}
-
+#if 0
void X_keycode_process_keys(XKeymapEvent *e)
{
int i;
@@ -605,6 +605,7 @@ void X_keycode_process_keys(XKeymapEvent *e)
}
}
}
+#endif
void X_keycode_process_key(XKeyEvent *e)
{
http://sourceforge.net/p/dosemu/code/ci/ca0067c60407e5a7c669ac9088cf146720d268eb
commit ca0067c60407e5a7c669ac9088cf146720d268eb
Author: Stas Sergeev <st...@us...>
Date: Sun Aug 10 21:55:18 2014 +0400
X: keycode_to_keynum array now stores indexes of keynum_from_keycode array
diff --git a/src/plugin/X/keyb_X_keycode.c b/src/plugin/X/keyb_X_keycode.c
index e672f7b..060a3ec 100644
--- a/src/plugin/X/keyb_X_keycode.c
+++ b/src/plugin/X/keyb_X_keycode.c
@@ -30,8 +30,8 @@ struct X_keyb_config {
struct X_keyb_config *keyb_config = NULL;
#define MAX_X_KEYCODES 256
-static t_keysym keycode_to_keynum[MAX_X_KEYCODES];
-#define KEYCODE_TO_KEYNUM(i) keycode_to_keynum[i]
+static int keycode_to_keynum[MAX_X_KEYCODES];
+#define KEYCODE_TO_KEYNUM(i) k2kn(i)
#if 0
const char *XStatusString(Status status)
@@ -449,6 +449,14 @@ static const struct {
{ NUM_PAUSE_BREAK, "BREA"},
};
+static t_keynum k2kn(KeyCode xcode)
+{
+ int idx = keycode_to_keynum[xcode];
+ if (idx == -1)
+ return NUM_VOID;
+ return keynum_from_keycode[idx].keynum;
+}
+
static Boolean setup_keycode_to_keynum_mapping(Display *display)
{
#if HAVE_XKB
@@ -468,7 +476,7 @@ static Boolean setup_keycode_to_keynum_mapping(Display *display)
keynum_from_keycode[i].keycode_name, TRUE);
X_printf("X: looking for %s\n", keynum_from_keycode[i].keycode_name);
if (xcode && (KEYCODE_TO_KEYNUM(xcode) == NUM_VOID)) {
- keycode_to_keynum[xcode] = keynum_from_keycode[i].keynum;
+ keycode_to_keynum[xcode] = i;
X_printf("X: mapping %s(%02x) -> %02x\n",
keynum_from_keycode[i].keycode_name,
xcode,
@@ -516,8 +524,16 @@ static void setup_keycode_to_keynum(void *p, t_unicode dosemu_keysym,
int keysyms_per_keycode;
KeySym *sym = XGetKeyboardMapping (display, xcode, 1,
&keysyms_per_keycode);
- if (map < keysyms_per_keycode && sym[map] == xkey)
- keycode_to_keynum[xcode] = keynum;
+ if (map < keysyms_per_keycode && sym[map] == xkey) {
+ int i;
+ for(i = 0; i < sizeof(keynum_from_keycode)/sizeof(keynum_from_keycode[0]);
+ i++) {
+ if (keynum_from_keycode[i].keynum == keynum) {
+ keycode_to_keynum[xcode] = i;
+ break;
+ }
+ }
+ }
XFree(sym);
}
}
@@ -531,7 +547,7 @@ static void X_keycode_initialize(Display *display)
for(i = 0; i < MAX_X_KEYCODES; i++) {
- keycode_to_keynum[i] = NUM_VOID;
+ keycode_to_keynum[i] = -1;
}
#if 0
display_x_keyboard(display);
http://sourceforge.net/p/dosemu/code/ci/256266350e3d2d5ae4ca8b2efa9c68d96a584ad6
commit 256266350e3d2d5ae4ca8b2efa9c68d96a584ad6
Author: Stas Sergeev <st...@us...>
Date: Sun Aug 10 21:34:18 2014 +0400
X: use macro to access keycode_to_keynum array
diff --git a/src/plugin/X/keyb_X_keycode.c b/src/plugin/X/keyb_X_keycode.c
index ab87e77..e672f7b 100644
--- a/src/plugin/X/keyb_X_keycode.c
+++ b/src/plugin/X/keyb_X_keycode.c
@@ -31,6 +31,7 @@ struct X_keyb_config *keyb_config = NULL;
#define MAX_X_KEYCODES 256
static t_keysym keycode_to_keynum[MAX_X_KEYCODES];
+#define KEYCODE_TO_KEYNUM(i) keycode_to_keynum[i]
#if 0
const char *XStatusString(Status status)
@@ -466,7 +467,7 @@ static Boolean setup_keycode_to_keynum_mapping(Display *display)
xcode = XkbFindKeycodeByName(desc,
keynum_from_keycode[i].keycode_name, TRUE);
X_printf("X: looking for %s\n", keynum_from_keycode[i].keycode_name);
- if (xcode && (keycode_to_keynum[xcode] == NUM_VOID)) {
+ if (xcode && (KEYCODE_TO_KEYNUM(xcode) == NUM_VOID)) {
keycode_to_keynum[xcode] = keynum_from_keycode[i].keynum;
X_printf("X: mapping %s(%02x) -> %02x\n",
keynum_from_keycode[i].keycode_name,
@@ -545,7 +546,7 @@ static void X_keycode_initialize(Display *display)
}
#if 1
for(i = 0; i < MAX_X_KEYCODES; i++) {
- t_keynum keynum = keycode_to_keynum[i];
+ t_keynum keynum = KEYCODE_TO_KEYNUM(i);
if (keynum != NUM_VOID) {
k_printf("mapping keycode:%d -> keynum: 0x%02x\n",
i, keynum);
@@ -557,7 +558,7 @@ static void X_keycode_initialize(Display *display)
static void put_keycode(int make, int keycode, t_keysym sym)
{
t_keysym keynum;
- keynum = keycode_to_keynum[keycode];
+ keynum = KEYCODE_TO_KEYNUM(keycode);
if (keynum == NUM_VOID)
return;
move_keynum(make, keynum, sym);
-----------------------------------------------------------------------
Summary of changes:
src/plugin/X/X.c | 2 ++
src/plugin/X/keyb_X.c | 2 ++
src/plugin/X/keyb_X_keycode.c | 36 +++++++++++++++++++++++++++---------
3 files changed, 31 insertions(+), 9 deletions(-)
hooks/post-receive
--
dosemu
|
|
From: Stas S. <st...@us...> - 2014-08-05 19:57:49
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "dosemu".
The branch, devel has been updated
via fbb014c08e2354a6b9de389a09095eaafff25319 (commit)
from 5ad6bed2630a98d5faa12d17a2d92b9f1bfd4b00 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/dosemu/code/ci/fbb014c08e2354a6b9de389a09095eaafff25319
commit fbb014c08e2354a6b9de389a09095eaafff25319
Author: Stas Sergeev <st...@us...>
Date: Tue Aug 5 23:55:29 2014 +0400
X: use XkbSetDetectableAutoRepeat() instead of silly filtering
diff --git a/src/plugin/X/X.c b/src/plugin/X/X.c
index 2c935f5..ce7666e 100644
--- a/src/plugin/X/X.c
+++ b/src/plugin/X/X.c
@@ -701,6 +701,7 @@ int X_init()
attr.cursor = X_standard_cursor;
XChangeWindowAttributes(display, drawwindow, CWEventMask | CWCursor, &attr);
+ XkbSetDetectableAutoRepeat(display, True, NULL);
/* thanks to Wine */
if (XmbTextListToTextProperty( display, &config.X_title, 1, XStdICCTextStyle,
-----------------------------------------------------------------------
Summary of changes:
src/plugin/X/X.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
hooks/post-receive
--
dosemu
|
|
From: Stas S. <st...@us...> - 2014-08-04 21:03:12
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "dosemu".
The branch, devel has been updated
via 5ad6bed2630a98d5faa12d17a2d92b9f1bfd4b00 (commit)
from 02aea751a0340a91118e8a5b81416c81924cf53d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/dosemu/code/ci/5ad6bed2630a98d5faa12d17a2d92b9f1bfd4b00
commit 5ad6bed2630a98d5faa12d17a2d92b9f1bfd4b00
Author: Stas Sergeev <st...@us...>
Date: Tue Aug 5 01:01:47 2014 +0400
cosmetic change to prev commit
diff --git a/src/base/async/int.c b/src/base/async/int.c
index be4c1f0..0b525c5 100644
--- a/src/base/async/int.c
+++ b/src/base/async/int.c
@@ -1339,7 +1339,7 @@ static int msdos(void)
}
}
if (win31_mode) {
- sprintf(win31_title, "Windows 3.1 in %c86 mode", win31_mode + '0');
+ sprintf(win31_title, "Windows 3.1 in %i86 mode", win31_mode);
str = win31_title;
}
#endif
-----------------------------------------------------------------------
Summary of changes:
src/base/async/int.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
hooks/post-receive
--
dosemu
|
|
From: Stas S. <st...@us...> - 2014-08-04 20:57:24
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "dosemu".
The branch, devel has been updated
via 02aea751a0340a91118e8a5b81416c81924cf53d (commit)
via 06999c2599bb08357b0b3e11db84e35d07cb6700 (commit)
via 47631392ecfac35cff606dabc7447e2c1a399944 (commit)
from 231f014450ad1a388ed2ab8a902cbfd7809dedf7 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/dosemu/code/ci/02aea751a0340a91118e8a5b81416c81924cf53d
commit 02aea751a0340a91118e8a5b81416c81924cf53d
Author: Stas Sergeev <st...@us...>
Date: Tue Aug 5 00:51:47 2014 +0400
fix yet another regression of 4b7bbe :(
diff --git a/src/base/async/int.c b/src/base/async/int.c
index 8648cb7..be4c1f0 100644
--- a/src/base/async/int.c
+++ b/src/base/async/int.c
@@ -1308,6 +1308,10 @@ static int msdos(void)
}
#if WINDOWS_HACKS
+ if ((ptr = strstrDOS(cmd, "KRNL386")) ||
+ (ptr = strstrDOS(cmd, "KRNL286"))) {
+ win31_mode = ptr[4] - '0';
+ }
if ((ptr = strstrDOS(cmd, "\\SYSTEM\\DOSX.EXE")) ||
(ptr = strstrDOS(cmd, "\\SYSTEM\\WIN386.EXE"))) {
int have_args = 0;
@@ -1325,8 +1329,6 @@ static int msdos(void)
memcpy(ptr+8, tmp_ptr, 7);
#endif
strcpy(ptr+8+7, ".exe");
- sprintf(win31_title, "Windows 3.1 in %c86 mode", tmp_ptr[4]);
- str = win31_title;
win31_mode = tmp_ptr[4] - '0';
if (have_args) {
tmp_ptr = strchr(tmp_ptr, ' ');
@@ -1336,6 +1338,10 @@ static int msdos(void)
}
}
}
+ if (win31_mode) {
+ sprintf(win31_title, "Windows 3.1 in %c86 mode", win31_mode + '0');
+ str = win31_title;
+ }
#endif
if (!Video->change_config)
http://sourceforge.net/p/dosemu/code/ci/06999c2599bb08357b0b3e11db84e35d07cb6700
commit 06999c2599bb08357b0b3e11db84e35d07cb6700
Author: Stas Sergeev <st...@us...>
Date: Tue Aug 5 00:33:02 2014 +0400
fix more regressions of 4b7bbe [sf bug #541]
diff --git a/src/dosext/mfs/util.c b/src/dosext/mfs/util.c
index 74404c8..80a16f6 100644
--- a/src/dosext/mfs/util.c
+++ b/src/dosext/mfs/util.c
@@ -153,7 +153,7 @@ static BOOL strnequalDOS(const char *name, const char *upname, int len)
BOOL strequalDOS(const char *name, const char *upname)
{
- return strnequalDOS(name, upname, strlen(upname));
+ return strnequalDOS(name, upname, strlen(upname) + 1);
}
char *strstrDOS(char *haystack, const char *upneedle)
http://sourceforge.net/p/dosemu/code/ci/47631392ecfac35cff606dabc7447e2c1a399944
commit 47631392ecfac35cff606dabc7447e2c1a399944
Author: Stas Sergeev <st...@us...>
Date: Tue Aug 5 00:31:49 2014 +0400
delete unused file
diff --git a/src/dosext/mfs/mfs.patch.c b/src/dosext/mfs/mfs.patch.c
deleted file mode 100644
index 6a80db5..0000000
--- a/src/dosext/mfs/mfs.patch.c
+++ /dev/null
@@ -1,33 +0,0 @@
-diff --git a/src/dosext/mfs/mfs.c b/src/dosext/mfs/mfs.c
-index 63c973a..23eea9e 100644
---- a/src/dosext/mfs/mfs.c
-+++ b/src/dosext/mfs/mfs.c
-@@ -3285,7 +3285,7 @@ dos_fs_redirect(state_t *state)
- char *filename1;
- char *filename2;
- unsigned dta;
-- long s_pos=0;
-+ off_t s_pos=0;
- unsigned int devptr;
- u_char attr;
- u_char subfunc;
-@@ -3442,7 +3442,7 @@ dos_fs_redirect(state_t *state)
- case READ_FILE:
- { /* 0x08 */
- int return_val;
-- int itisnow;
-+ off_t itisnow;
-
- cnt = WORD(state->ecx);
- if (open_files[sft_fd(sft)].name == NULL) {
-@@ -3461,8 +3461,8 @@ dos_fs_redirect(state_t *state)
- SETWORD(&(state->ecx), 0);
- return (TRUE);
- }
-- Debug0((dbg_fd, "Actual pos %d\n",
-- itisnow));
-+ Debug0((dbg_fd, "Actual pos %u\n",
-+ (unsigned int)itisnow));
-
- ret = dos_read(fd, dta, cnt);
-
-----------------------------------------------------------------------
Summary of changes:
src/base/async/int.c | 10 ++++++++--
src/dosext/mfs/mfs.patch.c | 33 ---------------------------------
src/dosext/mfs/util.c | 2 +-
3 files changed, 9 insertions(+), 36 deletions(-)
delete mode 100644 src/dosext/mfs/mfs.patch.c
hooks/post-receive
--
dosemu
|
|
From: Stas S. <st...@us...> - 2014-06-29 18:36:06
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "dosemu".
The branch, devel has been updated
via 231f014450ad1a388ed2ab8a902cbfd7809dedf7 (commit)
from 9d5a06f7e1aa892bcd5f0b42b05835f07d1b2c95 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/dosemu/code/ci/231f014450ad1a388ed2ab8a902cbfd7809dedf7
commit 231f014450ad1a388ed2ab8a902cbfd7809dedf7
Author: Stas Sergeev <st...@us...>
Date: Sun Jun 29 22:33:42 2014 +0400
a couple of copy/paste regressions
diff --git a/src/env/video/instremu.c b/src/env/video/instremu.c
index 4a545be..43f68c2 100644
--- a/src/env/video/instremu.c
+++ b/src/env/video/instremu.c
@@ -2065,11 +2065,11 @@ static inline int instr_sim(x86_regs *x86, int pmode)
case 0xe2: /* loop */
eip += ( (x86->address_size == 4 ? --x86->ecx : --CX) ?
- 2 + *(unsigned char *)MEM_BASE32(cs + eip + 1) : 2); break;
+ 2 + *(signed char *)MEM_BASE32(cs + eip + 1) : 2); break;
case 0xe3: /* jcxz */
eip += ((x86->address_size == 4 ? x86->ecx : CX) ? 2 :
- 2 + *(unsigned char *)MEM_BASE32(cs + eip + 1));
+ 2 + *(signed char *)MEM_BASE32(cs + eip + 1));
break;
/* 0xe4 in ib 0xe5 in iw 0xe6 out ib 0xe7 out iw */
-----------------------------------------------------------------------
Summary of changes:
src/env/video/instremu.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
hooks/post-receive
--
dosemu
|
|
From: Stas S. <st...@us...> - 2014-06-29 16:39:04
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "dosemu".
The branch, instremu_base32 has been deleted
was 5c894e06819ff8dc75c027207a35883ac94be2ac
- Log -----------------------------------------------------------------
5c894e06819ff8dc75c027207a35883ac94be2ac cripple instremu with MEM_BASE32
-----------------------------------------------------------------------
hooks/post-receive
--
dosemu
|
|
From: Stas S. <st...@us...> - 2014-06-29 16:38:38
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "dosemu".
The branch, devel has been updated
via 9d5a06f7e1aa892bcd5f0b42b05835f07d1b2c95 (commit)
via 2222041609f397fd66b0c6bc89642812b087b2f1 (commit)
via 5c894e06819ff8dc75c027207a35883ac94be2ac (commit)
from 81c389dec3339b97acedcaca823f98275f181d52 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/dosemu/code/ci/9d5a06f7e1aa892bcd5f0b42b05835f07d1b2c95
commit 9d5a06f7e1aa892bcd5f0b42b05835f07d1b2c95
Author: Stas Sergeev <st...@us...>
Date: Sun Jun 29 20:36:38 2014 +0400
calling leavedos() from sighandler doesn't really work
Use signal return machinery and process leavedos() later.
diff --git a/src/arch/linux/async/signal.c b/src/arch/linux/async/signal.c
index 176a659..6fdfd07 100644
--- a/src/arch/linux/async/signal.c
+++ b/src/arch/linux/async/signal.c
@@ -413,9 +413,11 @@ static void sig_child(int sig, siginfo_t *si, void *uc)
}
__attribute__((no_instrument_function))
-static void leavedos_signal(int sig)
+static void leavedos_signal(int sig, siginfo_t *si, void *uc)
{
- init_handler(NULL);
+ struct sigcontext_struct *scp =
+ (struct sigcontext_struct *)&((ucontext_t *)uc)->uc_mcontext;
+ init_handler(scp);
if (ld_sig) {
error("gracefull exit failed, aborting (sig=%i)\n", sig);
_exit(sig);
@@ -429,7 +431,9 @@ static void leavedos_signal(int sig)
in_handle_signals = 0;
}
/* process it now */
- handle_signals();
+ if (in_dpmi && !in_vm86)
+ dpmi_sigio(scp);
+ dpmi_iret_setup(scp);
}
/* Silly Interrupt Generator Initialization/Closedown */
@@ -622,14 +626,9 @@ signal_pre_init(void)
#ifdef SIGBUS /* for newer kernels */
newsetsig(SIGBUS, dosemu_fault);
#endif
- setsig(SIGINT, leavedos_signal); /* for "graceful" shutdown for ^C too*/
- setsig(SIGHUP, leavedos_signal); /* for "graceful" shutdown */
- setsig(SIGTERM, leavedos_signal);
-#if 0 /* Richard Stevens says it can't be caught. It's returning an
- * error anyway
- */
- setsig(SIGKILL, leavedos_signal);
-#endif
+ newsetsig(SIGINT, leavedos_signal); /* for "graceful" shutdown for ^C too*/
+ newsetsig(SIGHUP, leavedos_signal); /* for "graceful" shutdown */
+ newsetsig(SIGTERM, leavedos_signal);
newsetsig(SIGQUIT, sigasync);
registersig(SIGQUIT, sigquit);
setsig(SIGPIPE, SIG_IGN);
http://sourceforge.net/p/dosemu/code/ci/2222041609f397fd66b0c6bc89642812b087b2f1
commit 2222041609f397fd66b0c6bc89642812b087b2f1
Author: Stas Sergeev <st...@us...>
Date: Sun Jun 29 20:18:44 2014 +0400
fix regression of prev commit
instremu now works again
diff --git a/src/env/video/instremu.c b/src/env/video/instremu.c
index fc9d625..4a545be 100644
--- a/src/env/video/instremu.c
+++ b/src/env/video/instremu.c
@@ -2518,7 +2518,7 @@ int decode_modify_segreg_insn(struct sigcontext_struct *scp, int pmode,
unsigned int *new_val)
{
unsigned char *mem;
- unsigned char cs;
+ unsigned cs;
int inst_len, ret = -1;
x86_regs x86;
-----------------------------------------------------------------------
Summary of changes:
src/arch/linux/async/signal.c | 21 +-
src/dosext/dpmi/dpmi.c | 13 -
src/dosext/dpmi/dpmi.h | 1 -
src/env/video/instremu.c | 577 ++++++++++++++++++++++-------------------
src/env/video/vgaemu.c | 2 +-
5 files changed, 317 insertions(+), 297 deletions(-)
hooks/post-receive
--
dosemu
|
|
From: Stas S. <st...@us...> - 2014-06-29 14:17:21
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "dosemu".
The branch, instremu_base32 has been created
at 5c894e06819ff8dc75c027207a35883ac94be2ac (commit)
- Log -----------------------------------------------------------------
http://sourceforge.net/p/dosemu/code/ci/5c894e06819ff8dc75c027207a35883ac94be2ac
commit 5c894e06819ff8dc75c027207a35883ac94be2ac
Author: Stas Sergeev <st...@us...>
Date: Sun Jun 29 18:12:47 2014 +0400
cripple instremu with MEM_BASE32
It doesn't work now...
diff --git a/src/dosext/dpmi/dpmi.c b/src/dosext/dpmi/dpmi.c
index a14b447..082bdef 100644
--- a/src/dosext/dpmi/dpmi.c
+++ b/src/dosext/dpmi/dpmi.c
@@ -1031,19 +1031,6 @@ FI;
return 1;
}
-static void *GetSegmentBaseAddress(unsigned short selector)
-{
- if (!ValidAndUsedSelector(selector))
- return 0;
- return MEM_BASE32(Segments[selector >> 3].base_addr);
-}
-
-/* needed in env/video/vesa.c */
-void *dpmi_GetSegmentBaseAddress(unsigned short selector)
-{
- return GetSegmentBaseAddress(selector);
-}
-
unsigned int GetSegmentBase(unsigned short selector)
{
if (!ValidAndUsedSelector(selector))
diff --git a/src/dosext/dpmi/dpmi.h b/src/dosext/dpmi/dpmi.h
index 9889ebd..64c9e39 100644
--- a/src/dosext/dpmi/dpmi.h
+++ b/src/dosext/dpmi/dpmi.h
@@ -198,7 +198,6 @@ int DPMISetPageAttributes(unsigned long handle, int offs, us attrs[], int count)
int DPMIGetPageAttributes(unsigned long handle, int offs, us attrs[], int count);
void GetFreeMemoryInformation(unsigned int *lp);
int GetDescriptor(us selector, unsigned int *lp);
-void *dpmi_GetSegmentBaseAddress(unsigned short selector);
unsigned int GetSegmentBase(unsigned short);
unsigned int GetSegmentLimit(unsigned short);
int CheckSelectors(struct sigcontext_struct *scp, int in_dosemu);
diff --git a/src/env/video/instremu.c b/src/env/video/instremu.c
index 18b49b3..fc9d625 100644
--- a/src/env/video/instremu.c
+++ b/src/env/video/instremu.c
@@ -88,7 +88,7 @@
#define BP (R_WORD(x86->ebp))
#define EFLAGS (x86->eflags)
#define FLAGS (R_WORD(EFLAGS))
-#define OP_JCC(cond) eip += (cond) ? 2 + (signed char)cs[eip + 1] : 2; break;
+#define OP_JCC(cond) eip += (cond) ? 2 + *(signed char *)MEM_BASE32(cs + eip + 1) : 2; break;
/* assembly macros to speed up x86 on x86 emulation: the cpu helps us in setting
the flags */
@@ -143,8 +143,8 @@ typedef struct x86_regs {
unsigned eip;
unsigned long eflags;
unsigned es, cs, ss, ds, fs, gs;
- unsigned char *cs_base, *ds_base, *es_base, *ss_base, *fs_base, *gs_base;
- unsigned char *seg_base, *seg_ss_base;
+ unsigned cs_base, ds_base, es_base, ss_base, fs_base, gs_base;
+ unsigned seg_base, seg_ss_base;
unsigned _32bit:1; /* 16/32 bit code */
unsigned address_size; /* in bytes so either 4 or 2 */
unsigned operand_size;
@@ -737,7 +737,7 @@ static inline void push(unsigned val, x86_regs *x86)
x86->esp -= x86->operand_size;
else
SP -= x86->operand_size;
- mem = x86->ss_base + (x86->esp & wordmask[(x86->_32bit+1)*2]);
+ mem = MEM_BASE32(x86->ss_base + (x86->esp & wordmask[(x86->_32bit+1)*2]));
if (x86->operand_size == 4)
instr_write_dword(mem, val);
else
@@ -746,7 +746,7 @@ static inline void push(unsigned val, x86_regs *x86)
static inline void pop(unsigned *val, x86_regs *x86)
{
- unsigned char *mem = x86->ss_base + (x86->esp & wordmask[(x86->_32bit+1)*2]);
+ unsigned char *mem = MEM_BASE32(x86->ss_base + (x86->esp & wordmask[(x86->_32bit+1)*2]));
if (x86->_32bit)
x86->esp += x86->operand_size;
else
@@ -807,15 +807,15 @@ unsigned char *sib(unsigned char *cp, x86_regs *x86, int *inst_len)
case 0x03:
case 0x06:
case 0x07:
- return addr + *reg(cp[2], x86) + x86->seg_base;
+ return MEM_BASE32(addr + *reg(cp[2], x86) + x86->seg_base);
case 0x04: /* esp */
- return addr + x86->esp + x86->seg_ss_base;
+ return MEM_BASE32(addr + x86->esp + x86->seg_ss_base);
case 0x05:
if (cp[1] >= 0x40)
- return addr + x86->ebp + x86->seg_ss_base;
+ return MEM_BASE32(addr + x86->ebp + x86->seg_ss_base);
else {
*inst_len += 4;
- return addr + R_DWORD(cp[3]) + x86->seg_base;
+ return MEM_BASE32(addr + R_DWORD(cp[3]) + x86->seg_base);
}
}
return 0; /* keep gcc happy */
@@ -845,26 +845,26 @@ unsigned char *modrm16(unsigned char *cp, x86_regs *x86, int *inst_len)
switch(cp[1] & 0x07) { /* decode address */
case 0x00:
- return ((addr + x86->ebx + x86->esi) & 0xffff) + x86->seg_base;
+ return MEM_BASE32(((addr + x86->ebx + x86->esi) & 0xffff) + x86->seg_base);
case 0x01:
- return ((addr + x86->ebx + x86->edi) & 0xffff) + x86->seg_base;
+ return MEM_BASE32(((addr + x86->ebx + x86->edi) & 0xffff) + x86->seg_base);
case 0x02:
- return ((addr + x86->ebp + x86->esi) & 0xffff) + x86->seg_ss_base;
+ return MEM_BASE32(((addr + x86->ebp + x86->esi) & 0xffff) + x86->seg_ss_base);
case 0x03:
- return ((addr + x86->ebp + x86->edi) & 0xffff) + x86->seg_ss_base;
+ return MEM_BASE32(((addr + x86->ebp + x86->edi) & 0xffff) + x86->seg_ss_base);
case 0x04:
- return ((addr + x86->esi) & 0xffff) + x86->seg_base;
+ return MEM_BASE32(((addr + x86->esi) & 0xffff) + x86->seg_base);
case 0x05:
- return ((addr + x86->edi) & 0xffff) + x86->seg_base;
+ return MEM_BASE32(((addr + x86->edi) & 0xffff) + x86->seg_base);
case 0x06:
if (cp[1] >= 0x40)
- return ((addr + x86->ebp) & 0xffff) + x86->seg_ss_base;
+ return MEM_BASE32(((addr + x86->ebp) & 0xffff) + x86->seg_ss_base);
else {
*inst_len += 2;
- return R_WORD(cp[2]) + x86->seg_base;
+ return MEM_BASE32(R_WORD(cp[2]) + x86->seg_base);
}
case 0x07:
- return ((addr + x86->ebx) & 0xffff) + x86->seg_base;
+ return MEM_BASE32(((addr + x86->ebx) & 0xffff) + x86->seg_base);
}
return 0; /* keep gcc happy */
}
@@ -896,16 +896,16 @@ unsigned char *modrm32(unsigned char *cp, x86_regs *x86, int *inst_len)
case 0x03:
case 0x06:
case 0x07:
- return addr + *reg(cp[1], x86) + x86->seg_base;
+ return MEM_BASE32(addr + *reg(cp[1], x86) + x86->seg_base);
case 0x04: /* sib byte follows */
*inst_len += 1;
return sib(cp, x86, inst_len);
case 0x05:
if (cp[1] >= 0x40)
- return addr + x86->ebp + x86->seg_ss_base;
+ return MEM_BASE32(addr + x86->ebp + x86->seg_ss_base);
else {
*inst_len += 4;
- return R_DWORD(cp[2]) + x86->seg_base;
+ return MEM_BASE32(R_DWORD(cp[2]) + x86->seg_base);
}
}
return 0; /* keep gcc happy */
@@ -914,11 +914,10 @@ unsigned char *modrm32(unsigned char *cp, x86_regs *x86, int *inst_len)
static int handle_prefixes(x86_regs *x86)
{
unsigned eip = x86->eip;
- unsigned char *cs = (unsigned char *) x86->cs_base;
int prefix = 0;
- for (;;) {
- switch(cs[eip++]) {
+ for (;; eip++) {
+ switch(*(unsigned char *)MEM_BASE32(x86->cs_base + eip)) {
/* handle (some) prefixes */
case 0x26:
prefix++;
@@ -1010,7 +1009,7 @@ static inline int instr_sim(x86_regs *x86, int pmode)
int i, i2, inst_len;
int loop_inc = (EFLAGS&DF) ? -1 : 1; // make it a char ?
unsigned eip = x86->eip;
- unsigned char *cs = (unsigned char *) x86->cs_base;
+ unsigned cs = x86->cs_base;
#if DEBUG_INSTR >= 2
{
@@ -1018,7 +1017,7 @@ static inline int instr_sim(x86_regs *x86, int pmode)
unsigned char frmtbuf[256];
refseg = x86->cs;
dump_x86_regs(x86);
- rc = dis_8086(cs+eip, frmtbuf, x86->_32bit, &refseg, cs);
+ rc = dis_8086(MEM_BASE32(cs+eip), frmtbuf, x86->_32bit, &refseg, MEM_BASE32(cs));
instr_deb("vga_emu_fault: about to simulate %d: %s\n", count, frmtbuf);
}
#endif
@@ -1035,7 +1034,7 @@ static inline int instr_sim(x86_regs *x86, int pmode)
i2 = 0;
if (x86->address_size == 4) {
repcount = x86->ecx;
- switch(cs[eip]) {
+ switch(*(unsigned char *)MEM_BASE32(cs + eip)) {
case 0xa4: /* rep movsb */
#if DEBUG_INSTR >= 1
if (x86->es_base >= 0xa0000 && x86->es_base < 0xb0000 &&
@@ -1045,8 +1044,8 @@ static inline int instr_sim(x86_regs *x86, int pmode)
#endif
for (i = 0, und = 0; und < repcount && !signal_pending() && count>0;
i += loop_inc, und++, count--)
- instr_write_byte(x86->es_base + x86->edi+i,
- instr_read_byte(x86->seg_base + x86->esi+i));
+ instr_write_byte(MEM_BASE32(x86->es_base + x86->edi+i),
+ instr_read_byte(MEM_BASE32(x86->seg_base + x86->esi+i)));
x86->edi += i;
x86->esi += i;
break;
@@ -1055,16 +1054,16 @@ static inline int instr_sim(x86_regs *x86, int pmode)
/* TODO: accelerate this using memcpy */
for (i = 0, und = 0; und < repcount && !signal_pending() && count>0;
i += loop_inc*x86->operand_size, und++, count--)
- x86->instr_write(x86->es_base + x86->edi+i,
- x86->instr_read(x86->seg_base + x86->esi+i));
+ x86->instr_write(MEM_BASE32(x86->es_base + x86->edi+i),
+ x86->instr_read(MEM_BASE32(x86->seg_base + x86->esi+i)));
x86->edi += i;
x86->esi += i;
break;
case 0xa6: /* rep cmpsb */
for (i = 0, und = 0; und < repcount && !signal_pending() && count>0; count--) {
- instr_binary_byte(7, instr_read_byte(x86->seg_base + x86->esi+i),
- instr_read_byte(x86->es_base + x86->edi+i), &EFLAGS);
+ instr_binary_byte(7, instr_read_byte(MEM_BASE32(x86->seg_base + x86->esi+i)),
+ instr_read_byte(MEM_BASE32(x86->es_base + x86->edi+i)), &EFLAGS);
i += loop_inc;
und++;
if (((EFLAGS & ZF) >> 6) != x86->rep) /* 0xf2 repnz 0xf3 repz */ {
@@ -1078,8 +1077,8 @@ static inline int instr_sim(x86_regs *x86, int pmode)
case 0xa7: /* rep cmpsw/d */
for (i = 0, und = 0; und < repcount && !signal_pending() && count>0; count--) {
- x86->instr_binary(7, instr_read_byte(x86->seg_base + x86->esi+i),
- x86->instr_read(x86->es_base + x86->edi+i), &EFLAGS);
+ x86->instr_binary(7, instr_read_byte(MEM_BASE32(x86->seg_base + x86->esi+i)),
+ x86->instr_read(MEM_BASE32(x86->es_base + x86->edi+i)), &EFLAGS);
i += loop_inc*x86->operand_size;
und++;
if (((EFLAGS & ZF) >> 6) != x86->rep) /* 0xf2 repnz 0xf3 repz */ {
@@ -1095,7 +1094,7 @@ static inline int instr_sim(x86_regs *x86, int pmode)
/* TODO: accelerate this using memset */
for (und2 = x86->edi, und = 0; und < repcount && !signal_pending() && count>0;
und2 += loop_inc, und++, count--)
- instr_write_byte(x86->es_base + und2, AL);
+ instr_write_byte(MEM_BASE32(x86->es_base + und2), AL);
x86->edi = und2;
break;
@@ -1103,13 +1102,13 @@ static inline int instr_sim(x86_regs *x86, int pmode)
/* TODO: accelerate this using memset */
for (und2 = x86->edi, und = 0; und < repcount && !signal_pending() && count>0;
und2 += loop_inc*x86->operand_size, und++, count--)
- x86->instr_write(x86->es_base + und2, x86->eax);
+ x86->instr_write(MEM_BASE32(x86->es_base + und2), x86->eax);
x86->edi = und2;
break;
case 0xae: /* rep scasb */
for (und2 = x86->edi, und = 0; und < repcount && !signal_pending() && count>0; count--) {
- instr_binary_byte(7, AL, instr_read_byte(x86->es_base + und2), &EFLAGS);
+ instr_binary_byte(7, AL, instr_read_byte(MEM_BASE32(x86->es_base + und2)), &EFLAGS);
und2 += loop_inc;
und++;
if (((EFLAGS & ZF) >> 6) != x86->rep) /* 0x0 repnz 0x1 repz */ {
@@ -1122,7 +1121,7 @@ static inline int instr_sim(x86_regs *x86, int pmode)
case 0xaf: /* rep scasw */
for (und2 = x86->edi, und = 0; und < repcount && !signal_pending() && count>0; count--) {
- x86->instr_binary(7, x86->eax, x86->instr_read(x86->es_base + und2), &EFLAGS);
+ x86->instr_binary(7, x86->eax, x86->instr_read(MEM_BASE32(x86->es_base + und2)), &EFLAGS);
und2 += loop_inc*x86->operand_size;
und++;
if (((EFLAGS & ZF) >> 6) != x86->rep) /* 0x0 repnz 0x1 repz */ {
@@ -1142,7 +1141,7 @@ static inline int instr_sim(x86_regs *x86, int pmode)
} else {
repcount = CX;
- switch(cs[eip]) {
+ switch(*(unsigned char *)MEM_BASE32(cs + eip)) {
case 0xa4: /* rep movsb */
#if DEBUG_INSTR >= 1
if (x86->es_base >= 0xa0000 && x86->es_base < 0xb0000 &&
@@ -1152,8 +1151,8 @@ static inline int instr_sim(x86_regs *x86, int pmode)
#endif
for (i = 0, und = 0; und < repcount && !signal_pending() && count>0;
i += loop_inc, und++, count--)
- instr_write_byte(x86->es_base + ((x86->edi+i) & 0xffff),
- instr_read_byte(x86->seg_base + ((x86->esi+i) & 0xffff)));
+ instr_write_byte(MEM_BASE32(x86->es_base + ((x86->edi+i) & 0xffff)),
+ instr_read_byte(MEM_BASE32(x86->seg_base + ((x86->esi+i) & 0xffff))));
DI += i;
SI += i;
break;
@@ -1162,16 +1161,16 @@ static inline int instr_sim(x86_regs *x86, int pmode)
/* TODO: accelerate this using memcpy */
for (i = 0, und = 0; und < repcount && !signal_pending() && count>0;
i += loop_inc*x86->operand_size, und++, count--)
- x86->instr_write(x86->es_base + ((x86->edi+i) & 0xffff),
- x86->instr_read(x86->seg_base + ((x86->esi+i) & 0xffff)));
+ x86->instr_write(MEM_BASE32(x86->es_base + ((x86->edi+i) & 0xffff)),
+ x86->instr_read(MEM_BASE32(x86->seg_base + ((x86->esi+i) & 0xffff))));
DI += i;
SI += i;
break;
case 0xa6: /* rep?z cmpsb */
for (i = 0, und = 0; und < repcount && !signal_pending() && count>0; count--) {
- instr_binary_byte(7, instr_read_byte(x86->seg_base + ((x86->esi+i) & 0xffff)),
- instr_read_byte(x86->es_base + ((x86->edi+i) & 0xffff)), &EFLAGS);
+ instr_binary_byte(7, instr_read_byte(MEM_BASE32(x86->seg_base + ((x86->esi+i) & 0xffff))),
+ instr_read_byte(MEM_BASE32(x86->es_base + ((x86->edi+i) & 0xffff))), &EFLAGS);
i += loop_inc;
und++;
if (((EFLAGS & ZF) >> 6) != x86->rep) /* 0x0 repnz 0x1 repz */ {
@@ -1185,8 +1184,8 @@ static inline int instr_sim(x86_regs *x86, int pmode)
case 0xa7: /* rep?z cmpsw/d */
for (i = 0, und = 0; und < repcount && !signal_pending() && count>0; count--) {
- x86->instr_binary(7, x86->instr_read(x86->seg_base + ((x86->esi+i) & 0xffff)),
- x86->instr_read(x86->es_base + ((x86->edi+i) & 0xffff)), &EFLAGS);
+ x86->instr_binary(7, x86->instr_read(MEM_BASE32(x86->seg_base + ((x86->esi+i) & 0xffff))),
+ x86->instr_read(MEM_BASE32(x86->es_base + ((x86->edi+i) & 0xffff))), &EFLAGS);
i += loop_inc * x86->operand_size;
und++;
if (((EFLAGS & ZF) >> 6) != x86->rep) /* 0x0 repnz 0x1 repz */ {
@@ -1202,7 +1201,7 @@ static inline int instr_sim(x86_regs *x86, int pmode)
/* TODO: accelerate this using memset */
for (uns = DI, und = 0; und < repcount && !signal_pending() && count>0;
uns += loop_inc, und++, count--)
- instr_write_byte(x86->es_base + uns, AL);
+ instr_write_byte(MEM_BASE32(x86->es_base + uns), AL);
DI = uns;
break;
@@ -1210,13 +1209,13 @@ static inline int instr_sim(x86_regs *x86, int pmode)
/* TODO: accelerate this using memset */
for (uns = DI, und = 0; und < repcount && !signal_pending() && count>0;
uns += loop_inc*x86->operand_size, und++, count--)
- x86->instr_write(x86->es_base + uns, (x86->operand_size == 4 ? x86->eax : AX));
+ x86->instr_write(MEM_BASE32(x86->es_base + uns), (x86->operand_size == 4 ? x86->eax : AX));
DI = uns;
break;
case 0xae: /* rep scasb */
for (uns = DI, und = 0; und < repcount && !signal_pending() && count>0; count--) {
- instr_binary_byte(7, AL, instr_read_byte(x86->es_base + uns), &EFLAGS);
+ instr_binary_byte(7, AL, instr_read_byte(MEM_BASE32(x86->es_base + uns)), &EFLAGS);
uns += loop_inc;
und++;
if (((EFLAGS & ZF) >> 6) != x86->rep) /* 0x0 repnz 0x1 repz */ {
@@ -1229,7 +1228,7 @@ static inline int instr_sim(x86_regs *x86, int pmode)
case 0xaf: /* rep scasw/d */
for (uns = DI, und = 0; und < repcount && !signal_pending() && count>0; count--) {
- x86->instr_binary(7, AX, instr_read_word(x86->es_base + uns), &EFLAGS);
+ x86->instr_binary(7, AX, instr_read_word(MEM_BASE32(x86->es_base + uns)), &EFLAGS);
uns += loop_inc*x86->operand_size;
und++;
if (((EFLAGS & ZF) >> 6) != x86->rep) /* 0x0 repnz 0x1 repz */ {
@@ -1248,7 +1247,7 @@ static inline int instr_sim(x86_regs *x86, int pmode)
}
eip++;
}
- else switch(cs[eip]) {
+ else switch(*(unsigned char *)MEM_BASE32(cs + eip)) {
case 0x00: /* add r/m8,reg8 */
case 0x08: /* or r/m8,reg8 */
case 0x10: /* adc r/m8,reg8 */
@@ -1257,9 +1256,10 @@ static inline int instr_sim(x86_regs *x86, int pmode)
case 0x28: /* sub r/m8,reg8 */
case 0x30: /* xor r/m8,reg8 */
case 0x38: /* cmp r/m8,reg8 */
- mem = x86->modrm(cs + eip, x86, &inst_len);
- uc = instr_binary_byte(cs[eip]>>3, instr_read_byte(mem), *reg8(cs[eip + 1]>>3, x86), &EFLAGS);
- if (cs[eip]<0x38)
+ mem = x86->modrm(MEM_BASE32(cs + eip), x86, &inst_len);
+ uc = instr_binary_byte((*(unsigned char *)MEM_BASE32(cs + eip))>>3,
+ instr_read_byte(mem), *reg8((*(unsigned char *)MEM_BASE32(cs + eip + 1))>>3, x86), &EFLAGS);
+ if (*(unsigned char *)MEM_BASE32(cs + eip)<0x38)
instr_write_byte(mem, uc);
eip += 2 + inst_len; break;
@@ -1271,9 +1271,9 @@ static inline int instr_sim(x86_regs *x86, int pmode)
case 0x29: /* sub r/m16,reg16 */
case 0x31: /* xor r/m16,reg16 */
case 0x39: /* cmp r/m16,reg16 */
- mem = x86->modrm(cs + eip, x86, &inst_len);
- und = x86->instr_binary(cs[eip]>>3, x86->instr_read(mem), *reg(cs[eip + 1]>>3, x86), &EFLAGS);
- if (cs[eip]<0x38)
+ mem = x86->modrm(MEM_BASE32(cs + eip), x86, &inst_len);
+ und = x86->instr_binary(*(unsigned char *)MEM_BASE32(cs + eip)>>3, x86->instr_read(mem), *reg(*(unsigned char *)MEM_BASE32(cs + eip + 1)>>3, x86), &EFLAGS);
+ if (*(unsigned char *)MEM_BASE32(cs + eip)<0x38)
x86->instr_write(mem, und);
eip += 2 + inst_len; break;
@@ -1285,9 +1285,11 @@ static inline int instr_sim(x86_regs *x86, int pmode)
case 0x2a: /* sub reg8,r/m8 */
case 0x32: /* xor reg8,r/m8 */
case 0x3a: /* cmp reg8,r/m8 */
- reg_8 = reg8(cs[eip + 1]>>3, x86);
- uc = instr_binary_byte(cs[eip]>>3, *reg_8, instr_read_byte(x86->modrm(cs + eip, x86, &inst_len)), &EFLAGS);
- if (cs[eip]<0x38) *reg_8 = uc;
+ reg_8 = reg8(*(unsigned char *)MEM_BASE32(cs + eip + 1)>>3, x86);
+ uc = instr_binary_byte(*(unsigned char *)MEM_BASE32(cs + eip)>>3,
+ *reg_8, instr_read_byte(x86->modrm(MEM_BASE32(cs + eip),
+ x86, &inst_len)), &EFLAGS);
+ if (*(unsigned char *)MEM_BASE32(cs + eip)<0x38) *reg_8 = uc;
eip += 2 + inst_len; break;
case 0x03: /* add reg,r/m16 */
@@ -1298,9 +1300,11 @@ static inline int instr_sim(x86_regs *x86, int pmode)
case 0x2b: /* sub reg,r/m16 */
case 0x33: /* xor reg,r/m16 */
case 0x3b: /* cmp reg,r/m16 */
- dstreg = reg(cs[eip + 1]>>3, x86);
- und = x86->instr_binary(cs[eip]>>3, *dstreg, x86->instr_read(x86->modrm(cs + eip, x86, &inst_len)), &EFLAGS);
- if (cs[eip]<0x38) {
+ dstreg = reg(*(unsigned char *)MEM_BASE32(cs + eip + 1)>>3, x86);
+ und = x86->instr_binary(*(unsigned char *)MEM_BASE32(cs + eip)>>3,
+ *dstreg, x86->instr_read(x86->modrm(MEM_BASE32(cs + eip), x86,
+ &inst_len)), &EFLAGS);
+ if (*(unsigned char *)MEM_BASE32(cs + eip)<0x38) {
if (x86->operand_size == 2)
R_WORD(*dstreg) = und;
else
@@ -1316,8 +1320,9 @@ static inline int instr_sim(x86_regs *x86, int pmode)
case 0x2c: /* sub al,imm8 */
case 0x34: /* xor al,imm8 */
case 0x3c: /* cmp al,imm8 */
- uc = instr_binary_byte(cs[eip]>>3, AL, cs[eip + 1], &EFLAGS);
- if (cs[eip]<0x38) AL = uc;
+ uc = instr_binary_byte(*(unsigned char *)MEM_BASE32(cs + eip)>>3, AL,
+ *(unsigned char *)MEM_BASE32(cs + eip + 1), &EFLAGS);
+ if (*(unsigned char *)MEM_BASE32(cs + eip)<0x38) AL = uc;
eip += 2; break;
case 0x05: /* add ax,imm16 */
@@ -1328,12 +1333,13 @@ static inline int instr_sim(x86_regs *x86, int pmode)
case 0x2d: /* sub ax,imm16 */
case 0x35: /* xor ax,imm16 */
case 0x3d: /* cmp ax,imm16 */
- und = x86->instr_binary(cs[eip]>>3, x86->eax, R_DWORD(cs[eip + 1]), &EFLAGS);
+ und = x86->instr_binary(*(unsigned char *)MEM_BASE32(cs + eip)>>3,
+ x86->eax, R_DWORD(*(unsigned char *)MEM_BASE32(cs + eip + 1)), &EFLAGS);
if (x86->operand_size == 2) {
- if (cs[eip]<0x38) AX = und;
+ if (*(unsigned char *)MEM_BASE32(cs + eip)<0x38) AX = und;
eip += 3;
} else {
- if (cs[eip]<0x38) x86->eax = und;
+ if (*(unsigned char *)MEM_BASE32(cs + eip)<0x38) x86->eax = und;
eip += 5;
}
break;
@@ -1342,7 +1348,7 @@ static inline int instr_sim(x86_regs *x86, int pmode)
case 0x0e:
case 0x16:
case 0x1e:
- push(*sreg(cs[eip]>>3, x86), x86);
+ push(*sreg(*(unsigned char *)MEM_BASE32(cs + eip)>>3, x86), x86);
eip++; break;
case 0x07: /* pop es */
@@ -1350,8 +1356,8 @@ static inline int instr_sim(x86_regs *x86, int pmode)
return 0;
else {
pop(&x86->es, x86);
- REG(es) = x86->es;
- x86->es_base = SEG2LINEAR(x86->es);
+ REG(es) = x86->es;
+ x86->es_base = SEGOFF2LINEAR(x86->es, 0);
eip++;
}
break;
@@ -1365,7 +1371,7 @@ static inline int instr_sim(x86_regs *x86, int pmode)
else {
pop(&x86->ds, x86);
REG(ds) = x86->ds;
- x86->ds_base = SEG2LINEAR(x86->ds);
+ x86->ds_base = SEGOFF2LINEAR(x86->ds, 0);
x86->seg_base = x86->ds_base;
eip++;
}
@@ -1426,7 +1432,7 @@ static inline int instr_sim(x86_regs *x86, int pmode)
case 0x46:
case 0x47: /* inc reg */
EFLAGS &= ~(OF|ZF|SF|PF|AF);
- dstreg = reg(cs[eip], x86);
+ dstreg = reg(*(unsigned char *)MEM_BASE32(cs + eip), x86);
if (x86->operand_size == 2) {
OPandFLAG0(unl, incw, R_WORD(*dstreg), =r);
} else {
@@ -1444,7 +1450,7 @@ static inline int instr_sim(x86_regs *x86, int pmode)
case 0x4e:
case 0x4f: /* dec reg */
EFLAGS &= ~(OF|ZF|SF|PF|AF);
- dstreg = reg(cs[eip], x86);
+ dstreg = reg(*(unsigned char *)MEM_BASE32(cs + eip), x86);
if (x86->operand_size == 2) {
OPandFLAG0(unl, decw, R_WORD(*dstreg), =r);
} else {
@@ -1461,7 +1467,7 @@ static inline int instr_sim(x86_regs *x86, int pmode)
case 0x55:
case 0x56:
case 0x57: /* push reg */
- push(*reg(cs[eip],x86), x86);
+ push(*reg(*(unsigned char *)MEM_BASE32(cs + eip),x86), x86);
eip++; break;
case 0x58:
@@ -1474,18 +1480,18 @@ static inline int instr_sim(x86_regs *x86, int pmode)
case 0x5f: /* pop reg */
pop(&und, x86);
if (x86->operand_size == 2)
- R_WORD(*reg(cs[eip],x86)) = und;
+ R_WORD(*reg(*(unsigned char *)MEM_BASE32(cs + eip),x86)) = und;
else
- *reg(cs[eip],x86) = und;
+ *reg(*(unsigned char *)MEM_BASE32(cs + eip),x86) = und;
eip++; break;
/* 0x60 */
case 0x68: /* push imm16 */
- push(R_DWORD(cs[eip + 1]), x86);
+ push(R_DWORD(*(unsigned char *)MEM_BASE32(cs + eip + 1)), x86);
eip += x86->operand_size + 1; break;
case 0x6a: /* push imm8 */
- push((int)(signed char)cs[eip + 1], x86);
+ push((int)*(signed char *)MEM_BASE32(cs + eip + 1), x86);
eip += 2; break;
case 0x70: OP_JCC(EFLAGS & OF); /*jo*/
@@ -1507,51 +1513,58 @@ static inline int instr_sim(x86_regs *x86, int pmode)
case 0x80: /* logical r/m8,imm8 */
case 0x82:
- mem = x86->modrm(cs + eip, x86, &inst_len);
- uc = instr_binary_byte(cs[eip + 1]>>3, instr_read_byte(mem), cs[eip + 2 + inst_len], &EFLAGS);
- if ((cs[eip + 1]&0x38) < 0x38)
+ mem = x86->modrm(MEM_BASE32(cs + eip), x86, &inst_len);
+ uc = instr_binary_byte(*(unsigned char *)MEM_BASE32(cs + eip + 1)>>3,
+ instr_read_byte(mem), *(unsigned char *)MEM_BASE32(cs + eip + 2 + inst_len), &EFLAGS);
+ if ((*(unsigned char *)MEM_BASE32(cs + eip + 1)&0x38) < 0x38)
instr_write_byte(mem, uc);
eip += 3 + inst_len; break;
case 0x81: /* logical r/m,imm */
- mem = x86->modrm(cs + eip, x86, &inst_len);
- und = x86->instr_binary(cs[eip + 1]>>3, x86->instr_read(mem), R_DWORD(cs[eip + 2 + inst_len]), &EFLAGS);
- if ((cs[eip + 1]&0x38) < 0x38) x86->instr_write(mem, und);
+ mem = x86->modrm(MEM_BASE32(cs + eip), x86, &inst_len);
+ und = x86->instr_binary(*(unsigned char *)MEM_BASE32(cs + eip + 1)>>3,
+ x86->instr_read(mem), R_DWORD(*(unsigned char *)MEM_BASE32(cs + eip + 2 + inst_len)), &EFLAGS);
+ if ((*(unsigned char *)MEM_BASE32(cs + eip + 1)&0x38) < 0x38) x86->instr_write(mem, und);
eip += x86->operand_size + 2 + inst_len;
break;
case 0x83: /* logical r/m,imm8 */
- mem = x86->modrm(cs + eip, x86, &inst_len);
- und = x86->instr_binary(cs[eip + 1]>>3, x86->instr_read(mem), (int)(signed char)cs[eip + 2 + inst_len],
+ mem = x86->modrm(MEM_BASE32(cs + eip), x86, &inst_len);
+ und = x86->instr_binary(*(unsigned char *)MEM_BASE32(cs + eip + 1)>>3,
+ x86->instr_read(mem), (int)*(signed char *)MEM_BASE32(cs + eip + 2 + inst_len),
&EFLAGS);
- if ((cs[eip + 1]&0x38) < 0x38) x86->instr_write(mem, und);
+ if ((*(unsigned char *)MEM_BASE32(cs + eip + 1)&0x38) < 0x38)
+ x86->instr_write(mem, und);
eip += inst_len + 3; break;
case 0x84: /* test r/m8, reg8 */
- instr_flags(instr_read_byte(x86->modrm(cs + eip, x86, &inst_len)) & *reg8(cs[eip + 1]>>3,x86),
+ instr_flags(instr_read_byte(x86->modrm(MEM_BASE32(cs + eip), x86, &inst_len)) &
+ *reg8(*(unsigned char *)MEM_BASE32(cs + eip + 1)>>3,x86),
0x80, &EFLAGS);
eip += inst_len + 2; break;
case 0x85: /* test r/m16, reg */
if (x86->operand_size == 2)
- instr_flags(instr_read_word(x86->modrm(cs + eip, x86, &inst_len)) & R_WORD(*reg(cs[eip + 1]>>3,x86)),
+ instr_flags(instr_read_word(x86->modrm(MEM_BASE32(cs + eip), x86,
+ &inst_len)) & R_WORD(*reg(*(unsigned char *)MEM_BASE32(cs + eip + 1)>>3,x86)),
0x8000, &EFLAGS);
else
- instr_flags(instr_read_dword(x86->modrm(cs + eip, x86, &inst_len)) & *reg(cs[eip + 1]>>3,x86),
+ instr_flags(instr_read_dword(x86->modrm(MEM_BASE32(cs + eip), x86, &inst_len)) &
+ *reg(*(unsigned char *)MEM_BASE32(cs + eip + 1)>>3,x86),
0x80000000, &EFLAGS);
eip += inst_len + 2; break;
case 0x86: /* xchg r/m8,reg8 */
- reg_8 = reg8(cs[eip + 1]>>3, x86);
- mem = x86->modrm(cs + eip, x86, &inst_len);
+ reg_8 = reg8(*(unsigned char *)MEM_BASE32(cs + eip + 1)>>3, x86);
+ mem = x86->modrm(MEM_BASE32(cs + eip), x86, &inst_len);
uc = *reg_8;
*reg_8 = instr_read_byte(mem);
instr_write_byte(mem, uc);
eip += inst_len + 2; break;
case 0x87: /* xchg r/m16,reg */
- dstreg = reg(cs[eip + 1]>>3, x86);
- mem = x86->modrm(cs + eip, x86, &inst_len);
+ dstreg = reg(*(unsigned char *)MEM_BASE32(cs + eip + 1)>>3, x86);
+ mem = x86->modrm(MEM_BASE32(cs + eip), x86, &inst_len);
und = *dstreg;
if (x86->operand_size == 2)
R_WORD(*dstreg) = instr_read_word(mem);
@@ -1561,58 +1574,67 @@ static inline int instr_sim(x86_regs *x86, int pmode)
eip += inst_len + 2; break;
case 0x88: /* mov r/m8,reg8 */
- instr_write_byte(x86->modrm(cs + eip, x86, &inst_len), *reg8(cs[eip + 1]>>3, x86));
+ instr_write_byte(x86->modrm(MEM_BASE32(cs + eip), x86, &inst_len),
+ *reg8(*(unsigned char *)MEM_BASE32(cs + eip + 1)>>3, x86));
eip += inst_len + 2; break;
case 0x89: /* mov r/m16,reg */
- x86->instr_write(x86->modrm(cs + eip, x86, &inst_len), *reg(cs[eip + 1]>>3, x86));
+ x86->instr_write(x86->modrm(MEM_BASE32(cs + eip), x86, &inst_len),
+ *reg(*(unsigned char *)MEM_BASE32(cs + eip + 1)>>3, x86));
eip += inst_len + 2; break;
case 0x8a: /* mov reg8,r/m8 */
- *reg8(cs[eip + 1]>>3, x86) = instr_read_byte(x86->modrm(cs + eip, x86, &inst_len));
+ *reg8(*(unsigned char *)MEM_BASE32(cs + eip + 1)>>3, x86) =
+ instr_read_byte(x86->modrm(MEM_BASE32(cs + eip), x86, &inst_len));
eip += inst_len + 2; break;
case 0x8b: /* mov reg,r/m16 */
if (x86->operand_size == 2)
- R_WORD(*reg(cs[eip + 1]>>3, x86)) = instr_read_word(x86->modrm(cs + eip, x86, &inst_len));
+ R_WORD(*reg(*(unsigned char *)MEM_BASE32(cs + eip + 1)>>3, x86)) =
+ instr_read_word(x86->modrm(MEM_BASE32(cs + eip), x86, &inst_len));
else
- *reg(cs[eip + 1]>>3, x86) = instr_read_dword(x86->modrm(cs + eip, x86, &inst_len));
+ *reg(*(unsigned char *)MEM_BASE32(cs + eip + 1)>>3, x86) =
+ instr_read_dword(x86->modrm(MEM_BASE32(cs + eip), x86, &inst_len));
eip += inst_len + 2; break;
case 0x8c: /* mov r/m16,segreg */
- mem = x86->modrm(cs + eip, x86, &inst_len);
- if ((cs[eip + 1] & 0xc0) == 0xc0) /* compensate for mov r,segreg */
- mem = (unsigned char *)reg(cs[eip + 1], x86);
- instr_write_word(mem, *sreg(cs[eip + 1]>>3, x86));
+ mem = x86->modrm(MEM_BASE32(cs + eip), x86, &inst_len);
+ if ((*(unsigned char *)MEM_BASE32(cs + eip + 1) & 0xc0) == 0xc0) /* compensate for mov r,segreg */
+ mem = (unsigned char *)reg(*(unsigned char *)MEM_BASE32(cs + eip + 1), x86);
+ instr_write_word(mem, *sreg(*(unsigned char *)MEM_BASE32(cs + eip + 1)>>3, x86));
eip += inst_len + 2; break;
case 0x8d: /* lea */
- mem = x86->seg_ss_base;
+ {
+ unsigned mem = x86->seg_ss_base;
x86->seg_ss_base = x86->seg_base;
if (x86->operand_size == 2)
- R_WORD(*reg(cs[eip + 1]>>3,x86)) = x86->modrm(cs + eip, x86, &inst_len) - x86->seg_base;
+ R_WORD(*reg(*(unsigned char *)MEM_BASE32(cs + eip + 1)>>3,x86)) =
+ x86->modrm(MEM_BASE32(cs + eip), x86, &inst_len) - (unsigned char *)MEM_BASE32(x86->seg_base);
else
- *reg(cs[eip + 1]>>3,x86) = x86->modrm(cs + eip, x86, &inst_len) - x86->seg_base;
+ *reg(*(unsigned char *)MEM_BASE32(cs + eip + 1)>>3,x86) =
+ x86->modrm(MEM_BASE32(cs + eip), x86, &inst_len) - (unsigned char *)MEM_BASE32(x86->seg_base);
x86->seg_ss_base = mem;
eip += inst_len + 2; break;
+ }
case 0x8e: /* mov segreg,r/m16 */
if (pmode || x86->operand_size == 4)
return 0;
- else switch (cs[eip + 1]&0x38) {
+ else switch (*(unsigned char *)MEM_BASE32(cs + eip + 1)&0x38) {
case 0:
- mem = x86->modrm(cs + eip, x86, &inst_len);
- if ((cs[eip + 1] & 0xc0) == 0xc0) /* compensate for mov r,segreg */
- mem = (unsigned char *)reg(cs[eip + 1], x86);
+ mem = x86->modrm(MEM_BASE32(cs + eip), x86, &inst_len);
+ if ((*(unsigned char *)MEM_BASE32(cs + eip + 1) & 0xc0) == 0xc0) /* compensate for mov r,segreg */
+ mem = (unsigned char *)reg(*(unsigned char *)MEM_BASE32(cs + eip + 1), x86);
REG(es) = x86->es = instr_read_word(mem);
- x86->es_base = SEG2LINEAR(x86->es);
+ x86->es_base = SEGOFF2LINEAR(x86->es, 0);
eip += inst_len + 2; break;
case 0x18:
- mem = x86->modrm(cs + eip, x86, &inst_len);
- if ((cs[eip + 1] & 0xc0) == 0xc0) /* compensate for mov es,reg */
- mem = (unsigned char *)reg(cs[eip + 1], x86);
+ mem = x86->modrm(MEM_BASE32(cs + eip), x86, &inst_len);
+ if ((*(unsigned char *)MEM_BASE32(cs + eip + 1) & 0xc0) == 0xc0) /* compensate for mov es,reg */
+ mem = (unsigned char *)reg(*(unsigned char *)MEM_BASE32(cs + eip + 1), x86);
REG(ds) = x86->ds = instr_read_word(mem);
- x86->ds_base = SEG2LINEAR(x86->ds);
+ x86->ds_base = SEGOFF2LINEAR(x86->ds, 0);
x86->seg_base = x86->ds_base;
eip += inst_len + 2; break;
default:
@@ -1621,9 +1643,9 @@ static inline int instr_sim(x86_regs *x86, int pmode)
break;
case 0x8f: /*pop*/
- if ((cs[eip + 1]&0x38) == 0){
+ if ((*(unsigned char *)MEM_BASE32(cs + eip + 1)&0x38) == 0){
pop(&und, x86);
- x86->instr_write(x86->modrm(cs + eip, x86, &inst_len), und);
+ x86->instr_write(x86->modrm(MEM_BASE32(cs + eip), x86, &inst_len), und);
eip += inst_len + 2;
} else
return 0;
@@ -1638,7 +1660,7 @@ static inline int instr_sim(x86_regs *x86, int pmode)
case 0x95:
case 0x96:
case 0x97: /* xchg reg, ax */
- dstreg = reg(cs[eip],x86);
+ dstreg = reg(*(unsigned char *)MEM_BASE32(cs + eip),x86);
und = x86->eax;
if (x86->operand_size == 2) {
AX = *dstreg;
@@ -1669,11 +1691,11 @@ static inline int instr_sim(x86_regs *x86, int pmode)
else {
push(x86->cs, x86);
push(eip + 5, x86);
- x86->cs = R_WORD(cs[eip + 3]);
+ x86->cs = R_WORD(*(unsigned char *)MEM_BASE32(cs + eip + 3));
REG(cs) = x86->cs;
- x86->cs_base = SEG2LINEAR(x86->cs);
- eip = R_WORD(cs[eip + 1]);
- cs = (unsigned char *)x86->cs_base;
+ x86->cs_base = SEGOFF2LINEAR(x86->cs, 0);
+ eip = R_WORD(*(unsigned char *)MEM_BASE32(cs + eip + 1));
+ cs = x86->cs_base;
}
break;
/* NO: 0x9b wait 0x9c pushf 0x9d popf*/
@@ -1687,31 +1709,38 @@ static inline int instr_sim(x86_regs *x86, int pmode)
eip++; break;
case 0xa0: /* mov al,moff16 */
- AL = instr_read_byte((R_DWORD(cs[eip + 1]) & wordmask[x86->address_size])+x86->seg_base);
+ AL = instr_read_byte(MEM_BASE32((R_DWORD(*(unsigned char *)MEM_BASE32(cs + eip + 1)) &
+ wordmask[x86->address_size])+x86->seg_base));
eip += 1 + x86->address_size; break;
case 0xa1: /* mov ax,moff16 */
if (x86->operand_size == 2)
- AX = instr_read_word((R_DWORD(cs[eip + 1]) & wordmask[x86->address_size])+x86->seg_base);
+ AX = instr_read_word(MEM_BASE32((R_DWORD(*(unsigned char *)MEM_BASE32(cs + eip + 1)) &
+ wordmask[x86->address_size])+x86->seg_base));
else
- x86->eax = instr_read_dword((R_DWORD(cs[eip + 1]) & wordmask[x86->address_size])+x86->seg_base);
+ x86->eax = instr_read_dword(MEM_BASE32((R_DWORD(*(unsigned char *)MEM_BASE32(cs + eip + 1)) &
+ wordmask[x86->address_size])+x86->seg_base));
eip += 1 + x86->address_size; break;
case 0xa2: /* mov moff16,al */
- instr_write_byte((R_DWORD(cs[eip + 1]) & wordmask[x86->address_size])+x86->seg_base, AL);
+ instr_write_byte(MEM_BASE32((R_DWORD(*(unsigned char *)MEM_BASE32(cs + eip + 1)) &
+ wordmask[x86->address_size])+x86->seg_base), AL);
eip += 1 + x86->address_size; break;
case 0xa3: /* mov moff16,ax */
- x86->instr_write((R_DWORD(cs[eip + 1]) & wordmask[x86->address_size])+x86->seg_base, x86->eax);
+ x86->instr_write(MEM_BASE32((R_DWORD(*(unsigned char *)MEM_BASE32(cs + eip + 1)) &
+ wordmask[x86->address_size])+x86->seg_base), x86->eax);
eip += 1 + x86->address_size; break;
case 0xa4: /* movsb */
if (x86->address_size == 4) {
- instr_write_byte(x86->es_base + x86->edi, instr_read_byte(x86->seg_base + x86->esi));
+ instr_write_byte(MEM_BASE32(x86->es_base + x86->edi),
+ instr_read_byte(MEM_BASE32(x86->seg_base + x86->esi)));
x86->edi += loop_inc;
x86->esi += loop_inc;
} else {
- instr_write_byte(x86->es_base + DI, instr_read_byte(x86->seg_base + SI));
+ instr_write_byte(MEM_BASE32(x86->es_base + DI),
+ instr_read_byte(MEM_BASE32(x86->seg_base + SI)));
DI += loop_inc;
SI += loop_inc;
}
@@ -1719,12 +1748,14 @@ static inline int instr_sim(x86_regs *x86, int pmode)
case 0xa5: /* movsw */
if (x86->address_size == 4) {
- x86->instr_write(x86->es_base + x86->edi, x86->instr_read(x86->seg_base + x86->esi));
+ x86->instr_write(MEM_BASE32(x86->es_base + x86->edi),
+ x86->instr_read(MEM_BASE32(x86->seg_base + x86->esi)));
x86->edi += loop_inc * x86->operand_size;
x86->esi += loop_inc * x86->operand_size;
}
else {
- x86->instr_write(x86->es_base + DI, x86->instr_read(x86->seg_base + SI));
+ x86->instr_write(MEM_BASE32(x86->es_base + DI),
+ x86->instr_read(MEM_BASE32(x86->seg_base + SI)));
DI += loop_inc * x86->operand_size;
SI += loop_inc * x86->operand_size;
}
@@ -1732,13 +1763,13 @@ static inline int instr_sim(x86_regs *x86, int pmode)
case 0xa6: /*cmpsb */
if (x86->address_size == 4) {
- instr_binary_byte(7, instr_read_byte(x86->seg_base + x86->esi),
- instr_read_byte(x86->es_base + x86->edi), &EFLAGS);
+ instr_binary_byte(7, instr_read_byte(MEM_BASE32(x86->seg_base + x86->esi)),
+ instr_read_byte(MEM_BASE32(x86->es_base + x86->edi)), &EFLAGS);
x86->edi += loop_inc;
x86->esi += loop_inc;
} else {
- instr_binary_byte(7, instr_read_byte(x86->seg_base + SI),
- instr_read_byte(x86->es_base + DI), &EFLAGS);
+ instr_binary_byte(7, instr_read_byte(MEM_BASE32(x86->seg_base + SI)),
+ instr_read_byte(MEM_BASE32(x86->es_base + DI)), &EFLAGS);
DI += loop_inc;
SI += loop_inc;
}
@@ -1746,67 +1777,67 @@ static inline int instr_sim(x86_regs *x86, int pmode)
case 0xa7: /* cmpsw */
if (x86->address_size == 4) {
- x86->instr_binary(7, x86->instr_read(x86->seg_base + x86->esi),
- x86->instr_read(x86->es_base + x86->edi), &EFLAGS);
+ x86->instr_binary(7, x86->instr_read(MEM_BASE32(x86->seg_base + x86->esi)),
+ x86->instr_read(MEM_BASE32(x86->es_base + x86->edi)), &EFLAGS);
x86->edi += loop_inc * x86->operand_size;
x86->esi += loop_inc * x86->operand_size;
} else {
- x86->instr_binary(7, x86->instr_read(x86->seg_base + SI),
- x86->instr_read(x86->es_base + DI), &EFLAGS);
+ x86->instr_binary(7, x86->instr_read(MEM_BASE32(x86->seg_base + SI)),
+ x86->instr_read(MEM_BASE32(x86->es_base + DI)), &EFLAGS);
DI += loop_inc * x86->operand_size;
SI += loop_inc * x86->operand_size;
}
eip++; break;
case 0xa8: /* test al, imm */
- instr_flags(AL & cs[eip + 1], 0x80, &EFLAGS);
+ instr_flags(AL & *(unsigned char *)MEM_BASE32(cs + eip + 1), 0x80, &EFLAGS);
eip += 2; break;
case 0xa9: /* test ax, imm */
if (x86->operand_size == 2) {
- instr_flags(AX & R_WORD(cs[eip + 1]), 0x8000, &EFLAGS);
+ instr_flags(AX & R_WORD(*(unsigned char *)MEM_BASE32(cs + eip + 1)), 0x8000, &EFLAGS);
eip += 3; break;
} else {
- instr_flags(x86->eax & R_DWORD(cs[eip + 1]), 0x80000000, &EFLAGS);
+ instr_flags(x86->eax & R_DWORD(*(unsigned char *)MEM_BASE32(cs + eip + 1)), 0x80000000, &EFLAGS);
eip += 5; break;
}
case 0xaa: /* stosb */
if (x86->address_size == 4) {
- instr_write_byte(x86->es_base + x86->edi, AL);
+ instr_write_byte(MEM_BASE32(x86->es_base + x86->edi), AL);
x86->edi += loop_inc;
} else {
- instr_write_byte(x86->es_base + DI, AL);
+ instr_write_byte(MEM_BASE32(x86->es_base + DI), AL);
DI += loop_inc;
}
eip++; break;
case 0xab: /* stosw */
if (x86->address_size == 4) {
- x86->instr_write(x86->es_base + x86->edi, x86->eax);
+ x86->instr_write(MEM_BASE32(x86->es_base + x86->edi), x86->eax);
x86->edi += loop_inc * x86->operand_size;
} else {
- x86->instr_write(x86->es_base + DI, x86->eax);
+ x86->instr_write(MEM_BASE32(x86->es_base + DI), x86->eax);
DI += loop_inc * x86->operand_size;
}
eip++; break;
case 0xac: /* lodsb */
if (x86->address_size == 4) {
- AL = instr_read_byte(x86->seg_base + x86->esi);
+ AL = instr_read_byte(MEM_BASE32(x86->seg_base + x86->esi));
x86->esi += loop_inc;
} else {
- AL = instr_read_byte(x86->seg_base + SI);
+ AL = instr_read_byte(MEM_BASE32(x86->seg_base + SI));
SI += loop_inc;
}
eip++; break;
case 0xad: /* lodsw */
if (x86->address_size == 4) {
- und = x86->instr_read(x86->seg_base + x86->esi);
+ und = x86->instr_read(MEM_BASE32(x86->seg_base + x86->esi));
x86->esi += loop_inc * x86->operand_size;
} else {
- und = x86->instr_read(x86->seg_base + SI);
+ und = x86->instr_read(MEM_BASE32(x86->seg_base + SI));
SI += loop_inc * x86->operand_size;
}
if (x86->operand_size == 2)
@@ -1817,20 +1848,20 @@ static inline int instr_sim(x86_regs *x86, int pmode)
case 0xae: /* scasb */
if (x86->address_size == 4) {
- instr_binary_byte(7, AL, instr_read_byte(x86->es_base + x86->edi), &EFLAGS);
+ instr_binary_byte(7, AL, instr_read_byte(MEM_BASE32(x86->es_base + x86->edi)), &EFLAGS);
x86->edi += loop_inc;
} else {
- instr_binary_byte(7, AL, instr_read_byte(x86->es_base + DI), &EFLAGS);
+ instr_binary_byte(7, AL, instr_read_byte(MEM_BASE32(x86->es_base + DI)), &EFLAGS);
DI += loop_inc;
}
eip++; break;
case 0xaf: /* scasw */
if (x86->address_size == 4) {
- x86->instr_binary(7, x86->eax, x86->instr_read(x86->es_base + x86->edi), &EFLAGS);
+ x86->instr_binary(7, x86->eax, x86->instr_read(MEM_BASE32(x86->es_base + x86->edi)), &EFLAGS);
x86->edi += loop_inc * x86->operand_size;
} else {
- x86->instr_binary(7, x86->eax, x86->instr_read(x86->es_base + DI), &EFLAGS);
+ x86->instr_binary(7, x86->eax, x86->instr_read(MEM_BASE32(x86->es_base + DI)), &EFLAGS);
DI += loop_inc * x86->operand_size;
}
eip++; break;
@@ -1843,7 +1874,7 @@ static inline int instr_sim(x86_regs *x86, int pmode)
case 0xb5:
case 0xb6:
case 0xb7:
- *reg8(cs[eip], x86) = cs[eip + 1];
+ *reg8(*(unsigned char *)MEM_BASE32(cs + eip), x86) = *(unsigned char *)MEM_BASE32(cs + eip + 1);
eip += 2; break;
case 0xb8:
@@ -1855,37 +1886,39 @@ static inline int instr_sim(x86_regs *x86, int pmode)
case 0xbe:
case 0xbf:
if (x86->operand_size == 2) {
- R_WORD(*reg(cs[eip], x86)) = R_WORD(cs[eip + 1]);
+ R_WORD(*reg(*(unsigned char *)MEM_BASE32(cs + eip), x86)) =
+ R_WORD(*(unsigned char *)MEM_BASE32(cs + eip + 1));
eip += 3; break;
} else {
- *reg(cs[eip], x86) = R_DWORD(cs[eip + 1]);
+ *reg(*(unsigned char *)MEM_BASE32(cs + eip), x86) =
+ R_DWORD(*(unsigned char *)MEM_BASE32(cs + eip + 1));
eip += 5; break;
}
case 0xc0: /* shift byte, imm8 */
- if ((cs[eip + 1]&0x38)==0x30) return 0;
- mem = x86->modrm(cs + eip, x86, &inst_len);
- instr_write_byte(mem,instr_shift(cs[eip + 1]>>3, (signed char) instr_read_byte(mem),
- cs[eip + 2+inst_len], 1, &EFLAGS));
+ if ((*(unsigned char *)MEM_BASE32(cs + eip + 1)&0x38)==0x30) return 0;
+ mem = x86->modrm(MEM_BASE32(cs + eip), x86, &inst_len);
+ instr_write_byte(mem,instr_shift(*(unsigned char *)MEM_BASE32(cs + eip + 1)>>3, (signed char) instr_read_byte(mem),
+ *(unsigned char *)MEM_BASE32(cs + eip + 2+inst_len), 1, &EFLAGS));
eip += inst_len + 3; break;
case 0xc1: /* shift word, imm8 */
- if ((cs[eip + 1]&0x38)==0x30) return 0;
- mem = x86->modrm(cs + eip, x86, &inst_len);
+ if ((*(unsigned char *)MEM_BASE32(cs + eip + 1)&0x38)==0x30) return 0;
+ mem = x86->modrm(MEM_BASE32(cs + eip), x86, &inst_len);
if (x86->operand_size == 2)
- instr_write_word(mem, instr_shift(cs[eip + 1]>>3, (short)instr_read_word(mem),
- cs[eip + 2+inst_len], 2, &EFLAGS));
+ instr_write_word(mem, instr_shift(*(unsigned char *)MEM_BASE32(cs + eip + 1)>>3, (short)instr_read_word(mem),
+ *(unsigned char *)MEM_BASE32(cs + eip + 2+inst_len), 2, &EFLAGS));
else
- instr_write_dword(mem, instr_shift(cs[eip + 1]>>3, instr_read_dword(mem),
- cs[eip + 2+inst_len], 4, &EFLAGS));
+ instr_write_dword(mem, instr_shift(*(unsigned char *)MEM_BASE32(cs + eip + 1)>>3, instr_read_dword(mem),
+ *(unsigned char *)MEM_BASE32(cs + eip + 2+inst_len), 4, &EFLAGS));
eip += inst_len + 3; break;
case 0xc2: /* ret imm16*/
pop(&und, x86);
if (x86->_32bit)
- x86->esp += R_WORD(cs[eip + 1]);
+ x86->esp += R_WORD(*(unsigned char *)MEM_BASE32(cs + eip + 1));
else
- SP += R_WORD(cs[eip + 1]);
+ SP += R_WORD(*(unsigned char *)MEM_BASE32(cs + eip + 1));
eip = und;
break;
@@ -1897,11 +1930,11 @@ static inline int instr_sim(x86_regs *x86, int pmode)
if (pmode || x86->operand_size == 4)
... 478 lines suppressed ...
hooks/post-receive
--
dosemu
|
|
From: Stas S. <st...@us...> - 2014-06-29 14:16:17
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "dosemu".
The branch, devel has been updated
via 81c389dec3339b97acedcaca823f98275f181d52 (commit)
via 4f4324fbe1df9dddd3bbcd12f5740a89c70909cc (commit)
via de2357fbad51219e8d526ed387e96201bba26f83 (commit)
via 6e343ad95640c679b6004c475b0c4a4d636841dc (commit)
via 6c142d4d4d5f572c6d6f951c013220a6dbf8030a (commit)
from fdc9e06239b69f5f85ff2f383fb5756e86edcaa3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/dosemu/code/ci/81c389dec3339b97acedcaca823f98275f181d52
commit 81c389dec3339b97acedcaca823f98275f181d52
Author: Stas Sergeev <st...@us...>
Date: Sun Jun 29 15:52:32 2014 +0400
yet more SEL_ADR_CLNT
diff --git a/src/dosext/dpmi/msdos.c b/src/dosext/dpmi/msdos.c
index cd85c15..0075278 100644
--- a/src/dosext/dpmi/msdos.c
+++ b/src/dosext/dpmi/msdos.c
@@ -701,15 +701,15 @@ int msdos_pre_extender(struct sigcontext_struct *scp, int intr)
prepare_ems_frame();
REG(ds) = seg;
REG(esi) = 0;
- MEMCPY_DOS2DOS(SEGOFF2LINEAR(REG(ds), LWORD(esi)),
- GetSegmentBase(_ds) + D_16_32(_esi),
+ MEMCPY_2DOS(SEGOFF2LINEAR(REG(ds), LWORD(esi)),
+ SEL_ADR_CLNT(_ds, _esi),
0x30);
seg += 3;
REG(es) = seg;
REG(ebp) = 0;
- MEMCPY_DOS2DOS(SEGOFF2LINEAR(REG(es), LWORD(ebp)),
- GetSegmentBase(_es) + D_16_32(_ebp),
+ MEMCPY_2DOS(SEGOFF2LINEAR(REG(es), LWORD(ebp)),
+ SEL_ADR_CLNT(_es, _ebp),
0x60);
}
return 0;
@@ -739,14 +739,14 @@ int msdos_pre_extender(struct sigcontext_struct *scp, int intr)
seg = TRANS_BUFFER_SEG;
REG(ds) = seg;
REG(esi) = 0;
- MEMCPY_DOS2DOS(SEGOFF2LINEAR(REG(ds), LWORD(esi)),
- GetSegmentBase(_ds) + D_16_32(_esi),
+ MEMCPY_2DOS(SEGOFF2LINEAR(REG(ds), LWORD(esi)),
+ SEL_ADR_CLNT(_ds, _esi),
0x100);
seg += 0x10;
REG(es) = seg;
REG(edi) = 0;
- MEMCPY_DOS2DOS(SEGOFF2LINEAR(REG(es), LWORD(edi)),
- GetSegmentBase(_es) + D_16_32(_edi),
+ MEMCPY_2DOS(SEGOFF2LINEAR(REG(es), LWORD(edi)),
+ SEL_ADR_CLNT(_es, _edi),
0x100);
return 0;
}
@@ -756,8 +756,8 @@ int msdos_pre_extender(struct sigcontext_struct *scp, int intr)
prepare_ems_frame();
REG(ds) = seg;
REG(esi) = 0;
- MEMCPY_DOS2DOS(SEGOFF2LINEAR(REG(ds), LWORD(esi)),
- GetSegmentBase(_ds) + D_16_32(_esi),
+ MEMCPY_2DOS(SEGOFF2LINEAR(REG(ds), LWORD(esi)),
+ SEL_ADR_CLNT(_ds, _esi),
0x100);
seg += 0x10;
REG(es) = seg;
@@ -783,8 +783,8 @@ int msdos_pre_extender(struct sigcontext_struct *scp, int intr)
prepare_ems_frame();
REG(es) = TRANS_BUFFER_SEG;
REG(edi) = 0;
- MEMCPY_DOS2DOS(SEGOFF2LINEAR(REG(es), LWORD(edi)),
- GetSegmentBase(_es) + D_16_32(_edi),
+ MEMCPY_2DOS(SEGOFF2LINEAR(REG(es), LWORD(edi)),
+ SEL_ADR_CLNT(_es, _edi),
_LWORD(ecx));
break;
case 1 ... 7:
@@ -797,8 +797,8 @@ int msdos_pre_extender(struct sigcontext_struct *scp, int intr)
prepare_ems_frame();
REG(ds) = TRANS_BUFFER_SEG;
REG(edx) = 0;
- MEMCPY_DOS2DOS(SEGOFF2LINEAR(REG(ds), LWORD(edx)),
- GetSegmentBase(_ds) + D_16_32(_edx),
+ MEMCPY_2DOS(SEGOFF2LINEAR(REG(ds), LWORD(edx)),
+ SEL_ADR_CLNT(_ds, _edx),
_LWORD(ecx));
break;
case 0x22:
@@ -839,8 +839,8 @@ int msdos_pre_extender(struct sigcontext_struct *scp, int intr)
prepare_ems_frame();
REG(es) = TRANS_BUFFER_SEG;
REG(edi) = 0;
- MEMCPY_DOS2DOS(SEGOFF2LINEAR(REG(es), LWORD(edi)),
- GetSegmentBase(_es) + D_16_32(_edi),
+ MEMCPY_2DOS(SEGOFF2LINEAR(REG(es), LWORD(edi)),
+ SEL_ADR_CLNT(_es, _edi),
0x13e);
return 0;
case 0x47: /* get cur dir */
@@ -899,8 +899,8 @@ int msdos_pre_extender(struct sigcontext_struct *scp, int intr)
prepare_ems_frame();
REG(es) = TRANS_BUFFER_SEG;
REG(edx) = 0;
- MEMCPY_DOS2DOS(SEGOFF2LINEAR(REG(es), LWORD(edx)),
- GetSegmentBase(_es) + D_16_32(_edx),
+ MEMCPY_2DOS(SEGOFF2LINEAR(REG(es), LWORD(edx)),
+ SEL_ADR_CLNT(_es, _edx),
16);
return 0;
case 0x0c: /* set call back */
@@ -1051,17 +1051,17 @@ int msdos_post_extender(struct sigcontext_struct *scp, int intr)
case 0x16: /* Create usring FCB */
case 0x17: /* rename using FCB */
PRESERVE1(edx);
- MEMCPY_DOS2DOS(GetSegmentBase(_ds) + D_16_32(_edx),
+ MEMCPY_2UNIX(SEL_ADR_CLNT(_ds, _edx),
SEGOFF2LINEAR(REG(ds), LWORD(edx)), 0x50);
break;
case 0x29: /* Parse a file name for FCB */
PRESERVE2(esi, edi);
- MEMCPY_DOS2DOS(GetSegmentBase(_ds) + D_16_32(_esi),
+ MEMCPY_2UNIX(SEL_ADR_CLNT(_ds, _esi),
/* Warning: SI altered, assume old value = 0, don't touch. */
SEGOFF2LINEAR(REG(ds), 0), 0x100);
SET_REG(esi, _esi + LWORD(esi));
- MEMCPY_DOS2DOS(GetSegmentBase(_es) + D_16_32(_edi),
+ MEMCPY_2UNIX(SEL_ADR_CLNT(_es, _edi),
SEGOFF2LINEAR(REG(es), LWORD(edi)), 0x50);
break;
@@ -1131,8 +1131,8 @@ int msdos_post_extender(struct sigcontext_struct *scp, int intr)
if (LWORD(eflags) & CF)
break;
/* FreeDOS copies only 0x18 bytes */
- MEMCPY_DOS2DOS(GetSegmentBase(_ds) +
- D_16_32(_edx), SEGOFF2LINEAR(REG(ds), LWORD(edx)), 0x18);
+ MEMCPY_2UNIX(SEL_ADR_CLNT(_ds, _edx),
+ SEGOFF2LINEAR(REG(ds), LWORD(edx)), 0x18);
}
break;
case 0x47: /* get CWD */
@@ -1168,7 +1168,7 @@ int msdos_post_extender(struct sigcontext_struct *scp, int intr)
break;
case 0x53: /* Generate Drive Parameter Table */
PRESERVE2(esi, ebp);
- MEMCPY_DOS2DOS(GetSegmentBase(_es) + D_16_32(_ebp),
+ MEMCPY_2UNIX(SEL_ADR_CLNT(_es, _ebp),
SEGOFF2LINEAR(REG(es), LWORD(ebp)),
0x60);
break ;
@@ -1200,20 +1200,17 @@ int msdos_post_extender(struct sigcontext_struct *scp, int intr)
break ;
case 2 ... 6:
PRESERVE2(esi, edi);
- MEMCPY_DOS2DOS(GetSegmentBase(_ds)
- + D_16_32(_esi),
+ MEMCPY_2UNIX(SEL_ADR_CLNT(_ds, _esi),
SEGOFF2LINEAR(REG(ds), LWORD(esi)),
0x100);
- MEMCPY_DOS2DOS(GetSegmentBase(_es)
- + D_16_32(_edi),
+ MEMCPY_2UNIX(SEL_ADR_CLNT(_es, _edi),
SEGOFF2LINEAR(REG(es), LWORD(edi)),
0x100);
}
break;
case 0x60: /* Canonicalize file name */
PRESERVE2(esi, edi);
- MEMCPY_DOS2DOS(GetSegmentBase(_es)
- + D_16_32(_edi),
+ MEMCPY_2UNIX(SEL_ADR_CLNT(_es, _edi),
SEGOFF2LINEAR(REG(es), LWORD(edi)),
0x80);
break;
@@ -1223,15 +1220,13 @@ int msdos_post_extender(struct sigcontext_struct *scp, int intr)
break;
switch (_LO(ax)) {
case 1 ... 7:
- MEMCPY_DOS2DOS(GetSegmentBase(_es)
- + D_16_32(_edi),
+ MEMCPY_2UNIX(SEL_ADR_CLNT(_es, _edi),
SEGOFF2LINEAR(REG(es), LWORD(edi)),
LWORD(ecx));
break;
case 0x21:
case 0xa1:
- MEMCPY_DOS2DOS(GetSegmentBase(_ds)
- + D_16_32(_edx),
+ MEMCPY_2UNIX(SEL_ADR_CLNT(_ds, _edx),
SEGOFF2LINEAR(REG(ds), LWORD(edx)),
_LWORD(ecx));
break;
@@ -1256,8 +1251,7 @@ int msdos_post_extender(struct sigcontext_struct *scp, int intr)
PRESERVE1(edi);
if (LWORD(eflags) & CF)
break;
- MEMCPY_DOS2DOS(GetSegmentBase(_es)
- + D_16_32(_edi),
+ MEMCPY_2UNIX(SEL_ADR_CLNT(_es, _edi),
SEGOFF2LINEAR(REG(es), LWORD(edi)),
0x13E);
break;
@@ -1289,8 +1283,8 @@ int msdos_post_extender(struct sigcontext_struct *scp, int intr)
PRESERVE1(edx);
if (LWORD(eflags) & CF)
break;
- MEMCPY_DOS2DOS(GetSegmentBase(_ds) +
- D_16_32(_edx), SEGOFF2LINEAR(REG(ds), LWORD(edx)), 0x34);
+ MEMCPY_2UNIX(SEL_ADR_CLNT(_ds, _edx),
+ SEGOFF2LINEAR(REG(ds), LWORD(edx)), 0x34);
break;
};
http://sourceforge.net/p/dosemu/code/ci/4f4324fbe1df9dddd3bbcd12f5740a89c70909cc
commit 4f4324fbe1df9dddd3bbcd12f5740a89c70909cc
Author: Stas Sergeev <st...@us...>
Date: Sun Jun 29 15:40:28 2014 +0400
more SEL_ADR_CLNT
diff --git a/src/base/async/int.c b/src/base/async/int.c
index 99f244b..8648cb7 100644
--- a/src/base/async/int.c
+++ b/src/base/async/int.c
@@ -78,7 +78,7 @@ static int int33(void);
typedef int interrupt_function_t(void);
static interrupt_function_t *interrupt_function[0x100][2];
-static unsigned int dos_io_buffer;
+static char *dos_io_buffer;
static int dos_io_buffer_size = 0;
/* set if some directories are mounted during startup */
@@ -482,7 +482,7 @@ int dos_helper(void)
unsigned int size = REG(ecx);
unsigned int dos_ptr = SEGOFF2LINEAR(REG(ds), LWORD(edx));
if (offs + size <= dos_io_buffer_size)
- MEMCPY_DOS2DOS(dos_io_buffer + offs, dos_ptr, size);
+ MEMCPY_2UNIX(dos_io_buffer + offs, dos_ptr, size);
break;
}
@@ -491,7 +491,7 @@ int dos_helper(void)
unsigned int size = REG(ecx);
unsigned int dos_ptr = SEGOFF2LINEAR(REG(ds), LWORD(edx));
if (offs + size <= dos_io_buffer_size)
- MEMCPY_DOS2DOS(dos_ptr, dos_io_buffer + offs, size);
+ MEMCPY_2DOS(dos_ptr, dos_io_buffer + offs, size);
break;
}
@@ -2471,7 +2471,7 @@ void do_periodic_stuff(void)
update_xtitle();
}
-void set_io_buffer(unsigned int ptr, unsigned int size)
+void set_io_buffer(char *ptr, unsigned int size)
{
dos_io_buffer = ptr;
dos_io_buffer_size = size;
diff --git a/src/dosext/dpmi/msdos.c b/src/dosext/dpmi/msdos.c
index 050fb4d..cd85c15 100644
--- a/src/dosext/dpmi/msdos.c
+++ b/src/dosext/dpmi/msdos.c
@@ -678,7 +678,7 @@ int msdos_pre_extender(struct sigcontext_struct *scp, int intr)
}
break;
case 0x3f: /* dos read */
- set_io_buffer(GetSegmentBase(_ds) + D_16_32(_edx),
+ set_io_buffer(SEL_ADR_CLNT(_ds, _edx),
D_16_32(_ecx));
prepare_ems_frame();
REG(ds) = TRANS_BUFFER_SEG;
@@ -687,7 +687,7 @@ int msdos_pre_extender(struct sigcontext_struct *scp, int intr)
fake_call_to(DOS_LONG_READ_SEG, DOS_LONG_READ_OFF);
return MSDOS_ALT_ENT;
case 0x40: /* DOS Write */
- set_io_buffer(GetSegmentBase(_ds) + D_16_32(_edx),
+ set_io_buffer(SEL_ADR_CLNT(_ds, _edx),
D_16_32(_ecx));
prepare_ems_frame();
REG(ds) = TRANS_BUFFER_SEG;
diff --git a/src/include/int.h b/src/include/int.h
index 7f63706..82fd822 100644
--- a/src/include/int.h
+++ b/src/include/int.h
@@ -48,7 +48,7 @@ int dos_helper(void);
void do_periodic_stuff(void);
-void set_io_buffer(unsigned int ptr, unsigned int size);
+void set_io_buffer(char *ptr, unsigned int size);
void unset_io_buffer(void);
void int42_hook(void);
http://sourceforge.net/p/dosemu/code/ci/de2357fbad51219e8d526ed387e96201bba26f83
commit de2357fbad51219e8d526ed387e96201bba26f83
Author: Stas Sergeev <st...@us...>
Date: Sun Jun 29 15:35:25 2014 +0400
more SEL_ADR_CLNT
diff --git a/src/dosext/dpmi/msdos.c b/src/dosext/dpmi/msdos.c
index 5283b5e..050fb4d 100644
--- a/src/dosext/dpmi/msdos.c
+++ b/src/dosext/dpmi/msdos.c
@@ -529,8 +529,8 @@ int msdos_pre_extender(struct sigcontext_struct *scp, int intr)
prepare_ems_frame();
REG(ds) = TRANS_BUFFER_SEG;
REG(edx) = 0;
- MEMCPY_DOS2DOS(SEGOFF2LINEAR(REG(ds), LWORD(edx)),
- GetSegmentBase(_ds) + D_16_32(_edx),
+ MEMCPY_2DOS(SEGOFF2LINEAR(REG(ds), LWORD(edx)),
+ SEL_ADR_CLNT(_ds, _edx),
0x50);
return 0;
case 0x29: /* Parse a file name for FCB */
@@ -539,14 +539,14 @@ int msdos_pre_extender(struct sigcontext_struct *scp, int intr)
prepare_ems_frame();
REG(ds) = seg;
REG(esi) = 0;
- MEMCPY_DOS2DOS(SEGOFF2LINEAR(REG(ds), LWORD(esi)),
- GetSegmentBase(_ds) + D_16_32(_esi),
+ MEMCPY_2DOS(SEGOFF2LINEAR(REG(ds), LWORD(esi)),
+ SEL_ADR_CLNT(_ds, _esi),
0x100);
seg += 0x10;
REG(es) = seg;
REG(edi) = 0;
- MEMCPY_DOS2DOS(SEGOFF2LINEAR(REG(es), LWORD(edi)),
- GetSegmentBase(_es) + D_16_32(_edi),
+ MEMCPY_2DOS(SEGOFF2LINEAR(REG(es), LWORD(edi)),
+ SEL_ADR_CLNT(_es, _edi),
0x50);
}
return 0;
@@ -573,14 +573,14 @@ int msdos_pre_extender(struct sigcontext_struct *scp, int intr)
/* must copy parameter block */
REG(es) = segment;
REG(ebx) = 0;
- MEMCPY_DOS2DOS(SEGOFF2LINEAR(REG(es), LWORD(ebx)),
- GetSegmentBase(_es) + D_16_32(_ebx), 0x20);
+ MEMCPY_2DOS(SEGOFF2LINEAR(REG(es), LWORD(ebx)),
+ SEL_ADR_CLNT(_es, _ebx), 0x20);
segment += 2;
#if 0
/* now the envrionment segment */
sel = READ_WORD(SEGOFF2LINEAR(REG(es), LWORD(ebx)));
WRITE_WORD(SEGOFF2LINEAR(REG(es), LWORD(ebx)), segment);
- MEMCPY_DOS2DOS(SEGOFF2LINEAR(segment, 0), /* 4K envr. */
+ MEMCPY_2DOS(SEGOFF2LINEAR(segment, 0), /* 4K envr. */
GetSegmentBase(sel),
0x1000);
segment += 0x100;
@@ -592,8 +592,8 @@ int msdos_pre_extender(struct sigcontext_struct *scp, int intr)
sel = READ_WORD(SEGOFF2LINEAR(REG(es), LWORD(ebx)+4));
WRITE_WORD(SEGOFF2LINEAR(REG(es), LWORD(ebx)+4), segment);
WRITE_WORD(SEGOFF2LINEAR(REG(es), LWORD(ebx)+2), 0);
- MEMCPY_DOS2DOS(SEGOFF2LINEAR(segment, 0),
- GetSegmentBase(sel) + off,
+ MEMCPY_2DOS(SEGOFF2LINEAR(segment, 0),
+ SEL_ADR_CLNT(sel, off),
0x80);
segment += 8;
http://sourceforge.net/p/dosemu/code/ci/6e343ad95640c679b6004c475b0c4a4d636841dc
commit 6e343ad95640c679b6004c475b0c4a4d636841dc
Author: Stas Sergeev <st...@us...>
Date: Sun Jun 29 15:05:16 2014 +0400
use SEL_ADR in more places
Still a lot to replace in msdos.c... :(
diff --git a/src/dosext/dpmi/dpmi.c b/src/dosext/dpmi/dpmi.c
index 3e353d3..a14b447 100644
--- a/src/dosext/dpmi/dpmi.c
+++ b/src/dosext/dpmi/dpmi.c
@@ -3706,9 +3706,7 @@ int dpmi_fault(struct sigcontext_struct *scp)
in_dpmi_dos_int = 1;
} else if (_eip==1+DPMI_SEL_OFF(DPMI_save_restore_pm)) {
- unsigned int buf = GetSegmentBase(_es) +
- (Segments[_es>>3].is_32 ? _edi : LO_WORD(_edi));
- unsigned short *buffer = LINEAR2UNIX(buf);
+ unsigned short *buffer = SEL_ADR_LDT(_es, _edi, Segments[_es>>3].is_32);
if (_LO(ax)==0) {
D_printf("DPMI: save real mode registers\n");
// e_invalidate(buf, (9+6)*sizeof(*buffer));
@@ -4336,14 +4334,13 @@ void dpmi_realmode_hlt(unsigned int lina)
in_dpmi_dos_int = 0;
} else if (lina == DPMI_ADD + HLT_OFF(DPMI_return_from_realmode)) {
- unsigned rmreg_addr = GetSegmentBase(_es) + API_16_32(_edi);
- struct RealModeCallStructure *rmreg = LINEAR2UNIX(rmreg_addr);
+ struct RealModeCallStructure *rmreg = SEL_ADR_X(_es, _edi);
D_printf("DPMI: Return from Real Mode Procedure\n");
#ifdef SHOWREGS
show_regs(__FILE__, __LINE__);
#endif
- e_invalidate(rmreg_addr, sizeof(*rmreg));
+// e_invalidate(rmreg, sizeof(*rmreg));
rmreg->edi = REG(edi);
rmreg->esi = REG(esi);
rmreg->ebp = REG(ebp);
diff --git a/src/dosext/dpmi/msdos.c b/src/dosext/dpmi/msdos.c
index 2ea9e97..5283b5e 100644
--- a/src/dosext/dpmi/msdos.c
+++ b/src/dosext/dpmi/msdos.c
@@ -42,7 +42,7 @@
#define TRANS_BUFFER_SEG EMM_SEGMENT
#define EXEC_SEG (MSDOS_CLIENT.lowmem_seg + EXEC_Para_ADD)
-#define DTA_over_1MB (GetSegmentBase(MSDOS_CLIENT.user_dta_sel) + MSDOS_CLIENT.user_dta_off)
+#define DTA_over_1MB (SEL_ADR(MSDOS_CLIENT.user_dta_sel, MSDOS_CLIENT.user_dta_off))
#define DTA_under_1MB SEGOFF2LINEAR(MSDOS_CLIENT.lowmem_seg + DTA_Para_ADD, 0)
#define MAX_DOS_PATH 260
@@ -355,7 +355,7 @@ int msdos_pre_extender(struct sigcontext_struct *scp, int intr)
switch (_HI(ax)) { /* functions use DTA */
case 0x11: case 0x12: /* find first/next using FCB */
case 0x4e: case 0x4f: /* find first/next */
- MEMCPY_DOS2DOS(DTA_under_1MB, DTA_over_1MB, 0x80);
+ MEMCPY_2DOS(DTA_under_1MB, DTA_over_1MB, 0x80);
break;
}
}
@@ -506,7 +506,7 @@ int msdos_pre_extender(struct sigcontext_struct *scp, int intr)
MSDOS_CLIENT.user_dta_off = off;
REG(ds) = MSDOS_CLIENT.lowmem_seg+DTA_Para_ADD;
REG(edx)=0;
- MEMCPY_DOS2DOS(DTA_under_1MB, DTA_over_1MB, 0x80);
+ MEMCPY_2DOS(DTA_under_1MB, DTA_over_1MB, 0x80);
} else {
REG(ds) = GetSegmentBase(_ds) >> 4;
MSDOS_CLIENT.user_dta_sel = 0;
@@ -981,7 +981,7 @@ int msdos_post_extender(struct sigcontext_struct *scp, int intr)
switch (_HI(ax)) { /* functions use DTA */
case 0x11: case 0x12: /* find first/next using FCB */
case 0x4e: case 0x4f: /* find first/next */
- MEMCPY_DOS2DOS(DTA_over_1MB, DTA_under_1MB, 0x80);
+ MEMCPY_2UNIX(DTA_over_1MB, DTA_under_1MB, 0x80);
break;
}
}
http://sourceforge.net/p/dosemu/code/ci/6c142d4d4d5f572c6d6f951c013220a6dbf8030a
commit 6c142d4d4d5f572c6d6f951c013220a6dbf8030a
Author: Stas Sergeev <st...@us...>
Date: Sun Jun 29 14:31:08 2014 +0400
coopth: move dosemu_sleep() out of do_run_thread()
This avoids nesting if signal handler also runs thread (like from leavedos())
diff --git a/src/base/misc/coopth.c b/src/base/misc/coopth.c
index 281100d..7c82f63 100644
--- a/src/base/misc/coopth.c
+++ b/src/base/misc/coopth.c
@@ -135,8 +135,6 @@ static enum CoopthRet do_run_thread(struct coopth_t *thr,
pth->state = COOPTHS_AWAKEN;
break;
case COOPTH_WAIT:
- if (pth->data.attached)
- dosemu_sleep();
pth->state = COOPTHS_AWAKEN;
break;
case COOPTH_SLEEP:
@@ -305,6 +303,8 @@ again:
tret = do_run_thread(thr, pth);
thread_running--;
joinable_running = jr;
+ if (tret == COOPTH_WAIT && pth->data.attached)
+ dosemu_sleep();
if (tret == COOPTH_SLEEP || tret == COOPTH_WAIT ||
tret == COOPTH_YIELD) {
if (pth->data.sleep.func) {
-----------------------------------------------------------------------
Summary of changes:
src/base/async/int.c | 8 ++--
src/base/misc/coopth.c | 4 +-
src/dosext/dpmi/dpmi.c | 9 +---
src/dosext/dpmi/msdos.c | 104 ++++++++++++++++++++++-------------------------
src/include/int.h | 2 +-
5 files changed, 59 insertions(+), 68 deletions(-)
hooks/post-receive
--
dosemu
|
|
From: Stas S. <st...@us...> - 2014-06-29 03:01:23
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "dosemu".
The branch, devel has been updated
via fdc9e06239b69f5f85ff2f383fb5756e86edcaa3 (commit)
via 9a5dce39f7e1b82484311ab8681e299c6cac0ac2 (commit)
via 61fd6b09947bfddf2ffb36ccd64606192abd98ee (commit)
via 7019be85d3252d77f88aa05e44d0c3e6ebe15cdf (commit)
from 60f132566ce18afdd6e10ce0ee270f76da0dbd55 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/dosemu/code/ci/fdc9e06239b69f5f85ff2f383fb5756e86edcaa3
commit fdc9e06239b69f5f85ff2f383fb5756e86edcaa3
Author: Stas Sergeev <st...@us...>
Date: Sun Jun 29 06:56:59 2014 +0400
do waitpid() in SIGCHLD handler for timidity
diff --git a/src/arch/linux/async/signal.c b/src/arch/linux/async/signal.c
index 9b3cc04..176a659 100644
--- a/src/arch/linux/async/signal.c
+++ b/src/arch/linux/async/signal.c
@@ -396,7 +396,8 @@ static void cleanup_child(void *arg)
pid2 = waitpid(pid, &status, WNOHANG);
if (pid2 != pid)
return;
- chld_hndl[i].handler();
+ if (chld_hndl[i].handler)
+ chld_hndl[i].handler();
}
/* this cleaning up is necessary to avoid the port server becoming
diff --git a/src/plugin/midimisc/mid_o_tmdty.c b/src/plugin/midimisc/mid_o_tmdty.c
index 46a5797..2ca6f1b 100644
--- a/src/plugin/midimisc/mid_o_tmdty.c
+++ b/src/plugin/midimisc/mid_o_tmdty.c
@@ -182,6 +182,8 @@ static int midotmdty_preinit(void)
close(tmdty_pipe_in[1]);
ctrl_sock_in = tmdty_pipe_in[0];
ctrl_sock_out = tmdty_pipe_out[1];
+ /* no handler, default handler does waitpid() */
+ sigchld_register_handler(tmdty_pid, NULL);
return TRUE;
@@ -252,12 +254,10 @@ static int midotmdty_detect(void)
}
if (!ret) {
+ sigchld_enable_handler(tmdty_pid, 0);
close(data_sock);
close(ctrl_sock_out);
- if (tmdty_pid != -1) {
- waitpid(tmdty_pid, &status, 0);
- tmdty_pid = -1;
- }
+ waitpid(tmdty_pid, &status, 0);
}
return ret;
@@ -338,16 +338,14 @@ static void midotmdty_done(void)
shutdown(data_sock, 2);
close(data_sock);
}
+ sigchld_enable_handler(tmdty_pid, 0);
write(ctrl_sock_out, cmd2, strlen(cmd2));
n = read(ctrl_sock_in, buf, sizeof(buf) - 1);
buf[n] = 0;
S_printf("\tQuit: %s\n", buf);
close(ctrl_sock_out);
- if (tmdty_pid != -1) {
- waitpid(tmdty_pid, &status, 0);
- tmdty_pid = -1;
- }
+ waitpid(tmdty_pid, &status, 0);
}
static void midotmdty_reset(void)
@@ -370,8 +368,6 @@ static void midotmdty_reset(void)
static void midotmdty_write(Bit8u val)
{
- if (tmdty_pid == -1)
- return;
send(data_sock, &val, 1, MSG_DONTWAIT);
}
http://sourceforge.net/p/dosemu/code/ci/9a5dce39f7e1b82484311ab8681e299c6cac0ac2
commit 9a5dce39f7e1b82484311ab8681e299c6cac0ac2
Author: Stas Sergeev <st...@us...>
Date: Sun Jun 29 06:30:45 2014 +0400
fix race in nested signal handling
Before allowing the nested signal we need to restore segment registers.
So set all signals initially to blocked, and unblock only when it is safe.
diff --git a/src/arch/linux/async/signal.c b/src/arch/linux/async/signal.c
index 6f7e819..9b3cc04 100644
--- a/src/arch/linux/async/signal.c
+++ b/src/arch/linux/async/signal.c
@@ -103,8 +103,9 @@ dosemu_sigaction_wrapper(int sig, void *fun, int flags)
sigset_t mask;
sa.sa_flags = flags;
- sigemptyset(&mask);
- addset_signals_that_queue(&mask);
+ /* initially block all signals. The handler will unblock some
+ * when it is safe (after segment registers are restored) */
+ sigfillset(&mask);
sa.sa_mask = mask;
if (sa.sa_flags & SA_ONSTACK) {
@@ -249,7 +250,7 @@ int check_fix_fs_gs_base(unsigned char prefix)
expects. That means restoring fs and gs for vm86 (necessary for
2.4 kernels) and fs, gs and eflags for DPMI. */
__attribute__((no_instrument_function))
-void init_handler(struct sigcontext_struct *scp)
+static void __init_handler(struct sigcontext_struct *scp)
{
/*
* FIRST thing to do in signal handlers - to avoid being trapped into int0x11
@@ -330,6 +331,25 @@ void init_handler(struct sigcontext_struct *scp)
loadregister(gs, eflags_fs_gs.gs);
}
+__attribute__((no_instrument_function))
+void init_handler(struct sigcontext_struct *scp)
+{
+ /* All signals are initially blocked.
+ * We need to restore registers before unblocking signals.
+ * Otherwise the nested signal handler will restore the registers
+ * and return; the current signal handler will then save the wrong
+ * registers.
+ * Note: in 64bit mode some segment registers are neither saved nor
+ * restored by the signal dispatching code in kernel, so we have
+ * to restore them by hands.
+ */
+ sigset_t mask;
+ __init_handler(scp);
+ sigemptyset(&mask);
+ addset_signals_that_queue(&mask);
+ sigprocmask(SIG_SETMASK, &mask, NULL);
+}
+
static int ld_sig;
static void leavedos_call(void *arg)
{
http://sourceforge.net/p/dosemu/code/ci/61fd6b09947bfddf2ffb36ccd64606192abd98ee
commit 61fd6b09947bfddf2ffb36ccd64606192abd98ee
Author: Stas Sergeev <st...@us...>
Date: Sun Jun 29 05:03:32 2014 +0400
add dpmi awareness for SIGCHLD and SIGTERM handlers
diff --git a/src/arch/linux/async/signal.c b/src/arch/linux/async/signal.c
index 0856566..6f7e819 100644
--- a/src/arch/linux/async/signal.c
+++ b/src/arch/linux/async/signal.c
@@ -388,6 +388,7 @@ static void sig_child(int sig, siginfo_t *si, void *uc)
(struct sigcontext_struct *)&((ucontext_t *)uc)->uc_mcontext;
init_handler(scp);
SIGNAL_save(cleanup_child, &si->si_pid, sizeof(si->si_pid), __func__);
+ dpmi_iret_setup(scp);
}
__attribute__((no_instrument_function))
@@ -406,6 +407,8 @@ static void leavedos_signal(int sig)
g_printf("Interrupting active signal handlers\n");
in_handle_signals = 0;
}
+ /* process it now */
+ handle_signals();
}
/* Silly Interrupt Generator Initialization/Closedown */
http://sourceforge.net/p/dosemu/code/ci/7019be85d3252d77f88aa05e44d0c3e6ebe15cdf
commit 7019be85d3252d77f88aa05e44d0c3e6ebe15cdf
Author: Stas Sergeev <st...@us...>
Date: Sun Jun 29 04:11:20 2014 +0400
coopth: re-introduce coopth_leave()
Same as coopth_detach() but is allowed to be called from main thread.
diff --git a/src/base/misc/coopth.c b/src/base/misc/coopth.c
index 8f84344..281100d 100644
--- a/src/base/misc/coopth.c
+++ b/src/base/misc/coopth.c
@@ -823,6 +823,15 @@ void coopth_detach(void)
switch_state(COOPTH_DETACH);
}
+/* same as coopth_detach(), but is allowed to be called from main thr
+ * (in which case it just returns) */
+void coopth_leave(void)
+{
+ if (!_coopth_is_in_thread_nowarn())
+ return;
+ coopth_detach();
+}
+
static void do_awake(struct coopth_per_thread_t *pth)
{
assert(pth->state == COOPTHS_SLEEPING);
diff --git a/src/include/coopth.h b/src/include/coopth.h
index d3d13c3..233f018 100644
--- a/src/include/coopth.h
+++ b/src/include/coopth.h
@@ -40,7 +40,7 @@ void coopth_sleep(void);
void coopth_sched(void);
void coopth_detach(void);
void coopth_attach(void);
-#define coopth_leave() coopth_detach()
+void coopth_leave(void);
void coopth_exit(void);
void coopth_wake_up(int tid);
void coopth_asleep(int tid);
-----------------------------------------------------------------------
Summary of changes:
src/arch/linux/async/signal.c | 32 ++++++++++++++++++++++++++++----
src/base/misc/coopth.c | 9 +++++++++
src/include/coopth.h | 2 +-
src/plugin/midimisc/mid_o_tmdty.c | 16 ++++++----------
4 files changed, 44 insertions(+), 15 deletions(-)
hooks/post-receive
--
dosemu
|
|
From: Stas S. <st...@us...> - 2014-06-28 21:08:06
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "dosemu".
The branch, devel has been updated
via 60f132566ce18afdd6e10ce0ee270f76da0dbd55 (commit)
from 33bbad869dc75ecb1758cd1c3517350baa6bc0bf (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/dosemu/code/ci/60f132566ce18afdd6e10ce0ee270f76da0dbd55
commit 60f132566ce18afdd6e10ce0ee270f76da0dbd55
Author: Stas Sergeev <st...@us...>
Date: Sun Jun 29 01:05:14 2014 +0400
mouse: fix right button release detection [sf bug #543]
Add missing break statement
diff --git a/src/base/mouse/mouse.c b/src/base/mouse/mouse.c
index e377b34..fb841b0 100644
--- a/src/base/mouse/mouse.c
+++ b/src/base/mouse/mouse.c
@@ -1272,6 +1272,7 @@ mouse_brelinfo(void)
mouse.rrcount = 0;
LWORD(ecx) = mouse.rrx;
LWORD(edx) = mouse.rry;
+ break;
case 2: /* middle button */
LWORD(ebx) = mouse.mrcount;
-----------------------------------------------------------------------
Summary of changes:
src/base/mouse/mouse.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
hooks/post-receive
--
dosemu
|
|
From: Stas S. <st...@us...> - 2014-06-19 15:14:15
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "dosemu".
The branch, devel has been updated
via 33bbad869dc75ecb1758cd1c3517350baa6bc0bf (commit)
from d83ac1806cd91f75c56a7cf917c110abdab19805 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/dosemu/code/ci/33bbad869dc75ecb1758cd1c3517350baa6bc0bf
commit 33bbad869dc75ecb1758cd1c3517350baa6bc0bf
Author: hanzlik <ha...@fr...>
Date: Wed Jun 18 03:56:48 2014 +0200
extended debug for int21 0x4B load/exec
with minor editing by stsp
diff --git a/src/base/async/int.c b/src/base/async/int.c
index 8a1c981..99f244b 100644
--- a/src/base/async/int.c
+++ b/src/base/async/int.c
@@ -420,7 +420,7 @@ int dos_helper(void)
}
case DOS_HELPER_RUN_UNIX:
- g_printf("Running Unix Command\n");
+ g_printf("Running Unix Command:%s\n",SEG_ADR((char *), es, dx));
run_unix_command(SEG_ADR((char *), es, dx));
break;
@@ -1291,15 +1291,26 @@ static int msdos(void)
char cmdname[256];
char *cmd = SEG_ADR((char*), ds, dx);
char *str = cmd;
+ struct param4a *pa4 = SEG_ADR((struct param4a *), es, bx);
+ struct lowstring *args = FARt_PTR(pa4->cmdline);
+ if (LO(ax) != 3) { /* AL=03h:load overlay have no cmdline in EPB */
+ strncpy(cmdname, args->s, args->len);
+ cmdname[args->len] = 0;
+ } else {
+ strncpy(cmdname, cmd, sizeof(cmdname) - 1);
+ cmdname[sizeof(cmdname) - 1] = 0;
+ }
+ if (debug_level('D') > 2) {
+ if (LO(ax) != 3)
+ ds_printf("INT21 4B: load/execute program=\"%s\", L(cmdline=\"%s\")=%i\n", str, cmdname, args->len);
+ else
+ ds_printf("INT21 4B: load overlay=\"%s\"\n", str);
+ }
#if WINDOWS_HACKS
if ((ptr = strstrDOS(cmd, "\\SYSTEM\\DOSX.EXE")) ||
(ptr = strstrDOS(cmd, "\\SYSTEM\\WIN386.EXE"))) {
- struct param4a *pa4 = SEG_ADR((struct param4a *), es, bx);
- struct lowstring *args = FARt_PTR(pa4->cmdline);
int have_args = 0;
- strncpy(cmdname, args->s, args->len);
- cmdname[args->len] = 0;
tmp_ptr = strstr(cmdname, "krnl386");
if (!tmp_ptr)
tmp_ptr = strstr(cmdname, "krnl286");
-----------------------------------------------------------------------
Summary of changes:
src/base/async/int.c | 21 ++++++++++++++++-----
1 files changed, 16 insertions(+), 5 deletions(-)
hooks/post-receive
--
dosemu
|
|
From: Stas S. <st...@us...> - 2014-06-17 10:41:17
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "dosemu".
The branch, devel has been updated
via d83ac1806cd91f75c56a7cf917c110abdab19805 (commit)
from 3b7a5ef951db17630f1c55b6117c19458e8b0106 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/dosemu/code/ci/d83ac1806cd91f75c56a7cf917c110abdab19805
commit d83ac1806cd91f75c56a7cf917c110abdab19805
Author: Stas Sergeev <st...@us...>
Date: Tue Jun 17 14:38:58 2014 +0400
fix regression of recent commit 4b7bbe04eb [sf #540]
diff --git a/src/dosext/mfs/util.c b/src/dosext/mfs/util.c
index 659c981..74404c8 100644
--- a/src/dosext/mfs/util.c
+++ b/src/dosext/mfs/util.c
@@ -146,7 +146,9 @@ static BOOL strnequalDOS(const char *name, const char *upname, int len)
for (n = name, un = upname; *n && *un && len; n++, un++, len--)
if (toupperDOS((unsigned char)*n) != (unsigned char)*un)
return FALSE;
- return TRUE;
+ if (!len || (! *n && ! *un))
+ return TRUE;
+ return FALSE;
}
BOOL strequalDOS(const char *name, const char *upname)
-----------------------------------------------------------------------
Summary of changes:
src/dosext/mfs/util.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
hooks/post-receive
--
dosemu
|
|
From: Stas S. <st...@us...> - 2014-06-13 12:33:26
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "dosemu".
The branch, devel has been updated
via 3b7a5ef951db17630f1c55b6117c19458e8b0106 (commit)
from a027b6d7a8985e9fbf387e3d368158c0b4057963 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/dosemu/code/ci/3b7a5ef951db17630f1c55b6117c19458e8b0106
commit 3b7a5ef951db17630f1c55b6117c19458e8b0106
Author: Stas Sergeev <st...@us...>
Date: Fri Jun 13 16:32:15 2014 +0400
copth: remove risky assert
diff --git a/src/base/misc/coopth.c b/src/base/misc/coopth.c
index e05a444..8f84344 100644
--- a/src/base/misc/coopth.c
+++ b/src/base/misc/coopth.c
@@ -789,7 +789,8 @@ void coopth_sleep(void)
static void ensure_single(struct coopth_thrdata_t *thdata)
{
struct coopth_t *thr = &coopthreads[*thdata->tid];
- assert(thr->cur_thr == 1);
+ if (thr->cur_thr != 1)
+ dosemu_error("coopth: nested=%i (expected 1)\n", thr->cur_thr);
}
void coopth_attach(void)
-----------------------------------------------------------------------
Summary of changes:
src/base/misc/coopth.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
hooks/post-receive
--
dosemu
|