Skip to contentSkip to conversation

DOSEMU, CGI, Perl, Apache

DISCUSSION Brian Hancock 2 participants 2 messages Nov 15, 2005

lore
Share & tools
lore
#0 lore raw

Hi,

I am new to this mailing list.

I am wanting to revitalise an old DOS application for use as a web application. I can run the application under DOSEMU as a normal user, but am not sure how to run it from a CGI script.

I am using Perl and as a simplifcation I am trying the following:

system("dosemu.bin -D-a -I 'keystroke \"\rlredir d:
/home/web1/cgi-bin/dos\rd:\rmyprog.exe\rexitemu\r\'"")

or something very similar...

Firstly I am using lredir to create a d: drive mapped to a Linux folder, change to that drive, run myprog.exe and then exitemu.

When I access the script from a remote browser I get the " The Linux DOSEMU, Copyright (C) 2003 the 'DOSEMU-Development-Team'. This program is
distributed ... Enter 'yes' to confirm/continue: " message and that is
all..

There is no output from myprog.exe.

So I know the dosemu is trying to execute...

The server log file shows an error:
can't create local /home/www/web1/.dosemu directory
and
can't create local /home/www/web1/.dosemu/run directory

How do you run DOSEMU and DOS applications under CGI?

Thanks
Brian

#1 lore raw
Quoted 4 lines · Brian Hancock

I am using Perl and as a simplifcation I am trying the following:

system("dosemu.bin -D-a -I 'keystroke \"\rlredir d:
/home/web1/cgi-bin/dos\rd:\rmyprog.exe\rexitemu\r\'"")

You need to have
video{none}
as part of the -I options to get rid of all the terminal escape codes if you'd like to parse the DOS program output.

Quoted 6 lines

So I know the dosemu is trying to execute...

The server log file shows an error:
can't create local /home/www/web1/.dosemu directory
and
can't create local /home/www/web1/.dosemu/run directory

Permission problems most likely.
The user that runs the script and dosemu needs at least write permissions to $HOME/.dosemu. Here you have $HOME=/home/www/web1, but that's just your setup. You could pre-create the $HOME/.dosemu directory (as root), and then change the owner and permissions of this directory.

Or you could just first run dosemu as the /home/www/web1 owner interactively, so it sets up the necessary pseudo c-drive interactively; after that use

dosemu -quiet -dumb /home/www/web1/cgi-bin/dos/myprog.exe

(autoexec.bat's unix command executes myprog.exe, and exits).

Bart