dosemu2 / comcom64

64bit command.com
https://github.com/dosemu2/comcom32/
GNU General Public License v3.0
32 stars 5 forks source link

`dosemu -K` with long file name does not work with comcom32.exe #4

Closed tkchia closed 5 years ago

tkchia commented 5 years ago

Hello @stsp,

I can now install dosemu2 + fdpp + comcom32 and run a "Hello world" program in "dumb terminal" mode, like so:

$ dosemu -dumb -K hello.com 2>/dev/null
...
Welcome to dosemu2!
    Build 2.0pre6.1-dev-20181117-1628-g9ca4d25
About to Execute : hello.com
Hello world!

However, if I rename hello.com to a long (non-8.3) file name such as hello-lfn.com, for some reason the program is not run any more:

$ dosemu -dumb -K hello-lfn.com 2>/dev/null
...
Welcome to dosemu2!
    Build 2.0pre6.1-dev-20181117-1628-g9ca4d25
About to Execute : hello-lfn.com

I can run programs with long file names if I use FreeDOS's FreeCOM instead of comcom32, which is why I suspect that this is a comcom32 issue.

Thank you!

stsp commented 5 years ago

The problem will be solved on dosemu side, and it is known. For example if you run lredir2 under comcom32, you'll see all redirections suffixed with "DISABLED". This means many things besides LFN do not work too.

@andrewbird what if we fsck on all this and just change fdpp to not re-create the CDS array after boot? Is it difficult?

andrewbird commented 5 years ago

Is this because the int2f/ae00 support is missing? I also note that comcom32 disables lfn support itself (see the crt0 startup flags). I think to stick with the original CDS array in fdpp you have to:

If it's the missing call to int2f/ae00, isn't it quicker to add that even if its result isn't used in comcom32 yet?

stsp commented 5 years ago

Yes, I think w/o the redirector, startup flags wont help, but good catch. ae00 should probably be simpler, but there are those corner cases, like making sure it is called when all files are closed, even if processing the bat file (for which the bat file should be closed per every line). As for cds - maybe we can just copy old cdses over the new ones. Then there are no problems you mentioned. Anyway, I dont know what solution is the simplest, but I know that I dont have time for the big ones right now.

andrewbird commented 5 years ago

Perhaps you can just call int2f/ae00 once at startup of comcom32, won't that be enough for what we want, as we don't want to use the result from it, at least for now?

stsp commented 5 years ago

Yes, this may work. Not that I like such solution, but the patch is welcome. :)

andrewbird commented 5 years ago

okay I will have a try.