Concurrent DOS + QEMU losing data through parallel port emulation

173 views Asked by At

I have a piece of software running on concurrent DOS 3.1, which I emulate with QEMU 5.1.

In this program, there are several options to print data. The problem is that the data arriving to my host does not correspond to the data sent.

the command to start qemu:

qemu-system-i386 -chardev file,id=imp0,path=/path/to/file -parallel chardev:imp0 -hda DISK.Raw

So the output sent on parallel port of my guest is redirected to /path/to/file. When I send the charactère 'é' from CDOS:

echo é>>PRN

The code page used on CDOS is Code Page 437, and in this charactere set, the charactère é is represented by 0x82, but on my host, instead, I receive the following:

cp437 é -> 0x82     ---------> host -> x1b52 x017b x1b52 x00

So I tried something else. I wrote the charactère 'é' in a file, and sent the file with nc.exe (from brutman and libmtcp), and with nc, the value stays 0x82.

So my question, what happen when I send my data to virtual parallel port? When does my data get transformed? Is it the parallel port on Concurrent DOS? Is it the QEMU? I can't figure out how to send my data through LPT1 properly.

I also tried this:

qemu-system-i386 -chardev socket,id=imp0,host=127.0.0.1,port=2222,server,nowait -parallel chardev:imp0 -hda DISK.Raw

I can read the socket fine, but same output as when I write in a file, the é get transformed to x1b52 x017b x1b52 x00.

2

There are 2 answers

0
Stephane On BEST ANSWER

OK, so i finally figured it out... After hours of searching where this printer.sys driver could be, or how to remove it, no Concurrent DOS, the setup command is "n". And of course, it is not listed in the "help" command...

Anyway, in there you can setup your printer, and select "no conversion" for the port you want. And it was actually on Epson MX-80/MX-100.

So thanks to Peter's answer, you led me to the right path !

2
Peter Maydell On

The byte sequence "1B 52 01 7B 1B 52 00" is using Epson FX-style printer escape sequences (there's a reference here). Specifically, "1B 52 nn" is ESC R n which selects the international character set, where character set 0 is USA and 1 is France. So the sequence as a whole is "Select French character set; print byte 0x7b; select US character set". In the French character set for this printer standard, 0x7B is the e-acute é.

This is almost certainly the CDOS printer driver assuming that the thing on the end of PRN: is an Epson printer and emitting the appropriate escape sequences to output your text on that kind of printer.