• exec/external.bat does not work with dosemu2

    From Fernando Toledo@VERT to GitLab issue in main/sbbs on Sun Aug 21 11:32:39 2022
    open https://gitlab.synchro.net/main/sbbs/-/issues/433

    environment variables used for lredir with \ (DOS backslash) fail on dosemu2 ```
    E:\freedos.com>lredir -n linux\fs\sbbs\doors\dos
    Error b (format invalid) while redirecting drive K: to \\linux\fs\sbbs\doors\dos
    ```

    should use / (linux slash):
    ```
    E:\freedos.com>lredir -n linux\fs/sbbs/doors/dos
    K: = \\linux\fs/sbbs/doors/dos attrib = READ/WRITE
    ```
    So all environment variables used in exec/external.bat need to be changed from '\' to '/' for lredir to work properly
    maybe through ctrl/sbbs.ini it is tried to add an option UseDOSEmuVersion=x where x can be 1 or 2 (1 as default)
    and use this option as dosemu quirk.
    thanks!

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Fernando Toledo@VERT to GitLab note in main/sbbs on Sun Aug 21 11:39:57 2022
    https://gitlab.synchro.net/main/sbbs/-/issues/433#note_2709

    It seems that @nelgin was testing dosemu2, have you run into this problem?

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Nigel Reed@VERT to GitLab note in main/sbbs on Sun Aug 21 15:35:00 2022
    https://gitlab.synchro.net/main/sbbs/-/issues/433#note_2711

    I didn't use lredir to change directories when using dosemu2. I did it on the command line. I gave up and blew it all away in the end. Just too many issues I couldn't resolve. dosemu1 just works. Except for TW and there's plenty of TW server gateways out there unless you really must run your own.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Fernando Toledo@VERT to GitLab note in main/sbbs on Sun Aug 21 20:38:47 2022
    https://gitlab.synchro.net/main/sbbs/-/issues/433#note_2713

    Yeap..due to hard disk failure i replace it and update my os to debian 11. Unfortunately dosemu 1 is no longer in the repositories.

    I have running dos doors with dosemu2 without touching their settings.

    I just edit the exec/dosemu.ini to use -d to add node and startup dirs ($NODEDIR and $XTRNDIR).
    Then edit ctrl/dosemu.conf to add the rest of fixed paths (ctrl, data and exec dirs)

    The exec/external.bat still fail but I don't care because it uses @lredir and continues on error

    **exec/dosemu.ini**
    ```ini
    cmd=/usr/bin/env $TERM HOME=$CTRLDIR QUIET=1 DOSDRIVE_D=$NODEDIR NODEDIR=$NODEDIR $DOSEMUBIN -d $NODEDIR -d $XTRNDIR -I"video { none }" $VIRTUALCONF -f$DOSEMUCONF -E$EXTBAT -o$NODEDIRdosemu_boot.log $EXTLOG
    [stdio]
    cmd=/usr/bin/env $TERM HOME=$CTRLDIR QUIET=1 DOSDRIVE_D=$NODEDIR NODEDIR=$NODEDIR $DOSEMUBIN -d $NODEDIR -d $XTRNDIR -I"video { none }" -I'keystroke "\n"' $VIRTUALCONF -f$DOSEMUCONF -E$EXTBAT -o$NODEDIRdosemu_boot.log $EXTLOG
    ```

    **ctrl/dosemu.conf**
    ```
    $_cpu = "80486"
    $_cpu_emu = "fullsim"
    $_floppy_a = ""
    $_cdrom = ""
    $_xms = (1024)
    $_ems = (1024)
    $_ems_frame = (0xe000)
    $_external_char_set = "cp437"
    $_internal_char_set = "cp437"
    $_term_updfreq = (8)
    $_layout = "us"
    $_rawkeyboard = (auto)
    $_mouse_internal = (on)
    $_mouse_dev = ""
    $_joy_device = ""
    $_lpt1 = ""
    $_lp2 = ""
    $_speaker = ""
    $_sound = (off)
    $_sb_dsp = ""
    $_hdimage = "+0 -2 /sbbs/ctrl /sbbs/data /sbbs/exec +1"
    $_lredir_paths = "/sbbs"

    ```

    The result is that the directories are mapped as expected:
    ```
    E:\freedos.com>lredir
    Current Drive Redirections:
    C: = /sbbs/ctrl/.dosemu/drive_c attrib = READ/WRITE
    D: = /sbbs/nodes/node2 attrib = READ/WRITE
    E: = /sbbs/doors/dos attrib = READ/WRITE
    F: = /sbbs/ctrl attrib = READ/WRITE
    G: = /sbbs/data attrib = READ/WRITE
    H: = /sbbs/exec attrib = READ/WRITE
    I: = /usr/share/dosemu/dosemu2-cmds-0.3 attrib = READ ONLY
    J: = /usr/local/share/comcom32 attrib = READ ONLY
    E:\freedos.com>
    ```


    ```
    E:\freedos.com>set
    USERDRV=C
    SHELLDRV=C
    DOSEMUDRV=I
    FDPP_AUTOEXEC=I:\FDPPAUTO.BAT
    SHELL_ALLOW_EXIT=1
    COMSPEC=E:\FREEDOS.COM\COMMAND.COM
    PATH=I:\dosemu;C:\;E:\dosutils;H:\dosutils
    TEMP=C:\tmp
    ERRORLEVEL=192
    DOSEMU_VERSION=2.0pre9-dev-20220821-376-g026c7e4ed
    DOSEMU_EXIT=1
    DOSEMU_SYS_CMD=D:external.bat
    DSZLOG=D:\PROTOCOL.LOG
    SBBSNODE=D:
    SBBSNNUM=2
    SBBSCTRL=F:
    SBBSDATA=G:
    SBBSEXEC=H:
    PCBNODE=2
    PCBDRIVE=D:
    PCBDIR=\
    STARTDIR=freedos.com
    ```

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Nigel Reed@VERT to GitLab note in main/sbbs on Sun Aug 21 21:16:04 2022
    https://gitlab.synchro.net/main/sbbs/-/issues/433#note_2714

    Download https://www.endofthelinebbs.com/dmdtrv43.zip and see if that'll run under dosemu2.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to GitLab note in main/sbbs on Mon Aug 22 10:32:14 2022
    https://gitlab.synchro.net/main/sbbs/-/issues/433#note_2715

    I don't think the environment variables mentioned in this issue need any change (they already use forward-slashes). From the description, it sounds like only `external.bat` needs to be modified by changing the backslashes to forward-slashes on the following lines:
    ```
    @lredir D: linux\fs$NODEDIR >NUL
    @lredir E: linux\fs$XTRNDIR >NUL
    @lredir F: linux\fs$CTRLDIR >NUL
    @lredir G: linux\fs$DATADIR >NUL
    @lredir H: linux\fs$EXECDIR >NUL
    ```
    Can you confirm making that change would address this issue completely?

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Fernando Toledo@VERT to GitLab note in main/sbbs on Mon Aug 22 10:48:07 2022
    https://gitlab.synchro.net/main/sbbs/-/issues/433#note_2716

    Mhmm at my external.bat generated at node directory when door start use "\\" (backslash) and should be "/".
    I think that by changing that, the redirects will work normally as they do from dosemu1
    I don't know if there is any way to leave it keeping compatibility in both, (now I don't have a dosemu1 to confirm that they would also work with this "new" syntax)

    ```
    $/sbbs/nodes/node3# cat external.bat
    @ECHO OFF
    SET DSZLOG=D:\PROTOCOL.LOG
    SET SBBSNODE=D:
    SET SBBSNNUM=3
    SET SBBSCTRL=F:
    SET SBBSDATA=G:
    SET SBBSEXEC=H:
    SET PCBNODE=3
    SET PCBDRIVE=D:
    SET PCBDIR=\
    SET STARTDIR=zombie
    @lredir D: linux\fs\sbbs\nodes\node3 >NUL
    @lredir E: linux\fs\sbbs\doors\dos >NUL
    @lredir F: linux\fs\sbbs\ctrl >NUL
    @lredir G: linux\fs\sbbs\data >NUL
    @lredir H: linux\fs\sbbs\exec >NUL

    E:

    REM Switch to startup dir, unless its not defined
    REM If not defined, go to node dir (external editors use this)
    IF "%STARTDIR%"=="" D:
    IF NOT "%STARTDIR%"=="" CD %STARTDIR%

    REM Optionally call emusetup.bat or put that stuff here for global (in NOEMU) REM Looks in startup dir, then ctrl dir
    IF EXIST EMUSETUP.BAT GOTO EMULOCAL
    IF EXIST F:\EMUSETUP.BAT GOTO EMUGLOBAL
    IF EXIST E:\DOSUTILS\NUL GOTO NOEMU
    IF EXIST H:\DOSUTILS\NUL GOTO NOEMU
    ECHO ERROR: No emusetup.bat in E:\%STARTDIR% or F, or DOSUTILS is missing
    GOTO EXEC

    :EMULOCAL
    CALL EMUSETUP.BAT
    GOTO EXEC

    :EMUGLOBAL
    CALL F:\EMUSETUP.BAT
    GOTO EXEC

    :NOEMU
    @set PATH=%PATH%;E:\dosutils;H:\dosutils
    REM fossil driver, such as x00, bnu, or dosemu fossil.com
    rem IF "FOSSIL" == "FOSSIL" @fossil.com >NUL
    rem IF "FOSSIL" == "FOSSIL" bnu.com /P1 /L0=11520 >NUL
    IF "FOSSIL" == "FOSSIL" x00.exe eliminate >NUL
    REM share.exe for multinode file locking
    @share >NUL

    GOTO EXEC

    :EXEC
    CALL run.bat

    IF NOT "%1" == "TEST" exitemu


    REM For debugging: /usr/bin/env HOME=/sbbs/ctrl/ QUIET=1 DOSDRIVE_D=/sbbs/nodes/node3/ NODEDIR=/sbbs/nodes/node3/ /usr/bin/dosemu.bin -d /sbbs/nodes/node3/ -d /sbbs/doors/dos -I"video { none }" -I"serial { virtual com 1 }" -f/sbbs/ctrl/dosemu.conf -ED:external.bat -o/sbbs/nodes/node3/dosemu_boot.log
    ```

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to GitLab note in main/sbbs on Mon Aug 22 13:37:51 2022
    https://gitlab.synchro.net/main/sbbs/-/issues/433#note_2717

    Try changing the following in external.bat:
    ```
    @lredir D: linux\fs$NODEDIR >NUL
    @lredir E: linux\fs$XTRNDIR >NUL
    @lredir F: linux\fs$CTRLDIR >NUL
    @lredir G: linux\fs$DATADIR >NUL
    @lredir H: linux\fs$EXECDIR >NUL
    ```
    to this:
    ```
    @lredir D: linux/fs$SBBSNODE >NUL
    @lredir F: linux/fs$SBBSCTRL >NUL
    @lredir G: linux/fs$SBSBDATA >NUL
    @lredir H: linux/fs$SBBSEXEC >NUL
    ```

    Does that fix the issue? Notice the replacement variables (not environment variables) names have changed.

    There is no SBBSXTRN, so I just remove the E: drive mapping. I'm not sure if you need that one.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Nigel Reed@VERT to GitLab note in main/sbbs on Mon Aug 22 13:41:34 2022
    https://gitlab.synchro.net/main/sbbs/-/issues/433#note_2718

    In the dosemu2 release notes for dosemu2-2.0pre7

    Sanitize syntax of lredir2: silly LINUX\FS is no longer needed.

    dosemu2-2.0pre5
    lredir command was deprecated, use lredir2 with the new syntax

    So lredir shouldn't actually be used if you're using dosemu2.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to GitLab note in main/sbbs on Mon Aug 22 14:52:07 2022
    https://gitlab.synchro.net/main/sbbs/-/issues/433#note_2719

    We'd like to use a single default/template external.bat file that works with both dosemu1 and dosemu2.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Nigel Reed@VERT to GitLab note in main/sbbs on Mon Aug 22 20:29:04 2022
    https://gitlab.synchro.net/main/sbbs/-/issues/433#note_2720

    Then you're likely going to need logic in the external.bat file to determine if you're using dosemu1 or dosemu2. If the depreciated features are removed from dosemu2, then it'll stop working altogether.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Nigel Reed@VERT to GitLab note in main/sbbs on Mon Aug 22 20:32:04 2022
    https://gitlab.synchro.net/main/sbbs/-/issues/433#note_2721

    E: should map to your ./xtrn directory so yes, it's needed as part of the external.bat will change to that drive before cd to the directory where the executable is.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Fernando Toledo@VERT to GitLab note in main/sbbs on Tue Aug 23 10:23:23 2022
    https://gitlab.synchro.net/main/sbbs/-/issues/433#note_2722

    this will not work because those variables have the drives letters and not the paths

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Fernando Toledo@VERT to GitLab note in main/sbbs on Tue Aug 23 10:24:13 2022
    https://gitlab.synchro.net/main/sbbs/-/issues/433#note_2723

    Now, i pass the paths via cmdline, so lredir can be ommited

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Fernando Toledo@VERT to GitLab note in main/sbbs on Tue Aug 23 10:25:01 2022
    https://gitlab.synchro.net/main/sbbs/-/issues/433#note_2724

    I agree

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Fernando Toledo@VERT to GitLab note in main/sbbs on Tue Aug 23 10:26:52 2022
    https://gitlab.synchro.net/main/sbbs/-/issues/433#note_2725

    Yeah its needeed. Because is the working path that can change at differents doors.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net