dmsc / emu2

Simple x86 and DOS emulator for the Linux terminal.
GNU General Public License v2.0
406 stars 31 forks source link

No stdout output running under node-pty #55

Closed NuSkooler closed 2 years ago

NuSkooler commented 2 years ago

I'm attempting to use emu2 to run some old text mode DOS applications under https://github.com/microsoft/node-pty for the purpose of a BBS "door". Essentially I launch emu2 under node-pty's spawn() and capture stdout. Input from the user is sent to stdin.

Currently I'm trying this with Sleuth. When run from a standard Linux terminal, everything is fine. When run as described as above, I do not get any output.

I use the same technique for launching native OS binaries without issue.

Any ideas? I can provide any of the debug logs if they would be helpful.

dmsc commented 2 years ago

Hi!

emu2 has two output methods depending on which DOS functions are called:

In the second case, the emulator stops writing to the terminal directly - instead changes to the video memory are copied to the terminal about 18 times per second.

By using node-pty, the emulator should work and send the screen to the pseudo-terminal, but you will see the terminal control codes on each screen refresh.

I would start testing simpler programs first, for example the attached "scroll.com" test, and see if the logs show something. scroll.zip

NuSkooler commented 2 years ago

Well now I feel stupid, but setting up scroll.zip gave me a eye check. I had both a typo and a bug in my code not catching the bad configuration. Both are fixed now and emu2 + Sleuth are working great.

Thank you!

dmsc commented 2 years ago

Hi!

Well now I feel stupid, but setting up scroll.zip gave me a eye check. I had both a typo and a bug in my code not catching the bad configuration. Both are fixed now and emu2 + Sleuth are working great.

Thank you!

Great, glad I could help!