A few years ago I wrote a patch to dosemu to use virtual modems. I'm
unable to make it work under the current releases of dosemu. Is someone
able to help me update my diff to work better with the current dosemu?
I'll attach the diff as a attachment.
Julie
--
[ Julia Anne Case ] [ Ships are safe inside the harbor, ]
[Programmer at large] [ but is that what ships are really for. ]
[ Admining Linux ] [ To thine own self be true. ]
[ Windows/WindowsNT ] [ Fair is where you take your cows to be judged. ]
diff -ru dosemu/src/base/init/lexer.l dosemu-0.63.1.33/src/base/init/lexer.l
--- dosemu/src/base/init/lexer.l Sat Jun 8 11:28:51 1996
+++ dosemu-0.63.1.33/src/base/init/lexer.l Thu Jun 13 16:02:00 1996
@@ -147,6 +147,7 @@
baudrate return(BAUDRATE);
device return(DEVICE);
com return(COM);
+virtual return(VIRTUAL);
/* lock file stuff */
directory return(DIRECTORY);
diff -ru dosemu/src/base/init/parser.y dosemu-0.63.1.33/src/base/init/parser.y
--- dosemu/src/base/init/parser.y Sun Jun 9 14:08:28 1996
+++ dosemu-0.63.1.33/src/base/init/parser.y Thu Jun 13 16:05:23 1996
@@ -60,6 +60,7 @@
static int c_hdisks = 0;
static int c_fdisks = 0;
+extern int no_local_video;
extern struct printer lpt[NUM_PRINTERS];
static struct printer *pptr;
static struct printer nullptr;
@@ -152,7 +153,7 @@
/* lock files */
%token DIRECTORY NAMESTUB BINARY
/* serial */
-%token BASE IRQ INTERRUPT DEVICE CHARSET BAUDRATE
+%token BASE IRQ INTERRUPT DEVICE CHARSET BAUDRATE VIRTUAL
/* mouse */
%token MICROSOFT LOGITECH MMSERIES MOUSEMAN HITACHI MOUSESYSTEMS BUSMOUSE PS2
%token INTERNALDRIVER EMULATE3BUTTONS CLEARDTR
@@ -612,6 +613,9 @@
| serial_flags serial_flag
;
serial_flag : DEVICE STRING { strcpy(sptr->dev, $2); free($2); }
+ | VIRTUAL { sptr->virtual = TRUE;
+ no_local_video = 1;
+ strcpy(sptr->dev, ttyname(0)); }
| COM INTEGER { sptr->real_comport = $2;
com_port_used[$2] = 1; }
| BASE INTEGER { sptr->base_port = $2; }
@@ -1009,6 +1013,7 @@
sptr->real_comport = 0;
sptr->fd = -1;
sptr->mouse = 0;
+ sptr->virtual = FALSE;
}
}
diff -ru dosemu/src/base/serial/ser_init.c dosemu-0.63.1.33/src/base/serial/ser_init.c
--- dosemu/src/base/serial/ser_init.c Sat Mar 2 13:26:47 1996
+++ dosemu-0.63.1.33/src/base/serial/ser_init.c Thu Jun 13 16:26:31 1996
@@ -54,6 +54,8 @@
#include "serial.h"
#include "ser_defs.h"
+int no_local_video = 0;
+
/* See README.serial file for more information on the com[] structure
* The declarations for this is in ../include/serial.h
*/
@@ -206,18 +208,29 @@
if (com[num].fd != -1) return (com[num].fd);
- if ( tty_lock(com[num].dev, 1) >= 0) { /* Lock port */
- /* We know that we have access to the serial port */
- com[num].dev_locked = TRUE;
-
- /* If the port is used for a mouse, then remove lockfile, because
- * the use of the mouse serial port can be switched between processes,
- * such as on Linux virtual consoles.
- */
- if (com[num].mouse)
- if (tty_lock(com[num].dev, 0) >= 0) /* Unlock port */
- com[num].dev_locked = FALSE;
+ if ( com[num].virtual )
+ {
+ if (tty_lock(com[num].dev, 0) >= 0)
+ {
+ dbug_printf("Opening Virtual Port\n");
+ com[num].dev_locked = FALSE;
+ com[num].fd = 0;
+ no_local_video = 1;
+ }
}
+ else
+ if ( tty_lock(com[num].dev, 1) >= 0) { /* Lock port */
+ /* We know that we have access to the serial port */
+ com[num].dev_locked = TRUE;
+
+ /* If the port is used for a mouse, then remove lockfile, because
+ * the use of the mouse serial port can be switched between processes,
+ * such as on Linux virtual consoles.
+ */
+ if (com[num].mouse)
+ if (tty_lock(com[num].dev, 0) >= 0) /* Unlock port */
+ com[num].dev_locked = FALSE;
+ }
else {
/* The port is in use by another process! Don't touch the port! */
com[num].dev_locked = FALSE;
@@ -497,8 +510,10 @@
/* Pull down DTR and RTS. This is the most natural for most comm */
/* devices including mice so that DTR rises during mouse init. */
- data = TIOCM_DTR | TIOCM_RTS;
- ioctl(com[num].fd, TIOCMBIC, &data);
+ if(!com[num].fd, TIOCMBIC, &data) {
+ data = TIOCM_DTR | TIOCM_RTS;
+ ioctl(com[num].fd, TIOCMBIC, &data);
+ }
}
diff -ru dosemu/src/base/serial/ser_irq.c dosemu-0.63.1.33/src/base/serial/ser_irq.c
--- dosemu/src/base/serial/ser_irq.c Sun Feb 4 19:03:24 1996
+++ dosemu-0.63.1.33/src/base/serial/ser_irq.c Thu Jun 13 16:15:46 1996
@@ -210,10 +210,16 @@
ioctl(com[num].fd, TIOCMGET, &control); /* WARNING: Non re-entrant! */
- newmsr = convert_bit(control, TIOCM_CTS, UART_MSR_CTS) |
- convert_bit(control, TIOCM_DSR, UART_MSR_DSR) |
- convert_bit(control, TIOCM_RNG, UART_MSR_RI) |
- convert_bit(control, TIOCM_CAR, UART_MSR_DCD);
+ if(com[num].virtual)
+ newmsr = UART_MSR_CTS |
+ convert_bit(control, TIOCM_DSR, UART_MSR_DSR) |
+ convert_bit(control, TIOCM_RNG, UART_MSR_RI) |
+ UART_MSR_DCD;
+ else
+ newmsr = convert_bit(control, TIOCM_CTS, UART_MSR_CTS) |
+ convert_bit(control, TIOCM_DSR, UART_MSR_DSR) |
+ convert_bit(control, TIOCM_RNG, UART_MSR_RI) |
+ convert_bit(control, TIOCM_CAR, UART_MSR_DCD);
delta = msr_compute_delta_bits(com[num].MSR, newmsr);
diff -ru dosemu/src/env/video/terminal.c dosemu-0.63.1.33/src/env/video/terminal.c
--- dosemu/src/env/video/terminal.c Sat Jan 27 15:49:32 1996
+++ dosemu-0.63.1.33/src/env/video/terminal.c Thu Jun 13 16:24:06 1996
@@ -59,6 +59,8 @@
* 001 000 Underline
* anything else is invalid.
*/
+extern int no_local_video;
+
static int BW_Attribute_Map[256];
static int Color_Attribute_Map[256];
@@ -180,8 +182,12 @@
rotate[4] = 1; rotate[5] = 5;
rotate[6] = 3; rotate[7] = 7;
- Video_term.update_screen = slang_update;
-
+ if(no_local_video!=1) {
+ Video_term.update_screen = slang_update;
+ }
+ else
+ Video_term.update_screen = NULL;
+
SLang_Exit_Error_Hook = sl_exit_error;
SLtt_get_terminfo ();
diff -ru dosemu/src/include/serial.h dosemu-0.63.1.33/src/include/serial.h
--- dosemu/src/include/serial.h Sun Feb 4 19:03:25 1996
+++ dosemu-0.63.1.33/src/include/serial.h Thu Jun 13 16:01:04 1996
@@ -56,6 +56,7 @@
int real_comport; /* The actual COMx port number. 0 for invalid */
int base_port; /* Base port address handled by device */
int interrupt; /* IRQ line handled by device */
+ boolean virtual; /* virtual modem */
boolean mouse; /* Flag to turn on mouse sharing features */
boolean dev_locked; /* Flag to indicate that device is locked */
boolean fossil_active; /* Flag: FOSSIL emulation active */
[Patch for dosemu-0.63.1.33 (should work with 0.63.1.19 also]
I'm not much of a documentation writer so if all this doesn't make sense
feel free to write me at [EMAIL PROTECTED] for more info. I wanted a
better way of running doors than in local mode via dosemu. And this is what
I managed to do to fix that problem.
This patch will allow you to add an additional keyword to the serial
configuration in dosemu.conf. The 'virtual' flag will allow you to set the
current tty that dosemu is running on to be a virtual modem. For things to
work right you need to make the following changes in your dosemu.conf file.
1. Remove all video definitions but the terminal. This forces terminal
mode. Which we need to avoid local video.
2. add serial { virtual com 1 } this makes the current tty COM1
Now when you run an dosemu it will only display the data that is going to
the COM port. A DOS door can be run in remote mode vs. the local mode that
we have all been running them in. On bug that I've found is that on a
non-modem tty the speed defaults to 2400 baud. I tried to change this in
dosemu, but it really didn't work. What I did find that works though is to
get down X00v150.ZIP. X00 is a very good fossil, which some doors will
need, beyond that though it has a utility called XU.EXE that lets you set
the port speed, I call this from autoexec and set the port speed to 57600
and everything works fine.
This should allow for RIPScrip doors to be run, but at present my testing
has show the acceptance of my terminal being RIP compatable to be less than
reliable. I'm not sure what is causing that. I'll keep looking at it
though.
I've run the following doors via this mode.
1. Solar Realms Elite
2. Barren Realms Elite
3. Falcons Eye
4. Global Wars
5. Terra Firma
6. Legend of the Red Dragon
7. Exitilus
[Change Log]
29Jan96 First Release (DosEMU-0.60.3)
30Jan96 Fix for Carrier detect on actual modem lines
12Jun96 Updated for 0.63.1.33 release of DosEMU