----------------------------- Dave's DosBox Distribution --- updated: Dec-2024
                        https://dunfield.themindfactory.com

Much of my software was written in the fairly early days of personal computers
and runs under DOS. This was great back in the day, but 16-bit DOS software is
not supported on modern 64 bit systems.

Being somewhat of a DOSHEAD, I've found a decent solution!  The DosBox project
provides a nice DOS compatible environment on modern systems.

------------------------------- Quickstart ---------------------------------
Place these files in a directory which will be DosBox "Home". I use: C:\DOSBOX

Go there and run _DBSETUP.BAT to adjust various settings to you taste.

Now you can just go there and run DOSBOX.EXE (or set up a shortcut)

*** Microsoft DIRECT-X sometimes uses an incorrect keyboard mapping with some
*** systems/keyboards - if your keyboard does not work correctly (Right shift
*** not right is a common example), run DOSBOXDX.BAT instead of DOSBOX.EXE
*** This runs DosBox with generic windows I/O instead of DIRECT-X, which
*** resolves most keyboard problems (but has slower video performance)
------------------------------- Included files ------------------------------
    -- DosBox --
    DOSBOX.EXE      DosBox itself
    *.DLL           Needed by DosBox
    DOSBOXDX.BAT    runs DosBox if DDRAW bug
    DOSBOX.INI      configuratuon
    DBSETUP.COM     SEtup tool
    DOSBOX.MAP      key map
    DBPATCH.COM     Tool to patch DosBox
    DOSBOX.DBP      Database for ""
    DBKEYS.COM      Improved tool to set DosBox key map
    NE2000.COM      Ethernet "packet" driver
    DDCM.INI        DaveD CommandMenu config
    _DBSETUP.BAT    Initial setup

    --General Commands--
    ATTRIB.COM      Show file attributes
    BAX.COM         BAtch eXtended
    COMP.COM        Compare files
    CP.COM          Enhanced COPY
    DBSC.COM        DosBox Screen Capture
    DDCM.COM        DaveD CommandMenu
    DDLINK.COM      DavesDataLINK (COM/LPT/LAN)
    DDLHLP.EXE          "" help ""
    DIFF.EXE        Show file differences
    EDT.EXE         Text file editor
    EB.COM          Edit Big files!
    FCB.COM         File Compare Binary
    FCT.COM         File Compare Text
    FIND.COM        Find if files
    FVB.COM         File View Binary
    FVT.COM         File View Text
    INDOSBOX.COM    Test for in DosBox
    KEYSUB.COM      Substitute keycodes (more than map)
    SORT.COM        Sort text file
    TREE.COM        Show directory tree
    TYPE4.COM       Display TXT file with 4-space tabs
    XCD.COM         Enhanced CD (drive & direcrory)
    XCOPY.COM       Copy files(s)/directory(s)
    XDIR.COM        Enhanced DIR (for DosBox)
    XRS.COM         Express Rescan (all drives)
    _PAUSE.COM      Enhanced PAUSE (for DosBox)
    _SUBST.COM      Enhanced SUBST (for DosBox)

    --Documentation--
    DOSBOX.TXT
    DDLINK.TXT
    EDT.TXT
    KEYSUB.TXT

*** Many of my .COM and .EXE will provide command help if run with
    <no operands>, otherwise try: ? -? /? -H /H

NOTE: Although this DosBox does NOT have to be installed, it may leave some
"droppings", like:  \Users\...\AppData\Local\DOSBox\
keep this in mind if you wish to completely remove it later!

If you wish to use networking within DosBox, install WinPcap if you do not
already have it on your system. Available on my site:
    WINPCAP - for Win7-
    W10PCAP - for Win10+

Place the content you wish to show as your C: drive into: \DOSBOX\C

Place any additional commands/utilities that you wish to have available while
running DosBox into the \DOSBOX\Cmds - this will show up in your PATH as a
subdirectry of drive 'Y:' within my DosBox setup.


-------------------------- Additional Information --------------------------
This has a LOT of information, and many people won't want to bother reading
all of it - You may want to at least read the section:
    "DosBox Bugs / Problems" to avoid unnecessary surprises.

*** DosBox-SVN Megabuild6 ***
An older but small(ish) DosBox that has most everything I want.. I've used
this one for years,  given the size and "unwanted extras" in DosBox-X,  I am
likely going to stick with it - at some point I will create my own "fork" to
fix most the the bugs noted below.

This is fundamentally the H-A-L-9000 "Megabuild 6" version which has enhanced
serial/networking support turned on.

Note that the stated intent of the DosBox SVN developers is running DOS games,
and they have no interest in creating a DOS for any other use.   As games are
among the most challenging of applications to run, this means DosBox hardware
compatibility is excellent,  the DOS environment itself has a few limitations
on things not generally needed for gaming.

------------------------------------------------------------------------------
This archive contains "my working" MegaBuild-6

This has been patched to:
  Replace ".conf" with ".INI" to avoid line-filename problem.
  Fix "Filename completion" problem which has causing me data-loss.


Pretty much all of my add-on tools/utilities which I've published in various
places work fine in DosBox, however my DosBox distribution also includes a few
utilities I've created to replace standard DOS commands that are either non-
existant or limited in DosBox.

I've moved many of my DosBox specific utilities programs to a separate archive
called DBUTIL.ZIP which you can download from my site (see below).
------------------------------------------------------------------------------

This package contains a pre-configured DOS emulator (DosBox) which allows DDS
16-bit software to be used under 64bit windows, and provides access to Windows
serial ports and network interfaces within these DOS programs.

This preconfigured DosBox installation includes:

    Drive C: for virtual C drive
    Drive R: for temporary storage (I use a RAMdrive)
    Drive Y: for access to DosBox home directory
    Drive Z: for DosBox internal commands
    COM1 serial port (works with USB serial ports etc.)
    COM2 serial port ""
    COM3 "null modem" (useful to talk to other instanced of DosBox)
    NE2000 packet driver (requires WinPcap)

The system should basically work "as is" with simple video.

Information on manually configuring the needed parameters in DOSBOX.INI is
provided under "additional notes" in the relevant sections.
DosBox notes:

DosBox is a Win32 DOS emulator, use it to:

 - Run 16-bit DOS applications under 64 bit windows.

 - Access windows COM ports from DOS programs.

 - Emulate DOS network, sound, video and other hardware which is not
   available in native windows DOS emulator.


This version of DosBox can be run from a USBstick (or CD) without installing
it or modifying the host system. (You may want to use SUBST to fake some
drive locations)

 - Double click the "dosbox.exe" file - this will start DosBox, you
   should see two windows open on your screen. One is the "console"
   window, and the other will contain the DOS command prompt.

 - There is always a default 'Z' drive which contains internal DosBox
   commands. Additional "drives" may be auto-mounted by the AUTOEXEC
   section of DOSBOX.INI (see below). Examine Z:\AUTOEXEC.BAT to see
   the startup commands.

 - You can mount directories from your system with the MOUNT command:
        MOUNT E D:\     <= Mount the CD (assuming D:) as drive E:
        E:              <= Switch to drive E:

 - You can now access the commands and utiltiies from the CD. If you
   need to access directories from your local system hard drive, you
   can mount them as well: MOUNT F c:\tmp   <= Mount C:\tmp as drive F:


Additional notes:

See DOSBOX.TXT for more information about DosBox. You can also visit
the official DosBox web site at: www.dosbox.com
and H-A-L-9000's site at: http://home.arcor.de/h-a-l-9000
** The H-A-L-9000 page appears to be no longer available **

The file 'DOSBOX.INI' contains the DosBox configuration - it's a TXT file,
and contains comments describing the various configuration options that are
available.  You can modify DosBox.INI with any text editor.

You can further modify the keyboard map (or create your own completely new map)
using the DosBox interactive mapper by pressing:
    Ctrl+Alt+Shift-F1   (my map)

NOTE: I have found the keymapper hit-and-miss ... sometimes modifiers seem
tied to physical keys, and therefore modifications are ignored or never work.
- it can take a bit of experimentation to find a setup that is workable
- keep a backup of DOSBOX.MAP
Also note that the mapper only works on scancodes, which means you can't remap
only certain modes (Shift, Ctrl, Alt) of keys, and you can't remap a key to a
function invoked by a key at a different mode.   See my KEYSUB for a solution!


-- Cycles
I have had DosBox lock up on a Win7-64 system when 'cycles=max' is set in
DOSBOX.INI under [CPU] - changing this to a fixed number prevents the problem!


-- Refreshing Directories
DosBox does not automatically see changes made to mounted directories on
the host system (ie: if you create new files on the host, DosBox will not
see them until the next time the drive is mounted). To see files changed
outside of DosBox, type 'rescan' to refresh the directory cache.
NOTE: 'rescan' only refreshes the currently CD'd disk.


-- Function keys
MegaBuild-6 defaults to a mix of Ctrl and Alt modifiers on various keys to
access it's internal features, which can interfere with some DOS programs that
use Ctrl and Alt as modifiers for function keys. To alleviate this problem, I
have provided DBKEYS.COM which can be run from the DosBox command prompt, and
manipulates the DosBox keymapper file DOSBOX.MAP - see: DBKEYS (no arguments)

NOTE: DOSBOX.INI must contain the [sdl] line: mapperfile=DOSBOX.MAP

You can further modify the keyboard map (or create your own completely new map)
using the DosBox interactive mapper by pressing:
    F11-M


-- Serial ports
I've preset a DOS COM1 and COM2 to windows COM1 & COM2
You can change this assignment from the DosBox console, example:

 eg: serial2=directserial realport:COM5

This changes DOS serial port 1 (COM1) to reference windows serial port COM5.

I have also preset COM3 to invoke a "null modem" network connection.


-- Parallel Ports
If you wish to use "real" parallel ports in DosBox, you need to install the
"PortTalk" I/O driver:  (available on my web site).

    Copy PortTalk.SYS to your windows system32\drivers directory.
    Double-click PortTalk.REG to install the registry entries.

You will now be able to configure DosBox "real" parallel ports which will pass
through to the physical system ports:

    parallel1=reallpt realbase:378

Assigns LPT1 as a real port, using the hardware parallel port at address 0x378.

If you wish, you can remove the PortTalk driver by running 'portoff.exe'.

There are reports that PortTalk does NOT work under Vista/Win7/Win64.


-- Networking
If you wish to use networking in DosBox, you will need to install the windows
packet capture library (WINPCAP or W10PCAP)  on your PC.
NOTE: This is NOT required unless you intend to use DOS networking.

To see a list of available network devices in DosBox:
    type: realnic list  (at DosBox command line)
    This will show the network devices in the DosBox status window
  Note: Main DosBox working window openes in front of the status window!

Select network device from the list, and set the "realnic=" line is DOSBOX.INI
to that value (you can use DBSETUP).

This will enable a virtual NE2000 network card in DosBox which is bridged
to the indicated physical network device.

I have included a DOS NE2000 packet driver.  Within DosBox, go to Y:\,
and load the NE2000 packet driver with: NE2000 0x60

NOTE: I have found the NE2000 emulater network interface not 100% reliable.
Some programs which do raw packet networking work ultra reliably under real
DOS, but sometimes the emulated NE2000 under DosBox just stops accessing
the network.

------------------- DosBox Bugs/Problems -------------------
--- Long Filenames:

There is an issue with Long Filename compatibility under DosBox.
DosBox does not use the "short" versions of Long Filenames generated by
Windows, instead it generates it's own names when it loads and scans a
directory.

This is often - but NOT ALWAYS correct. For example:
Under windows command shell, perform:

    echo 1 >Longfile1.file
    echo 2 >Longfile2.file
    echo 3 >Longfile3.file
    del Longfile2.file

As expected, this leaves two files, which are:

    Long-Name       Short-Name      Content
    --------------  ------------    -------
    Longfile1.file  LONGFI~1.FIL    1
    Longfile3.file  LONGFI~3.FIL    3

Now, if you run DosBox and look, you will find two files:

    Name            Content
    ------------    -------
    LONGFI~1.FIL    1
    LONGFI~2.FIL    3

Note the discrepancy between the Windows short name vs the DosBox
name of the file containing '3'.

For these reasons you cannot trust DosBox names for long filenames to be the
same as the Windows short name, and for the DosBox names not to change from
time to time.

Another problem is that DosBox doesn't know about certain characters which
are allowed in windows long filenames, but NOT in DOS/SHORT filenames. For
example try (within windows):

    echo >"A,B,C"

Windows will create this file, and since ',' is not valid in a DOS
filename, will assign it the short name (seen with DIR/x): "A_B_C~1".

DOSBOX will see it as "A,B,C" but cannot access that name. You do have some
access if you know the windows short filename "A_B_C~1" but you see the wrong
name in DIR listings. You can open/read/write with the windows short name,
but you cannot delete the file.
You can however rename it to something you can delete.


--- Filename completion:
** I have fixed this problem in my edition SVN_MB6/DD however it has existed
** in ALL other editions of DosBox that I've seen!

DosBox has a nice feature (borrowed from Windows) where it will auto-
complete filenames on the command line if you press TAB - and if there
are more matching names, you can keep pressing TAB to cycle through them.

This can be quite nice, but it has a bug. It works properly if the filename
is preceeded by spaces or the directory seperator '\' (in this case it does
complete from the preceeding directory name and leaves it on the command
line so you get the full filename).

The problem occurs if you are accessing files from the current directory
on another drive - with the <drive>: preceeding the name.   DosBox does
correctly complete from the current directory on the selected drive, but
it REMOVES the <drive>: prefix. The resulting name is that of a file on
the other drive, but entered like any other local file. Most commands will
try to access this file from the current directory on the currently
selected drive.

A good work-around to access files on another drive without having to enter
the whole directory path is to use "<drive>:.\" as the prefix.  This lets
DosBox know it's a directory reference and it keeps it.


--- RENAME seems to work when it doesn't:

Rename will produce the exact same console output (none) when it fails (due
to new file already existing or bad new name), as it does when it works.
You don't seem to automatically lose anything, but you can if for example
you rename an old file before copying a new one over the old name.
When rename fails you overwrite the original file.


--- Control-C does not work within DOS ---

Many programs run under DosBox handle Control-C in their own, but DosBox does
not. Prime examplem when writing/debugging a more complex .BAT file, I often
add 'pause' to stop, see if the output looks ok, and if not, press Control-C
to halt the batch file. This does NOT work under DosBox, nor can you halt it
if the batch file is looping "forever".

To help with this, I have provided _PAUSE.COM, a program that works like
'pause' but sets the ERRORLEVEL based on key pressed. It can also use ESC to
completely restart DosBox and put you back where you were (there is no other
way to asynchronously stop a .BAT file).


--- 0x1A text EOF is not handled

In normal DOS,  you can have a text file ending with 0x1A followed by some
binary content.     If you "type" the file, you will only see text portion
because TYPE stops if it sees 0x1A the end-of-text indicator.  DosBox does
not recognize this and happily continues trying to send the binary data
to the console.  I do not know what other DosBox things are affected by
this, but TYPE shows it quite well.


--- Setting timestamp:

DosBox does NOT support INT 21h, function 5701h which sets the timestamp on
an open file. It appears to work, but the file timestamp does not change.
This can play havoc in file copy/backup programs which try to conserve the
timestamp of copied files.

This even affects the built in COPY command.


-- Open/WRITE to file opened READ in not blocked:

If you open a file for write that is already open for read, standard DOS
will not allow this. But DosBox does (and zeros it), and it can cause you
to lose data if you accidently try to copy a file to itself.

This might seem very unlikey to happen, but with the preceeding bug (Filename
completion), it has happened to me a LOT and I have lost data.  Consider:
- You have MYPGM.C - a complex C source file.
- To try some tricky changes on it, you copy it to your R:\ ramdisk and
  work on it there.
- You make the changes, they work - so you want to copy the new version
  back over the original.
- From C drive, you enter           : copy R:MY<tab> to complete the name>
- Due to above bug, DosBox uses     : copy MYPGM.C
  which copies it to itself and zero's it...  But everything seemed to work,
  and if you fail to notice it before shutting the system/ramdisk down you
  will lose both copies.  I've had to get used to using my COMP command to
  compare the two files after I copy them.

I have provided CP, a slightly improved COPY which resolved some of the
problems with copying files.


--- MOUNT does not report full paths ---

Some of my utilities use the output of 'MOUNT' to work out the relationship
between DosBox drives/files and the actual Windows host drives/files.   This
works well if you MOUNTed the drive using a full path, however DosBox 'MOUNT'
only shows what was passed as an operand, not the actual path to the mounted
directory. eg: if you use: MOUNT C .\C
to mount the C subdirectory under the DosBox installation, 'MOUNT' would show:
    Drive C is mounted as local directory .\C\
This can cause trouble when figuring out where the file is actually located on
the host. If however you had used: MOUNT C C:\DOSBOX\C  - 'MOUNT' would show:
    Drive C is mounted as local directory C:\DOSBOX\C
This is why I always use full paths when mounting DosBox drives.


--- Subtle file accessing differances:

I haven't nailed this down further, but under DosBox, TASM gives a Fatal
error that it can't open the .OBJ file if it already exists.   This does
NOT happen under real DOS or WinXP command shell,  so there is obviously
a difference in how the file can be accessed under DosBox.


Dave Dunfield   -   https://dunfield.themindfactory.com
