Synchronet v3.19b-Win32 (install) has been released (Jan-2022).

You can donate to the Synchronet project using PayPal.

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
howto:dosemu [2020/12/17 20:45] – [Setup External Programs] mlonghowto:dosemu [2022/09/10 13:49] (current) – [Use DOS Doors with Synchronet on Linux] Added a couple links to information on getting DOSEMU2 set up and working with Synchronet Nightfox
Line 4: Line 4:
  
 :!: :!:
-DOSEMU has been discontinued for more than a decade. However, it is the only viable solution for most distributions to run DOS doors, and is supported in Synchronet.+DOSEMU has been discontinued for more than a decade. However, it is the only viable solution for most distributions to run DOS doors, and is supported in Synchronet. However, there is [[howto:dosemu2|a guide]] to installing DOSEMU2.  There is also [[https://gitlab.synchro.net/main/sbbs/-/issues/433|a Synchronet issue]] with some suggestions on how to get DOSEMU2 working with Synchronet.
  
  
Line 19: Line 19:
 Install DOSEMU into your system. For Debian and others, you will need to find a repository for an older version in order to get the DOSEMU package. For other systems, you may be able to compile it or obtain it in other ways. Install DOSEMU into your system. For Debian and others, you will need to find a repository for an older version in order to get the DOSEMU package. For other systems, you may be able to compile it or obtain it in other ways.
  
-==== Edit SBBS.INI ====+For Debian, once you install a prior repository, simply:  
 +   apt-get install dosemu dosemu-freedos    
 +For other distributions,​ you will need to first install and configure dosemu, and then install FreeDOS (or your DOS of choice) and set it up to work with dosemu. Ensure that you can at least get to a DOS prompt through standalone DOSEMU before even trying to use it with Synchronet.
  
-Modify sbbs.ini to set ''UseDOSemu = true''. You can also modify the ''DOSemuPath'' and ''DOSemuConfPath'' if you need something other than the defaults. However, normally, the Synchronet-provided ''dosemu.conf'' will be in your ''[[dir:ctrl]]'' dir and dosemu.bin will be in your system bin.+==== Edit sbbs.ini ==== 
 + 
 +Modify the ''[BBS]'' section of your ''[[dir:ctrl]]/sbbs.ini'' to set/add ''UseDOSemu = true''. 
 + 
 +You can also modify the ''DOSemuPath'' and ''DOSemuConfPath'' values if you need something other than the defaults. However, normally, the Synchronet-provided ''dosemu.conf'' will be in your Synchronet ''[[dir:ctrl]]'' dir and ''dosemu.bin'' will be in your system ''bin'' directory, so the default values should work fine.
  
 ==== Install DOS Utils ==== ==== Install DOS Utils ====
  
-Make a ''dosutils'' directory, preferably in your ''[[dir::exec]]'' dir but you can also put it in your ''[dir::xtrn]]'' dir. (Note: if you put in your ''[dir::xtrn]]'' dir, you can use it for external editors.+Make a ''dosutils'' directory, preferably in your ''[[dir::exec]]'' dir but you can also put it in your ''[[dir::xtrn]]'' dir. (Note: if you put in your ''[[dir::xtrn]]'' dir, you can use it for external editors).
  
 Inside the ''dosutils'' directory, you'll need a FOSSIL driver (''x00.exe'' works well, but you can also use ''bnu.com'', etc.). Inside the ''dosutils'' directory, you'll need a FOSSIL driver (''x00.exe'' works well, but you can also use ''bnu.com'', etc.).
 +
 +If you aren't sure what to use, go with X00. You can get a copy at ftp://vert.synchro.net//main/COMM/x00150.zip
 +
 +Alternatively, you can get a copy of BNU at ftp://vert.synchro.net//main/COMM/bnu189h.zip
  
 You may also need ''share.com'' if it is not found in your dosemu drive. You may also need ''share.com'' if it is not found in your dosemu drive.
Line 35: Line 45:
 ==== Modify external.bat ==== ==== Modify external.bat ====
  
-The ''external.bat'' file found in your ''[[dir:exec]]'' dir is the template used to build the batch file which executes each external program. Inside this file is where you will place your call to your FOSSIL driver, under the :NOEMU section, like this: +The ''external.bat'' file found in your ''[[dir:exec]]'' dir is the template used to build the batch file which executes each external program. Inside this file is where you will place your call to your FOSSIL driver, within the '':NOEMU'' section, like this: 
- +<file> 
-''IF "$RUNTYPE" == "FOSSIL" x00.exe eliminate >NUL'' +IF "$RUNTYPE" == "FOSSIL" x00.exe eliminate >NUL 
 +</file>
 And you will also have share: And you will also have share:
  
-''@share >NUL''+<file> 
 +@share >NUL 
 +</file>
  
 ==== Setup External Programs ==== ==== Setup External Programs ====
  
 Proceed to setup your external program using the [[howto:door:index|normal Installation methods]]. Proceed to setup your external program using the [[howto:door:index|normal Installation methods]].
-====== Setting up a DOS BBS door ======+====== Advanced Usage ====== 
  
-READ THIS; THESE STEPS ARE REQUIRED +==== emusetup.bat ====
  
-===== emusetup.bat =====+Historically, the integration used ''emusetup.bat'' in your ''[[dir:ctrl]]'' directory to setup the fossil drivers, etc. This is still supported for existing users, but it is no longer required. Just put what you need in the :NOEMU section of ''[[dir:ctrl]]''/''external.bat''. This batch file configures the DOS environment, and can be used to load additional TSRs, change drive letters around, or make any other last minute changes to the environment before the door is loaded. It is required to at least load a FOSSIL driver in this batch file. 
  
-There must be an ''emusetup.bat'' in your ''[[dir:ctrl]]'' directory. This batch file configures the DOS environment, and can be used to load additional TSRs, change drive letters around, or make any other last minute changes to the environment before the door is loaded. It is required to at least load a FOSSIL driver in this batch file. +The file looked like:
  
 <file emusetup.bat> <file emusetup.bat>
Line 69: Line 82:
 NOTE: append "eliminate" to x00.exe to skip the 5 second commercial ad when it is invoked (ie; "x00.exe eliminate" instead of just x00.exe). This will prevent a 5 second delay when starting doors and invoking external dos editors.  NOTE: append "eliminate" to x00.exe to skip the 5 second commercial ad when it is invoked (ie; "x00.exe eliminate" instead of just x00.exe). This will prevent a 5 second delay when starting doors and invoking external dos editors. 
  
-===== Drive Letters ===== +==== DOSEmu Path ====
- +
-The rest of these instructions assume that you are using the default remapped drive letters and haven't changed them around in emusetup.bat. The default drive letters are:  +
- +
-  * D: - The Synchronet node directory, where the dropfile should probably be put. In door configurations, specify this drive (D:\) as the path to the dropfile.  +
-  * E: - Under this drive, the parent of the door's startup directory will be mounted. Example: ''E:\LORD'' +
-  * F: - The Synchronet ''[[dir:ctrl]]'' directory  +
-  * G: - The Synchronet ''[[dir:data]]'' directory  +
-  * H: - The Synchronet ''[[dir:exec]]'' directory  +
- +
-Any necessary utilities that should be loaded before the door starts (like FOSSIL driver, ANSI driver, etc) should be placed in the ''emusetup.bat'' with a PATH that points to them. The default location is in a \dosutils directory immediately preceding the door's directory. (For example, if your door is in /sbbs/xtrn/lord, put the dosutils directory as /sbbs/xtrn/dosutils.) +
  
 The default dosemu binary is /usr/bin/dosemu.bin. If you have a different one that you would like all DOS programs that Synchronet launches to use, configure DOSemuPath in ''[[config:sbbs.ini]]''. The default dosemu binary is /usr/bin/dosemu.bin. If you have a different one that you would like all DOS programs that Synchronet launches to use, configure DOSemuPath in ''[[config:sbbs.ini]]''.
Line 90: Line 93:
 NOTE: Be sure to point to ''dosemu.bin'' and not the ''dosemu'' wrapper script.  NOTE: Be sure to point to ''dosemu.bin'' and not the ''dosemu'' wrapper script. 
  
-Ensure that you have a working dosemu setup before trying to set it up with Synchronet! For Debiansimply: +==== DOSEmu Conf ==== 
-  apt-get install dosemu dosemu-freedos+ 
 +By default, it will check for dosemu.conf in your startup/external program directoryand then look at the path you configured as ''DOSemuConfPath'' in ''[[config:sbbs.ini]]''. If neither is found, it will look at ''/etc/dosemu/dosemu.conf'' and ''/etc/dosemu.conf''
    
-For other distributions, you will need to first install and configure dosemu, and then install FreeDOS (or your DOS of choice) and set it up to work with dosemu. Ensure that you can at least get to a DOS prompt through standalone DOSEMU before even trying to use it with Synchronet+==== DOSEMU.ini ====
  
-To configure a DOS BBS door in [[util:scfg:index]]:+The file ''[[dir:exec]]/dosemu.ini'' is used to determine the command line execution of dosemu. You should not normally need to edit this file, but you can if you need to. The global ''cmd'' entry is used for FOSSIL, COM, and UART programs. The ''[stdio]'' ''cmd'' entry is used for intercept I/O programs.
  
-  * Startup Directory: /path/to/the/door (or ../xtrn/mydoor)  +See the file comments for which variable names you can use in the file to be substituted at run-time. These are used instead of environment variables due to the limited amount of memory available inside the batch file during execution. For example, the text ''$CTRLDIR'' will be expanded to point to your actual ctrl directory.
-  * Program name: program.exe %params (or program.bat %params)  +
-  * Multiuser: Yes/No depending on the program  +
-  * Redirect STDIO: No (instructs Synchronet to use vmodem support)  +
-  * Native Program: No (instructs Synchronet to handle the door through DOSEMU)  +
-  * Dropfile: pick a dropfile type that the door knows how to handle  +
-  * Use Lowercase: Yes  +
-  * Dropfile Dir: Place in Node Directory +
  
-You probably want to also add the door's setup program as a standard I/O program (see below for details on standard I/O programs). If you don't want to do this, you will need to enter DOSEMU, redirect the door's parent directory to E: like this assuming the door is in /sbbs/xtrn/doordir:  
-  C:\> lredir E: linux\fs\sbbs\xtrn 
-then go to E:, change to the door's directory, and run the setup program. If you don't do this redirection and set up through the redirected drive, you will probably set up the door to use wrong paths and it won't work!  
  
-When you set up the door, point it to D:\ for the dropfile path. Also, generally it would be good idea to tell the door to use a fossil driver, unless it doesn't work or produces strange results (like missing lines or dropped characters), in which case you can use the internal comm routines of the door. (DOSEMU'virtual modem support allows both approaches.+You can also place copy of this file in the external program'startup directory to override it for that external program.
  
-The door's actual directory will be mounted on E:\ with the root of E: being the parent directory of the door. So if your door is in /usr/local/games/tw2002 on the Unix side, it will be in E:\tw2002 on the DOS side. Make sure the door's directory conforms to the DOS 8.3 file format! /usr/local/games/tw2002 would be okay, but /usr/local/games/TradeWars2002 would not. The symptom of a non-conforming directory is a "file not found" when Synchronet tries to change to the DOS door's directory inside DOSEMU. +==== Drive Letters ==== 
 + 
 +Assuming you are using the default remapped drive letters and haven't changed them around in ''emusetup.bat'' or ''external.bat'', they are:  
 + 
 +  * D: - The Synchronet node directory, where the dropfile should probably be put. In door configurations, specify this drive (D:\) as the path to the dropfile.  
 +  * E: - Under this drive, the parent of the door's startup directory will be mountedExample: ''E:\LORD'' 
 +  * F: - The Synchronet ''[[dir:ctrl]]'' directory  
 +  * G: - The Synchronet ''[[dir:data]]'' directory  
 +  * H: - The Synchronet ''[[dir:exec]]'' directory  
 + 
 +==== Troubleshooting ==== 
 + 
 +If a door will not run or has problems: 
 + 
 +  * Try to capture any output in the BBS. In Syncterm, you can do this with Alt-C 
 +  * Cat /sbbs/node(#)/external.bat and look at the bottom REM line. Try running that command and see what happens 
 +  * Manually enter dosemu. Map your drive (lredir E: linux\fs\sbbs\xtrn). Switch to drive E and run "external.bat TEST". The "TEST" simply keeps it from running "exitemu".  
 + 
 +Check your syslog, your SBBS error log, as well as the dosemu_boot.log in your node dir. 
 + 
 +Make sure the door's directory conforms to the DOS 8.3 file format! /usr/local/games/tw2002 would be okay, but /usr/local/games/TradeWars2002 would not. The symptom of a non-conforming directory is a "file not found" when Synchronet tries to change to the DOS door's directory inside DOSEMU. 
  
 If the door doesn't start, it's probably a configuration problem of some kind that has left DOSEMU sitting at a DOS prompt. If you have what you think is a hung session, the first thing to try is blindly typing 'exitemu' to see if the session can be exited.  If the door doesn't start, it's probably a configuration problem of some kind that has left DOSEMU sitting at a DOS prompt. If you have what you think is a hung session, the first thing to try is blindly typing 'exitemu' to see if the session can be exited. 
  
 Make SURE that if the door is started with a .bat batch file, that you explicitly name it as such in the "Program Name" field. For instance, LORD's "start.bat" command would be entered as "start.bat %#", not just "start %#". Failure to do this will cause the session to be hung inside DOSEMU when the user exits the door. (You can still exit by blindly typing exitemu when this happens.)  Make SURE that if the door is started with a .bat batch file, that you explicitly name it as such in the "Program Name" field. For instance, LORD's "start.bat" command would be entered as "start.bat %#", not just "start %#". Failure to do this will cause the session to be hung inside DOSEMU when the user exits the door. (You can still exit by blindly typing exitemu when this happens.) 
-Setting up a non-door DOS program as a door+ 
 +Make sure your terminal is 80 chars wide, especially for configuration programs. 
 +==== Setting up a non-door DOS program as a door ====
  
 For the most part, setting up a non-door DOS program is done following the same procedure as a door. The key difference is that you set Redirect STDIO to Yes for a program that is not designed specifically to run as a BBS door.  For the most part, setting up a non-door DOS program is done following the same procedure as a door. The key difference is that you set Redirect STDIO to Yes for a program that is not designed specifically to run as a BBS door. 
 +
 +==== Timed Events ====
  
 You can also set up timed events (e.g. door daily maintenance programs) in this same manner. Just make sure Native Program is set to "No" and it will work fine.  You can also set up timed events (e.g. door daily maintenance programs) in this same manner. Just make sure Native Program is set to "No" and it will work fine. 
Line 131: Line 149:
   Dropfile Dir: Place in Node Directory    Dropfile Dir: Place in Node Directory 
  
-It would probably be a good idea to set up ''command.com'' as an external, so that you can get access to a DOS shell through the board. From there, you can do things like the initial unzipping and setup of door software with ease. +==== Per-Program Configuration Files ====
  
-Be careful with the security of these programs! Since they aren't designed to run as doors, a malicious user who has access could probably wipe out your whole BBS system.  +You can override the default system files used by placing a customized version in the external program's startup directoryFiles that can be overridden in this manner are:
-Customization of your Synchronet DOSEMU setup+
  
-File Search Precedence:  +** external.bat ** used instead of ''[[dir:exec]]/external.bat''
-The following table describes in what order Synchronet will look for various files needed for starting DOSEMUIf a file does not exist in one location or cannot be read, the next location will be tried until there are no more possible locations+
  
-^ ^dosemu.bin ^emusetup.bat ^dosemu.conf+** dosemu.conf ** used instead of configured dosemu.conf
-|First |startup_dir |startup_dir |startup_dir| +
-|Second |DOSemuPath |$SBBSCTRL |$SBBSCTRL| +
-|Third | |               |/etc/dosemu/dosemu.conf+
  
 +** dosemu.ini ** used instead of ''[[dir:exec]]/dosemu.ini''
  
-This is useful because you might want to customize the configuration in order to get a particular balky door working. You might want a custom dosemu binary, ''emusetup.bat'', and/or dosemu config for that particular door, while maintaining a different set of configurations that works for mostly everything else.  +==== Alternate DOS ====
- +
-make sure you are using a ''dosemu.conf'' from the DOSEMU distribution of the particular version you are using. (e.g. if using 1.1.4 release, don't use a dosemu.conf from 1.0.2). If you want to customize a config, start from your distro's release dosemu.conf. Unfortunately, if you upgrade to a newer release of DOSEMU, you will probably have to also forward-port your custom config files since the config file format may change. +
  
 The most up-to-date freedos distribution can be found [[http://www.freedos.org/freedos/files/|here]] -- this is known to fix problems with Tradewars 2002. You might consider trying DR-DOS if you have problems with FreeDOS. However, be certain that you use the autoexec.bat from the FreeDOS distribution, as the Synchronet integration depends on it (specifically, it depends on the DOSDRIVE_D and unix -e behavior from it). Also remember to copy the DOSEMU support files (usually located in /usr/lib/dosemu/commands) into c:\dosemu in the DR-DOS hdimage.  The most up-to-date freedos distribution can be found [[http://www.freedos.org/freedos/files/|here]] -- this is known to fix problems with Tradewars 2002. You might consider trying DR-DOS if you have problems with FreeDOS. However, be certain that you use the autoexec.bat from the FreeDOS distribution, as the Synchronet integration depends on it (specifically, it depends on the DOSDRIVE_D and unix -e behavior from it). Also remember to copy the DOSEMU support files (usually located in /usr/lib/dosemu/commands) into c:\dosemu in the DR-DOS hdimage. 
  
  
-===== Known Problems ===== 
- 
-File locking is dysfunctional with the DOSEMU 1.0.2.x stable releases. File locking problems will manifest themselves as strange error messages related to file opens, long pauses and/or hangs, game data corruption, and other fun stuff. Note that you do not have to be running a multinode BBS to be prone to these issues; most programs detect DOSEMU as a multitasker and thus initiate their lock management regardless of whether or not multiple sessions of the game will be in use. The fix is to upgrade to DOSEMU 1.2 or later, since 1.0.x is obsolete.  
- 
-There is a file locking hack from Bob Newell which is detailed in [[http://www.icequake.net/bbs/syncmods/faqlinux.htm|this document]]. Included is a kludge for slow screen draws due to incorrect idling that will occur in some games such as Planets TEOS.  
- 
-If you are running Debian 'woody', I recommend upgrading to 'sarge' so that you can use DOSEMU 1.2.x that is part of the distribution.  
- 
-If your terminal isn't set to exactly 80 columns, the display may appear corrupt. This is especially true running config programs. Physically resize your telnet/ssh session window to 80 columns if you see such corruption. 
-==== Disabling DOSEMU from opening a window in XWindows ==== 
- 
-To disable windows being opened when running dosemu: 
- 
-  * create a shell script for dosemu with the using the following as an example: 
- 
-    #!/bin/sh 
-    exec /path/to/dosemu/dosemu -T "$@" 
  
-  * make sure to chmod 0755 your_dosemu_script 
-  * [[http://ftp.synchro.net/config:sbbs.ini|edit sbbs.ini and uncomment and change DOSemuPath variable to your new dosemu script]] 
-==== If you are having other problems ==== 
- 
-check the dosemu.log and dosemu_boot.log that will be created in the node directory. They should give you clues to track down a configuration problem. If those files do not exist, then the dosemu.bin is not getting executed properly, so check your sbbs.ini, make sure you have dosemu installed, and check for a stale dosemu.bin symlink in the door's directory.  
-double-check your door's configuration, specifically the paths in scfg and the batch file (if any) that starts it.  
-Also verify that the paths in the door's configuration problem are correct  
-Verify that you have set up enough nodes in the door's configuration to handle all the nodes on your BBS.  
- 
-If you want help with this, you must send me *at a minimum* the following files:  
-  * ''dosemu.log'' and ''dosemu_boot.log'' from the node directory  
-  * your DOS ''autoexec.bat'' and ''config.sys'' 
-  * output of 'find /'  
-  * ''emusetup.bat'' and ''dosemu.conf'' (only if you have modified them)  
- 
-Send problem reports to nemesis@icequake.net  
  
 ==== Files ==== ==== Files ====
  
   * [[http://www.icequake.net/bbs/syncmods/emusetup.bat|emusetup.bat]]   * [[http://www.icequake.net/bbs/syncmods/emusetup.bat|emusetup.bat]]
-  * [[http://www.icequake.net/bbs/syncmods/dosemu.conf|Example dosemu.conf (for 1.0.2)]] 
   * [[http://www.icequake.net/bbs/syncmods/dosutils.tar.gz|A collection of essential DOS BBS utils, such as ANSI drivers and FOSSIL drivers]]   * [[http://www.icequake.net/bbs/syncmods/dosutils.tar.gz|A collection of essential DOS BBS utils, such as ANSI drivers and FOSSIL drivers]]
-  * [[http://www.icequake.net/bbs/syncmods/dosemu_1.0.2.1-7_i386.deb|DOSEMU Development Version 1.1.5.7 compiled for Debian stable/woody]] +
-  * [[http://www.icequake.net/bbs/syncmods/dosemu_1.0.2.1-7_i386.deb|DOSEMU 1.0.2 compiled for Debian stable/woody, patched for locking fixes]] +
-  * [[http://www.icequake.net/bbs/syncmods/init/synchronet|Init script to start Synchronet as a daemon]] +
-  * [[http://www.icequake.net/bbs/syncmods/init/synchronet-screen|Init script to start Synchronet as a detached screen]] +
-  * Latest version of the patch - link gone/broke+
  
    
-===== The Script Method ===== 
- 
-There is another way to do this: use a script that launches dosemu. This is the more flexible but non-userfriendly way to use dosemu doors on Synchronet. Example stuff can be found in this [[http://www.icequake.net/bbs/syncmods/rungame.tgz|tarball]].  
  
 ===== See Also ===== ===== See Also =====
 +  * [[:howto:door:index|Install Doors]]
 +  * [[:howto:|How-To Pages]]
 +  * [[http://www.icequake.net/bbs/syncmods/|Ryan Underwood's original Synchronet-DOSEMU patch]]
   * [[http://synchro.net/docs/linux-dosemu-howto.txt|DOSEMU Synchronet DOORS HOWTO by Michael Capp circa 2003]] (does not use the methods described on this page)   * [[http://synchro.net/docs/linux-dosemu-howto.txt|DOSEMU Synchronet DOORS HOWTO by Michael Capp circa 2003]] (does not use the methods described on this page)
-  * [[:howto:|How-To Pages]] 
  
 {{tag>linux doors dosemu}} {{tag>linux doors dosemu}}