Installing FreeDOS in 86Box: A step-by-step guide

The place to ask for technical support and offer assistance
Post Reply
User avatar
MrFlibble
Forum Administrator
Posts: 1808
Joined: December 9th, 2010, 7:19 am

Installing FreeDOS in 86Box: A step-by-step guide

Post by MrFlibble »

86Box with FreeDOS offer an interesting alternative to DOSBox. 86Box accurately emulates x86 hardware, which may provide advantages when running certain games at a consistent speed or without glitches.

Since I found no useful guide for installing FreeDOS in 86Box, I had to figure it out myself. It's generally a very simple procedure, but there are a few not very intuitive steps that you need to take in order for the installation to work.

Please note that this guide applies to the current versions of 86Box (4.0.1 [build 5111]) and FreeDOS (1.3) as of the time of writing. Future revisions of either may introduce changes that will make this guide less accurate. The guide was written for the Windows version of 86Box, but the procedure on other supported platforms should be the same.

0. Preparing for installation
You will need the following: An older video guide that I found suggested using the floppy version of FreeDOS, but even though I was able to install it in 86Box, it did not really work as intended.

Set up 86Box for work as follows:
  • Install 86Box if you downloaded the installer, or unpack it wherever you want if you got the portable version.
  • Unpack the contents of the ROM archive into a sub-directory called roms in the directory where the 86Box binary executable is located. More info on the ROM set can be found here.
  • Unzip the FreeDOS LiveCD wherever you can easily access it.
You're now ready to start the FreeDOS installation. Start 86Box to proceed to the next step.

1. Configuring 86Box
By default, 86Box starts as a 8088 PC without any peripherals. For the purpose of this guide, we will configure a 486DX2 machine, which is suitable for running many DOS games from the 90s.

Open the settings menu (Tools -> Settings...).

I have used this Reddit post as guidelines for the combination of machine type, machine and CPU type:
Image

For Display, I picked [VLB] S3 Trio64 (Phoenix). You can try other graphics cards here, it won't affect FreeDOS installation.

On the Input devices tab, select Standard PS/2 Mouse.

For Sound, I selected a Sound Blaster 16 and System MIDI, without changing any settings:
Image
Fell free to experiment with MIDI emulation, there are several interesting options there.

Next, you can skip right to Hard disks. You will need to create a new one. The virtual disk will be stored as a single file, save it wherever you will (e.g. in the base 86Box directory). Pick a size (I selected one of the custom presets), all other options can be left alone for now:
Image

Next is Floppy & CD-ROM drives. You need to configure both. The floppy drive A: must be set to 3.5" 1.44M to be able to read the FreeDOS boot floppy. The CD-ROM drive may be set to anything you like, I set it to ATAPI 16x speed, changing no other settings:
Image

With this, you're set to run the emulated 486 PC. Click OK, and 86Box will restart, applying the new configuration.

2. Installing FreeDOS
While the 486 machine is booting, on the BIOS startup screen, quickly hit Del to enter BIOS options. Select BIOS FEATURES SETUP and make sure that the boot order places the floppy drive (A) first -- otherwise the installation will not continue once the virtual HDD has been partitioned:
Image
If the boot order is C,A, change it to A,C as shown above by pressing the PgUp key. Save and exit BIOS setup.

You will be then greeted with the following message:
DISK BOOT FAILURE, INSERT SYSTEM DISK AND PRESS ENTER
Now is the time to mount both the FreeDOS boot floppy and the LiveCD image. Do this via the Media menu. Once done, press Enter.

The LiveCD will the boot and present you with the user interface. Select your language and then choose to continue with installation.

It will then ask if you want to partition drive C:, to which you should answer Yes. After that, select the option to reboot the virtual PC.

If the LiveCD does not load after rebooting, double-check if you set the correct boot order in BIOS (see above).

After reboot, FreeDOS will ask if you want to format drive C: and to overwrite the MBR, to which you need to answer Yes as well.

After that, the installation programme will present you with FreeDOS installation options. I selected Plain DOS system, but you can also go for the full install with useful applications and games (but it will take a while to install).

Whichever you choose, the installation will proceed automatically at this point. Once completed, it will prompt you to reboot the machine. Don't forget to eject both the boot floppy and the LiveCD before doing so. If the installation was successful, FreeDOS will boot at next startup.

3. Post-install fix
Once installed, FreeDOS is ready to work out of the box. However, there is a little quirk that in 86Box, it does not correctly identify a 486 machine and thus will not load some of the drivers, such as the CD-ROM and mouse drivers.

To fix this, you will need to edit FreeDOS' AUTOEXEC.BAT. Once the system has loaded, type auto at the DOS prompt. This will open FDUATO.BAT (which is the FreeDOS version of AUTOEXEC.BAT) for editing.
Image
You will need to find the following line (shown on the screenshot above):

Code: Select all

if errorlevel 3 goto Support386
Comment it out by appending rem at the beginning of the line and put this one instead (or just replace 3 with 1 in the above line):

Code: Select all

rem if errorlevel 3 goto Support386
if errorlevel 1 goto Support386
Save FDAUTO.BAT and exit the FreeDOS text editor (Alt+X). You can type reboot at the command prompt to reboot the virtual PC from FreeDOS. Next time you boot, the CD-ROM and mouse drivers should load properly.

Update: After playing around with 86box for a while, I noticed that mouse pointer movement is exceedingly rapid, which at first I tried to fix by lowering mouse sensitivity in 86box preferences, but it did not help much. After unsuccessfully trying out different DOS mouse drivers, none of which worked well, I figured out the cause. FreeDOS uses the CuteMouse driver, and for some reason by default it doubles the mouse pointer movement speed, which gets very noticeable in low resolution DOS games. To fix this, you need to manually set the speed by adding the /R command line argument (resolution) to FDAUTO.BAT.

Type auto from the command prompt to edit FDAUTO.BAT, then find the instance of CTMOUSE right after :NoLFN, like this:

Code: Select all

:NoLFN

CTMOUSE
Add the argument /R1 after CTMOUSE:

Code: Select all

:NoLFN

CTMOUSE /R1
Then save FDAUTO.BAT and reboot.

You can also set the resolution to a value greater than 1, e.g. CTMOUSE /R2. This should make moving the pointer over longer distances across the screen faster, while keeping small movements at the default speed, allowing for better precision. But this may not work well with all games.

86Box has a very useful feature of loading external folders on your PC as CD-ROM images. This way, you can quickly transfer files to the virtual HDD to be used under FreeDOS. However, please take note that when the files are copied, they will retain their read-only attribute (because all files on a CD-ROM drive are normally read-only), which is advised to be removed.
User avatar
MrFlibble
Forum Administrator
Posts: 1808
Joined: December 9th, 2010, 7:19 am

Re: Installing FreeDOS in 86Box: A step-by-step guide

Post by MrFlibble »

I've found a very neat SC-55 soundfont to use with 86Box:
https://github.com/trevor0402/SC55Soundfont

Just set the MIDI card to FluidSynth and point it to the sf2 file.
User avatar
MrFlibble
Forum Administrator
Posts: 1808
Joined: December 9th, 2010, 7:19 am

Re: Installing FreeDOS in 86Box: A step-by-step guide

Post by MrFlibble »

Here's my FDCONFIG.SYS with an added JEMMEX load mode that supports The Elder Scrolls: Arena.

This game does not work under FreeDOS out of the box, but loading JEMMEX with the following parameters helps (as suggested by JEMMEX developer):

Code: Select all

DEVICE=C:\FreeDOS\BIN\JEMMEX.EXE MAX=32M MIN=48 I=B000-B7FF I=TEST
You do not have the required permissions to view the files attached to this post.
User avatar
MrFlibble
Forum Administrator
Posts: 1808
Joined: December 9th, 2010, 7:19 am

Re: Installing FreeDOS in 86Box: A step-by-step guide

Post by MrFlibble »

As I played around with various games in the 86box FreeDOS setup, I immediately noticed that the mouse pointer speed is exceedingly high, especially in low-resolution games, which I at first attributed to 86box mouse sensitivity settings. However, even after noticeably lowering the sensitivity in the preferences, mouse pointer movement still felt off and imprecise.

I then decided to try fixing this from the side of the OS in the emulated machine, and replaced the stock FreeDOS mouse driver with several different ones, none of which worked well, if at all.

Eventually I figured out what was causing this issue. FreeDOS comes with the CuteMouse mouse driver, which allows the user to set what it calls mouse horizontal and vertical resolution. This option allows to increase the speed of longer mouse pointer movements, while keeping small movements at the default speed to preserve precision:
ctmouse.txt wrote:CTMOUSE supports 9 fixed resolution levels and auto resolution. Resolution
defines how the mouse movements are added to the cursor position. Small
mouse movements at any resolution produce the same cursor movement; this
allows precise cursor positioning on the screen. Larger mouse movements
are multiplied by resolution level to produce the cursor movement; this
allows rapid cursor movement across the screen without big efforts.

With auto resolution the faster the mouse is moved, the greater multiplier
is used, giving the cursor a nonlinear acceleration. Option /R, whose
syntax is described in the help screen, allows the preferred resolution
level to be specified for each direction.
However, starting with version 1.9 of the driver, the default resolution setting (auto mode) doubles the pointer movement speed at small movements as well, for some reason. This is what was causing the rapid movements in 320x200 games that I have reported before.

Setting the resolution manually reverts to the intended behaviour, i.e. small movements are not amplified. It is my understanding that CTMOUSE /R1 results in non-accelerated mouse movement at all times, while CTMOUSE /R2 gives minimal acceleration with large movements.

I have updated the first post with the information about this, suggesting to use /R1 as the starting setting. If you play games or use applications that utilise resolutions greater than 320x200, perhaps it would make sense set resolution to 2 or greater, depending on your preference.
Post Reply