VOGONS


First post, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

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.

Reply 1 of 10, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

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.

Reply 2 of 10, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

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.

Reply 3 of 10, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

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.

Reply 4 of 10, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

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.

Reply 5 of 10, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

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.

Reply 6 of 10, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

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!

Reply 8 of 10, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie
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...

Reply 9 of 10, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

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.

How To Ask Questions The Smart Way
Make your games work offline