📜 ⬆️ ⬇️

Running a DOS application on Linux

The need to run DOS-applications under Linux occurs infrequently, but it happens . Somehow it happened to me, I decided to share my experience, maybe someone will come in handy.

And it was necessary to run someone, once written application for the clinic, running on Foxpro under DOS, in Linux, because There was no money to buy Windows licenses.

Initial data:
Suse Linux Enterprise Desktop 10.3 - Workstations.
Suse Linux Enterprise Server 10.3, there is a ball on Samba on it (I’ve previously shared it with Windows workstations, because there was no money for a Win-server license either), the name balls, oddly enough, is SHARE .
Everything happened 2-3 years ago, so the SLED and SLES versions at the time of installation were not that ancient either.

Because the server is already configured, then all of the following manipulations produce on the desktop.
Install from the repository, or download dosemu-xxx.rpm separately .
')
We also need Cyrillic fonts (hereinafter referred to as the XFonts folder), I don’t remember where I took them, I ’ll attach them to the article in the archive.

Create a folder where we mount the ball, prescribe the mount in fstab and mount it:
su mkdir /mnt/dos chmod 777 /mnt/dos echo "//192.168.0.130/SHARE /mnt/dos cifs iocharset=utf8,codepage=cp866,noperm,forcemand,direct,nounix,nolock,username=user,password=userpassword,rw 0 0" >> /etc/fstab mount /mnt/dos 
small explanation: 192.168.0.130 - server IP, user and userpassword are taken from users on the server who are allowed access to the Samba-ball.

Next, copy the fonts:
 cp -rf XFonts /usr/X11R6/lib/X11/fonts/ 
write the folder like other fonts in the /etc/X11/xorg.conf file, and add them to the system with the command:

 /usr/sbin/fonts-config 


In /etc/dosemu.conf , we add or modify the following options in the appropriate sections (I ended up with these options):

 ## Terminal related settings # Character set used externally to dosemu $_external_char_set = "utf8" #  Linux # Character set used by dos programs $_internal_char_set = "cp866" #  DOS ## Keyboard related settings $_layout = "ru" #  ## Printer and parallel port settings $_lpt1 = "lp -o media=a4 -o cpi=11" # ,      LPT  # #$_lpt1 = "iconv -f cp866 -t utf8 | lp -o media=a4 -o cpi=11 -d printername" ## Setting specific to the X Window System (xdosemu, dosemu -X) $_X_font = "vgacyr" #   


In the autoexec.bat file, located in the / usr / share / dosemu / drive_z folder, we write the following (!!! when copying # and explanations removed !!!):

 @echo off rem autoexec.bat for DOSEMU + FreeDOS path z:\bin;z:\gnu;z:\dosemu;p:\ovl1;p:\ovl;p:\prv # ovl1;p:\ovl;p:\prv -     DOS; set HELPPATH=z:\help set TEMP=c:\tmp blaster prompt $P$G unix -s DOSDRIVE_D if "%DOSDRIVE_D%" == "" goto nodrived lredir d: linux\fs%DOSDRIVE_D%:nodrived lredir p: linux\fs/mnt/dos #    Linux  DOS unix -s DOSEMU_VERSION echo "Welcome to dosemu %DOSEMU_VERSION%!" unix -e xmode -fullscreen on #  Dosemu    lin.bat #     DOS 


For complete clarity, here’s the lin.bat content (!!! when copying # and explanations removed !!!):

 @ echo off p: #    p: cd ovl1 #     p:\ovl1\reg01.fxp #   ( .fxp  ,      .exe,   Foxpro) xmode -fullscreen off #         exitemu #    


Making the first launch, command:
 dosemu 
we'll get it because there is no lin.bat file, correct it by creating in the home directory, in the folder .dosemu / drive_c (the folder is created when you first start the emulator) of this file with the above contents.

Once again we start dosemu and voila, our dos program works, shows the text in Russian and even prints under Linux.

My delights were related to a specific program, but I think in this way, with the replacement of paths and file names, many, if not all, applications running under DOS will start.

PS
If we start dosemu, we catch:

 >LOWRAM mmap:   


That adds in / etc / sysctl.conf

 vm.mmap_min_addr=0 


Well, reboot.
Promised archive.

Source: https://habr.com/ru/post/268529/


All Articles