DOSBox-X

DOS specific questions.
Post Reply
fatman2021
Posts: 215
Joined: Dec 14, 2013 0:43

DOSBox-X

Post by fatman2021 »

As a cross-platform DOS emulator, DOSBox-X has the eventual goal of being a complete DOS emulation package. Apart from having virtually all existing features of DOSBox, DOSBox-X supports much more. Examples of DOSBox-X’s unique features include:
GUI drop-down menu for easier usage
DOSBox-X features a drop-down menu system so that you can do many things from the GUI menu instead of typing commands or so.
Built-in graphical configuration tool
You can configure DOSBox-X‘s settings directly from its built-in GUI configuration tool instead of having to manually modify its config file.
Save and load state support (with save slots)
DOSBox-X provides a fully-featured system for saving and loading states with support for up to 100 save slots, selectable from the menu.
Automatic drive mounting (Windows only)
DOSBox-X will automatically let you mount a drive if you try to enter a drive which is not yet mounted, and you can also let DOSBox-X automatically mount all available Windows drives at start.
Japanese NEC PC-98 mode emulation
With DOSBox-X you can now run PC-98 and its games. Set machine=pc98 in the config file to start DOSBox-X in PC-98 mode.
More customizable virtual machine
DOSBox-X provides many more config options that are not found in DOSBox, so that users have more options to customize the virtual machine inside DOSBox-X.
CPU speed optimization and Turbo mode
DOSBox-X can automatically decide the CPU cycles to use for optimized speed, and it provides a Turbo function to increase the speed of the system inside it.
Improved customization on the title bar
DOSBox-X allows you to modify or customize the strings and additional contents displayed in its title bar and its appearance.
Better compatibility with DOS applications
Aimed to be a complete DOS emulation package, DOSBox-X officially supports DOS applications, not just DOS games. All types of DOS programs are officially supported in DOSBox-X.
Improved Windows 3.x and Windows 9x emulation
One of DOSBox-X’s main goals is to become a great platform to run Windows 3.x and 9x and their software. As a result we have made several improvements to their emulations.
Built-in external tools such as CWSDPMI, DOSIDLE and IMGMAKE
DOSBox-X has many useful tools already built-in, such as CWSDPMI, DOS4GW, DOSIDLE and IMGMAKE, which will appear on its Z: drive.
Support for more DOS commands (e.g. VOL, LABEL, ATTRIB, PROMPT, MOUSE)
DOSBox-X includes many DOS commands that are missing in DOSBox, such as FOR, VOL, LABEL, ATTRIB, PROMPT, EDIT, FIND, and MOUSE.
Support for CONFIG.SYS commands (e.g. DOS, DEVICE, FCBS, FILES, LASTDRIVE)
DOSBox-X supports a [config] section that supports most DOS config.sys commands, such as COUNTRY, DEVICE, DOS, FCBS, FILES, INSTALL, LASTDRIVE, NUMLOCK, SET, and SHELL.
Support for 4DOS as the alternative shell with 4DOS 8.00 features and capabilities
You can set SHELL=4DOS.COM so that DOSBox-X will run the 4DOS 8.00 shell at start instead of the default shell.
Support for the IDE interface for disk images
DOSBox-X supports the BIOS IDE interface for hard disk and CD drives, which is especially useful for running guest systems inside DOSBox-X.
Support for more CPU types (e.g. Pentium MMX and Pro)
DOSBox-X supports virtually all CPU types prior to Pentium II at this time, from 8086 to Pentium Pro, including support for Pentium MMX instructions.
Support for more video modes (e.g. MDA and MCGA)
DOSBox-X supports more video modes in addition to the more common ones, such as MDA, MCGA, Amstrad, and a few others.
Support for printer output, either a real or virtual printer
DOSBox-X supports parallel ports and printers attached to them, whether they are real printers or emulated printers for PostScript or PNG outputs.
Support for long filenames (LFN) in addition to 8.3 filenames
DOSBox-X fully supports long filenames (LFN) which can be up to 255 characters, not just 8.3 names. Set either ver=7.1 or lfn=true in the config file to enable this feature.
Support for FAT32 file system and large disk images
FAT32 file system is supported in DOSBox-X in addition to FAT12 and FAT16, so you can make and mount drives larger than 2GB. Set ver=7.1 to enable this feature.
Support for clipboard copy and paste (Windows only)
With DOSBox-X there are several ways to copy and paste between DOSBox-X and the Windows clipboard, such as using the right mouse button or using a special device for it.
Support for converting mouse wheel movements to arrow keys
You can let DOSBox-X automatically convert mouse wheel movements to arrow keys, so that you can use the mouse wheel for scrolling in DOS applications.
Support for starting programs to run on the host (Windows only)
It is possible to launch a Windows application from inside DOSBox-X to run on the Windows host, either using START command or run it directly from the shell. Set startcmd=true to enable this feature.
Support for quick-launch programs to run inside DOSBox-X (Windows only)
DOSBox-X lets you use the Windows file browser to select a DOS program to quickly run inside DOSBox-X, and file associations for DOS programs are supported for the Windows Explorer as well.
Support for setting config options from the DOSBox-X command line
DOSBox-X allows you to set one or more config options from the DOSBox-X command line, overriding any preset config options that may be specified in the config file. For example, dosbox-x -set machine=pc98 forces DOSBox-X to start in PC-98 mode.
Support for Ctrl+C/Ctrl+Break in the shell and many commands
You can press the Ctrl+C or Ctrl+Break key to break from the current operation when running in the shell and many internal or external commands.
Support for cue sheets with FLAC, MP3, WAV, and OGG Vorbis CD audio tracks
With DOSBox-X it is possible to mount .cue files that include FLAC, MP3, WAV, and OGG Vorbis music as CD audio tracks.
Support for 3dfx Voodoo chip and Glide emulation
DOSBox-X can emulate the 3dfx Voodoo in either the low-level emulation mode (emulating the 3dfx Voodoo 1 hardware) or the high-level emulation mode (where the Glide API calls are passed through to the host OS).
Support for NE2000 Ethernet for network features
DOSBox-X supports the emulation of the Novell NE2000 network adapter, which allows you to connect to the Internet from inside DOSBox-X, such as a guest Windows 9x system running with DOSBox-X.
Support for phone book mapping for the emulated modem
With this feature you can map fake phone numbers to Internet addresses which is useful for programs where limitations on phone number input field are too strict.
Support for Roland MT-32 emulation
DOSBox-X integrates the emulation of Roland MT-32, which pre-dates General MIDI and was used by a broad range of DOS games (starting in 1988 with King’s Quest IV).
Support for FluidSynth MIDI synthesizer with sound fonts
DOSBox-X supports the FluidSynth MIDI synthesizer, which allows you to use a wide range of sound fonts available online, such as the free FluidR3_GM.sf2.
Support for Innovation SSI-2001 sound card emulation
The Innovation SSI-2001 sound card is supported in DOSBox-X as well, which gives the emulated system the sound capabilities of a Commodore 64.
Support for advanced OpenGL features such as OpenGL-HQ and GLSL shaders
Advanced OpenGL features including OpenGL-HQ and GLSL shaders are supported by DOSBox-X, and you can use for example the pixel-perfect shader for OpenGL outputs.
Support for Direct3D with pixel shaders (Windows only)
DOSBox-X supports Direct3D along with pixel shaders which provides many more output flexibilities on Windows systems.
Support for features such as V-Sync, overscan border and stereo swapping
Improved debugging features including built-in debugger and logging options
Including most patches from DOSBox ECE and many community contributions
Plus many more
DOSBox-X also includes a lot of gimmicks and usability improvements to make DOSBox-X easier to use and work better for users.

https://dosbox-x.com/
Richard_
Posts: 15
Joined: Mar 03, 2019 4:09

Re: DOSBox-X

Post by Richard_ »

I have installed FreeBASIC 1.09 DOS version and cannot seem to be able to compile a simple program in DOSBox-X (JAN 2022 build Windows 10x64). Running

fbc my.bas

results in error

Warning: cannot open swap file c:\cwsdpmi.swp


My installation of FreeBASIC (dos) is on the A:\ drive.

I think that Windows defender is the issue - any way to change the path for cwsdpmi.swp (e.g. to A:\) or any suggestions?
marcov
Posts: 3454
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: DOSBox-X

Post by marcov »

From the manual that comes with cwsdpmi 5:
manual wrote: 3) The file used for virtual memory swapping, if desired, is controlled
by the "-sc:\cwsdpmi.swp" syntax on the command line. You must specify
either a file with full disk/directory syntax, or "-s-" which disables
virtual memory.
Richard_
Posts: 15
Joined: Mar 03, 2019 4:09

Re: DOSBox-X

Post by Richard_ »

@marcov

Thanks for reply.

I downloaded/installed cwsdpmi (later discovered this is part of DOSBox-X) and applied -s switch to disable swp file and I was able to compile very small test program which worked.

However with somewhat larger programs (aaa.bas about 24K bytes) I got the message


...\fbDOS\lib\dos/libc.a: error adding symbols: Memory exhausted

using MEM, simple summary is:-

Conventional (free) 619K
Upper (free) 77K
XMS (free) 14,912 K
largest executable size 619K
Windows is resident in high memory area.

Although it may be silly to mention here, but FreeBASIC x32 / x64 produces aaa.exe

180,224 / 190,976 bytes respectively,

so I would gather that a DOS .exe would be no larger than this (and so is less than 619K).

A while ago when using FreeBASIC DOS version on bare metal machine for aaa.bas - the program compiled successfully (on bare metal).

I am at present waiting for a reply from the DOSBox-x forum on this (only posted very recently) but I think now that cwsdpmi (being part of DOSBox-X) does not seem to be able to have cwsdpmi settings changed (at least I cannot see how to do this). With my (redundant) installation of cwsdpmi the -s switch appears to be performed (since I could compile very small test program) but by not having a swp file it appears to run out of memory for somewhat larger programs. Also with my installation of cwsdpmi, the relocation of the swap file to say A:\cwsdpmi.swp does not appear to work at all.

So I suppose this is a DOSBox-X problem (and NOT a FreeBASIC poblem) - but I hope someone here can help (just in case DOSBox-X forum cannot help) for the problem of compiling larger programs using FreeBASIC DOS version running inside DOSBox-X on windows 10 x64.
marcov
Posts: 3454
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: DOSBox-X

Post by marcov »

First, as 32-bit programs, Dos protected mode (go32) EXEs can be larger than the minimal executable size. IOW they use that XMS too.

Second the amount to create the exe and the final size are not related. Specially linkers can be quite memory hungry.
Richard_
Posts: 15
Joined: Mar 03, 2019 4:09

Re: DOSBox-X

Post by Richard_ »

@marcov

Thanks for your reply.

I did not realize linkers would be quite memory hungry even for very small programs (just a couple of lines of code).

Using the above statement as a starting point I experimented with some settings in DOSBOX-x (FEB 28 2022 build) and also tried a few other changes to my set-up.

Even though DOSBOX-x apparently has CWSDPMI built in - I had previously manually run in the DOSBOX-x CMD line CWSDPMI.exe (but originally used version 7 which apparently is version 7a (21,235 bytes). I changed over to version 7b (25,920 bytes).

I discovered that by changing dosbox-x.conf to have

memsize = 1024

and running mem the output is




Code: Select all


Conventional Memory Detail:

Segment        Total           Name           Type
-------  ----------------  ------------  -------------
  0000      1,024    (1K)                interrupt vector table
  0040        768    (1K)                BIOS data area
  0070      6,848    (7K)  IO            system data
                             NUL         system device driver
                             CON         system device driver
  021c     11,824   (12K)  DOS           system code
  0500      1,152    (1K)  MEM           environment
  0549     55,248   (54K)  MEM           program
  12c7    578,416  (565K)                free

Upper Memory Detail:

Segment        Total           Name           Type
-------  ----------------  ------------  -------------
  a000    180,224  (176K)                reserved
  cc00        720    (1K)  COMMAND       environment
  cc2e      2,464    (2K)  COMMAND       program
  ccc9     78,688   (77K)                free

Memory Type         Total      Used       Free
----------------  --------   --------   --------
Conventional          640K        21K       619K
Upper                  80K         3K        77K
Reserved              304K       304K         0K
Extended (XMS)   1,047,552K       448K 1,047,104K
----------------  --------   --------   --------
Total memory     1,048,576K       776K 1,047,800K

Total under 1 MB      720K        24K       696K

Total Expanded (EMS)                  512M (536,854,528 bytes)
Free Expanded (EMS)                   512M (536,854,528 bytes)

Memory accessible using Int 15h         0K (      0 bytes)
Largest executable program size       619K (633,680 bytes)
Largest free upper memory block        77K ( 78,704 bytes)
Windows is resident in the high memory area.







The default memsize = 16 is where I had my problems.


I have tested some very small FreeBASIC DOS programs of mine and although I still get the warning message CWSDPMI.swp file not found - I can (so far) successfully get to the compiled .exe file.


I may not actually need such a large value (1024 which gives 512 Mbytes Total Expanded memory) but my priority is to have a WORKING and USABLE setup for DOSBOX-x 2022-FEB-28 + FreeBASIC DOS version 1.09.




So this reply is PRELIMINARY results on my addressing my original problem at hand (normally I would rather wait after many months of testing before replying).




By the way, how can I change the font for this forum to be say COURIER as a mono-spaced font would be needed to have columns lining up etc (e.g. refer to display of MEM output quoted above).
Last edited by Richard_ on Mar 08, 2022 8:38, edited 1 time in total.
SARG
Posts: 1756
Joined: May 27, 2005 7:15
Location: FRANCE

Re: DOSBox-X

Post by SARG »

Richard_ wrote: Mar 08, 2022 4:31 By the way, how can I change the font for this forum to be say COURIER as a mono-spaced font would be needed to have columns lining up etc (e.g. refer to display of MEM output quoted above).
You can use code tags, the button </>

Code: Select all

asm
	sub rax,rax
	sub qword ptr [rbp],rax
	sub [rax],rdx
	sub test[rip],rax
	sub 12[rbp],rax
End Asm
Richard_
Posts: 15
Joined: Mar 03, 2019 4:09

Re: DOSBox-X

Post by Richard_ »

@SARG

Thanks for tip - have edited the format and now the columns line up!
marcov
Posts: 3454
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: DOSBox-X

Post by marcov »

Richard_ wrote: Mar 08, 2022 4:31 @marcov

Thanks for your reply.

I did not realize linkers would be quite memory hungry even for very small programs (just a couple of lines of code).
Did you check the size of that libc.a ? Now check the size of the .o file generated for your program.

Note that sometimes disabling smartlinking (-gc-sections and the like)options can reduce linker memory usage. So if you want small exes, you need large linker memory.
Richard_
Posts: 15
Joined: Mar 03, 2019 4:09

Re: DOSBox-X

Post by Richard_ »

@marcov

Now that I have a somewhat usable DOSBOX-x configuration, I compiled my original bare metal DOS program AAA.BAS (27,384 bytes) which uses a Q3 type display. Below are relevant details:-

Code: Select all


fbc aaa.bas -C -R -map aaa.map
.

 Volume in drive G is SATARED
 Volume Serial Number is 722E-706E
 Directory of G:\DOS\Programs

AAA      ASM            116,197 03-08-2022  8:01p aaa.asm
AAA      BAS             27,384 11-08-2020  6:12p aaa.BAS
AAA      EXE            282,112 03-08-2022  8:01p aaa.exe
AAA      LOG                137 03-08-2022  9:42p aaa.log
AAA      MAP            253,436 03-08-2022  8:01p aaa.map
AAA      O               25,008 03-08-2022  8:01p aaa.o
    6 File(s)           704,274 Bytes
    0 Dir(s)     69,324,144,640 Bytes free
.

 Volume in drive G is SATARED
 Volume Serial Number is 722E-706E
 Directory of G:\DOS\Programs\lib\dos

LIBC     A              999,162 01-01-2022  1:51p libc.a
    1 File(s)           999,162 Bytes
    0 Dir(s)     69,324,144,640 Bytes free




I will soon try changing compiling options as you mentioned - but first I want to ty to fix up my program (if at all possible) to work with DOSBOX-x - I suspect that the Q3 display (3200 x 1800) which works in bare metal mode (but only with ~240 colors) may not be compatible with DOSBOX-x emulation.
Post Reply