Difference between revisions of "Open-source Development for 16-bit machines"

From docs
Jump to navigation Jump to search
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
<span style="float:right;margin-left:1.5em">__TOC__</span>
 +
 
<span id="opensource-development-environment-for-16-bit-machines"></span>
 
<span id="opensource-development-environment-for-16-bit-machines"></span>
= Opensource Development Environment for 16-bit machines =
+
= Opensource Development on Windows 10 for 16-bit machines =
  
This page describes the process of setting up a fully functioning development environment for 16-bit binaries targeting the Intel 8086 or 8088 and later processors using free open-source tools on a Windows 10 machine.
+
This page shows how to setup a fully functioning 16-bit development environment on Windows 10 using free open-source tools. This will allow you to write software that will run natively on machines with a 8088/8086 or better CPU.
  
 
<span id="software"></span>
 
<span id="software"></span>
Line 27: Line 29:
 
C:
 
C:
 
C:\autoexec.bat
 
C:\autoexec.bat
 +
REM OR C:\FDAUTO.BAT if using FD 1.3
 
</pre>
 
</pre>
 
# save and exit.
 
# save and exit.
 
# Start FreeDOS and it will show that both drive c and d are mapped to your directories you specified  
 
# Start FreeDOS and it will show that both drive c and d are mapped to your directories you specified  
# Go to drive D: and run setup.bat It will run the FreeDOS installation. Once the install finishes you can exit to DOS and close the machine. If your dosbox-staging.conf is setup correctly next time you start it should start up in FreeDOS.
+
# Go to drive D: and run setup.bat It will run the FreeDOS installation.  
 +
# *IMPORANT*: Once the install finishes you can exit to DOS and close the machine. If your dosbox-staging.conf is setup correctly next time you start it should start up in FreeDOS. Be sure to specify the correct startup command for freedos. AUTOEXEC.BAT vs FDAUTO.BAT
  
 
Next we install software packages using a package manager called fdimples you can type that on the command line select the software using tab and arrow keys.
 
Next we install software packages using a package manager called fdimples you can type that on the command line select the software using tab and arrow keys.
Line 38: Line 42:
 
== Development ==
 
== Development ==
  
If you will be doing C/C++ development select the DJGPP with I16GNU or Open Watcom C++ compilers and NASM. For instructions on how to setup I16GNU [[I16GNU Setup | click here]]
+
If you will be doing C/C++ development to target the 16 bit platform you only have 2 options
 
+
# [[Installing 16 bit C/C++ Compilers | Open Watcom]] (Preferred)
<span id="editors"></span>
+
# [[Installing 16 bit C/C++ Compilers | I16GNU]] ( Doesn't support C++ )
  
 
== Editors ==
 
== Editors ==
  
If you plan on editing your source code within DOSBox then select some editors. Many options are available including a vi clone called ELVIS. Pico, emacs and FED. But if you are like me, I will be using visual studio code on my windows machine to edit source and just use DOSBox to compile the binaries.
+
If you plan on editing your source code within DOSBox then select your preferred editor. Many options are available including a vi clone called ELVIS. Pico, emacs and FED. I personally use vscode and use DOSBox just to compile the 16 bit binaries.
  
 
== Example Program ==
 
== Example Program ==
Line 68: Line 72:
 
</pre>
 
</pre>
  
It will create a binary which you can test on your 16-bit machine for exampe the [[Xi8088_Version_2.0]].
+
It will create an EXE file that you can run on your 16-bit machine for example the [[Xi8088_Version_2.0]].

Latest revision as of 19:34, 17 December 2022

Opensource Development on Windows 10 for 16-bit machines

This page shows how to setup a fully functioning 16-bit development environment on Windows 10 using free open-source tools. This will allow you to write software that will run natively on machines with a 8088/8086 or better CPU.

Software

Downloading and Installing FreeDOS & DOSBox in Windows 10

  1. Download the FreeDOS FullUSB version
  2. Download the installer from dosbox-staging.github.io
  3. Once downloaded move it to some directory.
  4. Run the program and pin it to your start menu or task bar.
  5. This will also create some config files in your system. Now you can close it.
  6. Open up the freedos zip and open the image file using 7-zip and copy all the files into a new location for example d:\devstudio\runtimes\FreeDOS\install
  7. Open dosbox-staging.conf that’s located in this dir: C:\Users\username\AppData\Local\DOSBox Change windowresolution to lower case L and output to openglnb scaler to normal3x
  8. Update the Autoexec section located at the bottom.
@mount c "c:\devstudio\freeDOS\C"  -freesize 2048
@mount d: "c:\devstudio\FreeDOS\install\" -freesize 2048
C:
C:\autoexec.bat
REM OR C:\FDAUTO.BAT if using FD 1.3
  1. save and exit.
  2. Start FreeDOS and it will show that both drive c and d are mapped to your directories you specified
  3. Go to drive D: and run setup.bat It will run the FreeDOS installation.
  4. *IMPORANT*: Once the install finishes you can exit to DOS and close the machine. If your dosbox-staging.conf is setup correctly next time you start it should start up in FreeDOS. Be sure to specify the correct startup command for freedos. AUTOEXEC.BAT vs FDAUTO.BAT

Next we install software packages using a package manager called fdimples you can type that on the command line select the software using tab and arrow keys.

Development

If you will be doing C/C++ development to target the 16 bit platform you only have 2 options

  1. Open Watcom (Preferred)
  2. I16GNU ( Doesn't support C++ )

Editors

If you plan on editing your source code within DOSBox then select your preferred editor. Many options are available including a vi clone called ELVIS. Pico, emacs and FED. I personally use vscode and use DOSBox just to compile the 16 bit binaries.

Example Program

Create hello.c

#include <stdio.h>

int main()
{
  printf("Hello World");

  return 0;
}

Create a makefile in the same directory

hello.exe: hello.c
	i16gcc hello.c -o hello.exe

It will create an EXE file that you can run on your 16-bit machine for example the Xi8088_Version_2.0.