Boris Reisig wrote:
1) To get rid splash screen "Now type ENTER to start DOSEMU" and automatically start dosemu without hitting a key.
"dosemu -quiet" or don't use the dosemu startup script at all.
3) To be able to turn a comport into a telnet port. This would be perfect for BBS software if I could turn the com ports into telnetYou probably mean a TCP port here.
ports.
For example. If I connect to my box on port (for example) 5000, Dosemu would redirect that as com1, port 5001 would be com2, etc. Any chance of this?
This might be very easy as dosemu (since very recently) can use a pseudo-terminals as a serial ports. I've just tried one possibility that came to my mind first (example of redirecting COM2 to TCP port 5000 as I see it, follows):
1. Wrote a small program "datacopy" (attached). [Duh, something like that might be somewhere among the generic Unix utilities, so I am sure I've reinvented the wheel by writing it. Can anyone point me the analog of such a prog?]
2. Configured dosemu to use a pseudo-terminal as a serial port: $_com2="/dev/ttyp1"
3. Started the TCP port listener that way: faucet 5000 --in --out datacopy /dev/ptyp1 (note the difference between "ttyp1" in step 2 and "ptyp1" here)
4. Opened a connection to that port with a telnet: telnet localhost 5000
5. Started dosemu.
6. Started the terminal program on COM2 and got the communication between the DOS terminal prog and the telnet session to ensure that the port is redirected successfully.
"faucet" is from a "netpipes" package, but you can also set up the [x]inetd for that work (but using faucet is simpler).
I have never used that for anything real so I don't know how good it suits the real life needs. If that works for someone here, or if something is still missing, or if there is a better solution, please let me know. I think the current documentation doesn't have a clear solution for that, so it must be worked out and documented.
#include <stdio.h> #include <fcntl.h> #include <unistd.h> #include <sys/time.h> #include <sys/types.h>
int main(int argc, char *argv[])
{
char buf[1600];
int f,l;
fd_set fds;
if(argc < 2) {
printf("Usage: datacopy file_name\n");
return 1;
}
f = open(argv[1], O_RDWR);
while(1){
FD_ZERO(&fds);
FD_SET(STDIN_FILENO, &fds);
FD_SET(f, &fds);
select(f + 1, &fds, NULL, NULL, NULL);
if( FD_ISSET(f, &fds) ) {
l = read(f,buf,sizeof(buf));
if (l <= 0)
break;
write(STDOUT_FILENO,buf,l);
}
if( FD_ISSET(STDIN_FILENO, &fds) ) {
l = read(STDIN_FILENO,buf,sizeof(buf));
if (l <= 0)
break;
write(f,buf,l);
}
}
return 0;
}
