Sunday, December 2, 2018

DOSBox as container

During development of test ROM for ZX-Poly I had to use some compressing utility written by Vyacheslav Mednonogov in 1993, unfortunately I could not find any sources of the utility and it is presented only as executable file for MS-DOS. I wanted some more or less cheap solution to start the utility under Linux (Ubuntu), to get it working over some external file and get result of processing. I found some solution with DOSBox which is provided in standard Ubuntu repository. If you have not installed the emulator, you can use

sudo apt-get install dosbox

In my case I use such command line to execute utility xlpz.exe:
dosbox -c "cycles max" -c "MOUNT E $XPLZDIR" -c "MOUNT D $DIR" -c "d:" -c "e:\xlpz.exe $FILENAME" -c "exit"

where:
  • $XPLZDIR - directory where xlpz.exe is situated in host OS, it will be mounted in DOSBox as drive E 
  • $DIR - directory where data for processing is situated (it will be mounted in DOSBox as disk D), the result will be written in the same folder
  • $FILENAME is the file name of file to be processed but without folder path because for the utility it is situated directly in the root of D drive 
I use cycles max to maximize speed of work of the DOSBox because I don't need any real-time delay.The exit in the end of the command line tells DOSBox to stop work after utility work completion.

Unfortunately there is not any directive for DOSBox to not show its UI part but it is not big evil in the business.