====== How to set up dosemu2, FreeDOS, and lDebug ====== I got to set up the lDebug development environment on a new Debian 12 installation on the amd64 machine. (The SSD seems to have caused crashes recently, and it had the root file system of the prior Debian installation.) Here's how I installed dosemu2 (from source), FreeDOS (from packages plus my recent kernel and FreeCOM builds), and lDebug (from assembly source). ===== Install needed packages ===== Install the following packages using synaptic: (many based on [[https://github.com/dosemu2/dosemu2/blob/3b250d8d029b0eba7a85a8271ad6cceb32fb54e5/INSTALL|dosemu2's current INSTALL file]]) * git * gitk * gcc * autoconf * bison * flex * libjson-c-dev * libc6-dev * libfluidsynth-dev * libsdl2-dev * libslang2-dev * libslirp-dev * libgpm-dev * alsa-oss * alsa-tools * ladspa-sdk * libao-dev * libudev-dev * libxext-dev * make * gawk * libbsd-dev Install these packages too: * mercurial * diffuse * mercurial-crecord * tortoisehg * tortoisehg-caja * mtools * halibut * nasm * dos2unix * qemu-system-x86 * python3-tqdm (needed for install-freedos) * clang (needed to build lzsa) * lrzsz * picocom * socat ===== Clone repos ===== Clone the following from the directory ''~/proj'': * ''hg clone https://hg.pushbx.org/ecm/ldebug'' * ''hg clone https://hg.pushbx.org/ecm/lmacros'' * ''hg clone https://hg.pushbx.org/ecm/ldosboot'' * ''hg clone https://hg.pushbx.org/ecm/inicomp'' * ''hg clone https://hg.pushbx.org/ecm/bootimg'' * ''hg clone https://hg.pushbx.org/ecm/crc16-t'' * ''hg clone https://hg.pushbx.org/ecm/symsnip'' * ''hg clone https://hg.pushbx.org/ecm/mktmpinc'' * ''hg clone https://hg.pushbx.org/ecm/tellsize'' * ''hg clone https://hg.pushbx.org/ecm/tractest'' * ''hg clone https://hg.pushbx.org/ecm/instsect'' * ''hg clone https://hg.pushbx.org/ecm/scanptab'' * ''git clone https://github.com/emmanuel-marty/lzsa'' * ''git clone https://github.com/dosemu2/dosemu2'' * ''git clone https://github.com/dosemu2/install-freedos'' ===== Building dosemu2 ===== Enter directory ''~/proj/dosemu2'' and run: ./autogen.sh ./default-configure --disable-fdpp make sudo make install ===== Set up DOS ===== Make directory ''~/.dosemu/drive_c'' and download: * ''wget https://pushbx.org/ecm/download/freecom.zip'' * ''wget https://pushbx.org/ecm/download/fdkernel.zip'' * ''unzip freecom.zip command.com'' * ''unzip -j fdkernel.zip bin/kernel.sys'' * ''unzip -j fdkernel.zip bin/sys.com'' Enter directory ''~/proj/install-freedos/'' and enter commands: (Probably not all needed, this is just what worked for me.) cd src ./dosemu-downloaddos -o freedos13 ./dosemu-downloaddos -o freedos13userspace ./dosemu-setupfreedos ./dosemu-installfreedosuserspace In directory ''~/.dosemu/drive_c'' create symlinks: ln -s ../command.com bin/command.com ln -s ../sys.com bin/sys.com Enter directory ''/usr/local/share/dosemu/dosemu2-cmds-0.3/'' and run: cp -ia fdppconf.sys ~/.dosemu/drive_c/fdconfig.sys cp -ia fdautoem.bat ~/.dosemu/drive_c nano ~/.dosemu/drive_c/fdconfig.sys nano ~/.dosemu/drive_c/fdautoem.bat Contents of file ''fdconfig.sys'' edited to read: device=d:\dosemu\umb.sys devicehigh=d:\dosemu\ems.sys SWITCHES=/F DOS=UMB dosdata=umb fileshigh=128 lastdrive=Z rem emufs.sys /all replaces emufs.com devicehigh=d:\dosemu\emufs.sys /all devicehigh=d:\dosemu\cdrom.sys set SHELL_ALLOW_EXIT=1 shellhigh=c:\command.com /p:fdautoem.bat Contents of file ''fdautoem.bat'' (not edited): @echo off rem autoexec.bat for DOSEMU + FreeDOS path d:\dosemu rem this is needed when booting from dosemu-freedos-bin if exist f:\gnu\nul path %PATH%;f:\bin;f:\gnu if exist c:\bin\nul path %PATH%;c:\bin set HELPPATH=f:\help if exist c:\help\nul set HELPPATH=c:\help if exist e:\tmp\nul call swapdrv.bat c: e: set TEMP=c:\tmp if not exist %TEMP%\nul mkdir %TEMP% emusound -e emumouse c 1 prompt $P$G rem uncomment to load another bitmap font rem lh display con=(vga,437,2) rem mode con codepage prepare=((850) f:\cpi\ega.cpx) rem mode con codepage select 850 rem chcp 850 echo Welcome to dosemu2! system -s DOSEMU_VERSION echo Build %DOSEMU_VERSION% call exechlp.bat -ep ===== Build and configure lDebug ===== Setup ''~/.hgrc'' In ''~/proj/lzsa'' run ''make'' and symlink ''lzsa'' executable into path. In ''~/proj/tellsize'' compile program and place executable ''tellsize'' in path. In ''~/proj/ldebug/source'' copy ''cfg.sh'' to ''ovr.sh'' and edit line setting ''INICOMP_METHOD'' to set it to only ''lzsa2''. Build several lDebug builds: ./mak.sh ./makerd build_name=cdebugx build_options="-D_DEBUG -D_DEBUG_COND -D_PM" ./mak.sh build_name=cdebug build_options="-D_DEBUG -D_DEBUG_COND -D_PM=0" ./mak.sh Enter directory ''~/.dosemu/drive_c/bin'' and create symlinks: ln -s ../../../proj/ldebug/bin/ldebug.com ln -s ../../../proj/ldebug/bin/ldebugu.com ln -s ../../../proj/ldebug/bin/lddebugu.com ln -s ../../../proj/ldebug/bin/lddebug.com ln -s ../../../proj/ldebug/bin/lcdebug.com ln -s ../../../proj/ldebug/bin/lcdebugu.com ln -s ../../../proj/ldebug/bin/lcdebugx.com Create a configuration with the following contents (also in ''~/.dosemu/drive_c/bin''): @:applicationstartup @:devicestartup @install getinput @?version Using these commands: nano ldebug.sld ln -s ldebug.sld lcdebug.sld ln -s ldebug.sld lddebug.sld ===== Final set up ===== In DOS run ''sys config c:\kernel.sys checkdebugger=1'' Symlink ''~/.dosemu/drive_c/rxdos.com'' to an lDebug executable in order to bootload the debugger. ===== Open question ===== This is the output of booting (''dosemu -t''): dosemu2 2.0pre9-dev-20230704-1320-g3b250d8d0 Configured: 2023-07-06 10:08:54 +0000 Get the latest code at http://dosemu2.github.io/dosemu2 Submit Bugs via https://github.com/dosemu2/dosemu2/issues Ask for help in mail list: linux-msdos@vger.kernel.org This program comes with ABSOLUTELY NO WARRANTY. This is free software, GPL v2 (or any later version) distribution conditions. FreeDOS kernel - GIT (build 2043 OEM:0xfd) [compiled Jul 3 2023] Kernel compatibility 7.10 - GNUC - FAT32 support (C) Copyright 1995-2022 Pasquale J. Villani and The FreeDOS Project. All Rights Reserved. This is free software and comes with ABSOLUTELY NO WARRANTY; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. C: HD1, Pri[ 1], CHS= 0-1-1, start= 0 MB, size= 2000 MB D: HD2, Pri[ 1], CHS= 0-1-1, start= 0 MB, size= 2000 MB dosemu XMS 3.0 & UMB support enabled UMBs unavailable! dosemu EMS driver rev 0.9 installed. UMBs unavailable! EMUFS host file and print access available dosemu CDROM driver installed (V0.2) FreeCom version 0.85a - GNUC - XMS_Swap [Mar 31 2023 23:40:37] BLASTER=A220 I5 D1 H5 P300 T6 MIDI=SYNTH:2 MAP:E MODE:0 Welcome to dosemu2! Build 2.0pre9-dev-20230704-1320-g3b250d8d0 C:\> I don't know what exactly displays the two "UMBs unavailable!" lines and why. If I boot into the debugger then enter ''boot protocol freedos'' then ''q'', these lines do not appear. Regardless whether they appear, DOS UMBs are set up and used properly. {{tag>dosemu2 freedos ldebug heatshrink}} ~~DISCUSSION~~