Problem running DOS command from WordPerfect 6.2

Developer's Forum, for discussion of bugs, code, and other developmental aspects of DOSBox.

Problem running DOS command from WordPerfect 6.2

Postby emendelson » 2011-10-09 @ 05:16

This question has nothing to do with games or anything that DOSBox is designed to do, so I am not asking the developers to take any interest in it. I hope some expert users might be curious about the problem I describe.

I have a project, based on DOSBox SVN with a few custom patches provided by the helpful people here, which runs WordPerfect for DOS 5.1 and 6.x. I've written some WordPerfect macros that launch a DOS command from inside WordPerfect (which shells itself out while the command is performed); the specific command that I run from inside WordPerfect is one that starts 4DOS and runs a .BTM file (a 4DOS batch file).

Under WPDOS 6.2, if I use WordPerfect's "shell to DOS" feature and then run 4DOS by hand from the DOS prompt, 4DOS works perfectly. But if I use a slightly different feature in WordPerfect that runs a single DOS command without opening a DOS prompt, then 4DOS doesn't start. It doesn't display an error message - it simply doesn't run.

Under WPDOS 5.1, which seems to use a different way of managing memory, 4DOS runs correctly whether I use the "shell to DOS" feature or the feature that runs a single DOS command. The problem only occurs with WPDOS 6.x.

When I shell to DOS under either 5.1 or 6.2, MEM reports 615 KB free, so I don't think the problem is a lack of RAM. I hope I've made this problem clear, and I wonder if anyone has any insight into what might be going wrong and how I might be able to fix it.

Again, I am fully aware that this has nothing to do with things that DOSBox was designed to do. The fact is that DOSBox is so well written is that it runs WordPerfect under 64-bit Windows or OS X far better than anything else does, and that's why I'm asking for help with it. I fully understand that this issue is not something the developers need to spend any time with.

Thanks in advance for any help with this.
emendelson
Member
 
Posts: 452
Joined: 2010-2-14 @ 02:00

Re: Problem running DOS command from WordPerfect 6.2

Postby ripsaw8080 » 2011-10-09 @ 05:55

It sounds like you're running 4DOS *after* creating a DOSBox subshell. It would work better to create 4DOS subshells directly by setting COMSPEC=C:\4DOS.COM (or whatever the correct filespec is) in the environment instead of DOSBox's default COMSPEC=Z:\COMMAND.COM

About the problem with executing a single command: is it just 4DOS that won't execute, or do other commands fail to execute? If no single command will execute, it's possibe that INT 2Eh is being used, which is not currently supported by DOSBox because it is rarely used by games.
User avatar
ripsaw8080
DOSBox Author
 
Posts: 3315
Joined: 2006-4-25 @ 23:24

Re: Problem running DOS command from WordPerfect 6.2

Postby emendelson » 2011-10-09 @ 15:19

Thanks for these suggestions. I'm sorry to respond with a stupid question, but here goes:

1. How can I set comspec to be c:\freedos\4dos.com instead of its default setting? I know that I could do this by mounting a disk image and running some other version of DOS than the built-in Freedos, but this whole project is built on the default Freedos setup, and I would like to retain it if possible. I've searched for "DOSBox config.sys" and similar searches, but haven't found an answer. (As far as I know, comspec can't be changed after the initial environment is loaded, so setting it in autoexec.bat or from the command prompt doesn't have any effect.)

2. Next, some other commands run successfully when I use "Run DOS Command" in WPDOS 6.2, but there seems to be a shortage of memory. For example, if I run EDIT, it crashes with an "Out of memory!" error. And if I run MEM, it reports 185KB free. If, however, instead of using "Run DOS Command" I use the "Go to DOS" function to shell to a command prompt, MEM reports 615KB free. I don't understand what's going on here.

With WPDOS 5.1, I can use "Run DOS Command" and run EDIT and 4DOS successfully. If I run MEM, I don't see any output, but presumably there's enough. If I use "Run DOS Command" and run 4DOS, and then run MEM, it reports 615KB free.

Any advice will be gratefully received.
emendelson
Member
 
Posts: 452
Joined: 2010-2-14 @ 02:00

Re: Problem running DOS command from WordPerfect 6.2

Postby ripsaw8080 » 2011-10-09 @ 15:42

You can change the comspec environment variable from the command prompt (or a batch file) at any time prior to when a program uses the environment variable to create a subshell.

SET COMSPEC=C:\FREEDOS\4DOS.COM

You can use the SET command with no parameter to see a list of all environment variables. You'll want to set the environment variable in the top-level shell (before running any program that might create a subshell), because the environment of subshells does not apply to higher level shells, and it does not persist when subshells terminate.
User avatar
ripsaw8080
DOSBox Author
 
Posts: 3315
Joined: 2006-4-25 @ 23:24

Re: Problem running DOS command from WordPerfect 6.2

Postby emendelson » 2011-10-09 @ 16:16

Well, of course you are absolutely right about set comspec=c:\freedos\4dos.com. My mistake was that I put spaces around the equals sign, like this:

set comspec = c:\freedos\4dos.com

This did not change the comspec variable but (it seems) created a new, useless variable named "comspec " with a space at the end. When I typed it correctly, the comspec was set correctly, and a 4DOS shell started up when I used "Go to DOS" in WPDOS 6.2.

Unfortunately, this did not help with the "Run DOS Command" function. When I use "Run DOS Command" in WPDOS 6.2 under DOSBox, it reports 185KB free. When I run WPDOS 6.2 under Windows XP, and use "Run DOS Command" to run MEM, it reports 655KB free. Something is clearly blocking WPDOS 6.2's use of all that memory for "Run DOS Command." Whatever it is does not affect WPDOS 5.1, which does not have this problem.

WordPerfect has various switches that disable its use of EMS and XMS memory. I've tried every combination of those that I can think of, but I still get only 185KB free with "Run DOS Command." If you have any insights at all, I'll certainly try them.

Thank you again for your help.
emendelson
Member
 
Posts: 452
Joined: 2010-2-14 @ 02:00

Re: Problem running DOS command from WordPerfect 6.2

Postby ripsaw8080 » 2011-10-09 @ 16:37

Apparently it does not use INT 2E if commands are executing.

Seems reasonable that "Go to DOS" would run the shell program specified by the COMSPEC environment, and "Execute a DOS command" would do the same but pass the command on the command line like "C:\COMMAND.COM /C MEM". But why WP 6.2 would not swap itself out of memory in the same way for both is mysterious. Perhaps the MCB chain becomes broken somehow...

Have you tried LOADFIX allocations to see if it helps? You should experiment with a variety of allocation amounts before concluding that loadfix isn't going to help.
User avatar
ripsaw8080
DOSBox Author
 
Posts: 3315
Joined: 2006-4-25 @ 23:24

Re: Problem running DOS command from WordPerfect 6.2

Postby emendelson » 2011-10-09 @ 17:17

I've tried loadfix -# with a dozen different settings from -1 to -64 without any luck (except that the memory reported by MEM gets lower as the loadfix number gets higher).

What you say about the MCB is intriguing. I seem to remember some other issue that might have involved MCBs and WPDOS 6.2 (and I think it was you who suggested it).

Any further insights will be gratefully received. Thank you again!
emendelson
Member
 
Posts: 452
Joined: 2010-2-14 @ 02:00

Re: Problem running DOS command from WordPerfect 6.2

Postby DosFreak » 2011-10-09 @ 17:27

Have you tried WP 6.2 in DOSBox using a hard drive image?
Game Acronym List
DosBox CVS Builds
DosBox Feature Request Thread
DosBox FAQ
PC Game Compatibility List
"People like coldplay and voted for the nazis, you can't trust people."
User avatar
DosFreak
l33t++
 
Posts: 8685
Joined: 2002-6-30 @ 16:35
Location: Your Head

Re: Problem running DOS command from WordPerfect 6.2

Postby emendelson » 2011-10-09 @ 20:01

DosFreak wrote:Have you tried WP 6.2 in DOSBox using a hard drive image?


No, but I suppose I should do that if only to experiment with whether the problem is in DOSBox or Freedos. Now to find a suitable hard disk image...
emendelson
Member
 
Posts: 452
Joined: 2010-2-14 @ 02:00

Re: Problem running DOS command from WordPerfect 6.2

Postby DosFreak » 2011-10-09 @ 20:15

Check the 9x guide in the Guides section for the 2gbfreedos.zip.

That's a 2gb image with freeDos already installed.

Use Winimage to transfer files to it.
Game Acronym List
DosBox CVS Builds
DosBox Feature Request Thread
DosBox FAQ
PC Game Compatibility List
"People like coldplay and voted for the nazis, you can't trust people."
User avatar
DosFreak
l33t++
 
Posts: 8685
Joined: 2002-6-30 @ 16:35
Location: Your Head

Re: Problem running DOS command from WordPerfect 6.2

Postby emendelson » 2011-10-09 @ 23:35

Same result when booting from a hard disk image running DOS 7 - less than 180 KB RAM free when using Run DOS Command, MEM.
emendelson
Member
 
Posts: 452
Joined: 2010-2-14 @ 02:00


Return to DOSBox Development

Who is online

Users browsing this forum: No registered users and 0 guests