Tutorial: Compile and Use FreeDOS 1.2
Posted: Sat Apr 29, 2017 5:28 pm
Watch the video tutorial (contains download, compilation and a test run in a 386DX):
http://www.youtube.com/watch?v=Uwk91x5KgPc
After watching this 40-minute tutorial and trying out the accompanying sample source distribution ZIP file, you should be able to compile and install FreeDOS 1.2, that is, the kernel and the COMMAND.COM console by yourself with no complications.
It shows you how to install to a floppy, but you can use Rufus to set up other media such as USB drives. You just need to replace the FreeDOS core system files created by Rufus, by the ones you compile.
For this tutorial you can use DOSBox, any 16 or 32-bit Windows or Wine, anything that has access to DOS.
For this we need:
- To compile the FreeDOS kernel with Turbo C++ 2.01.
- To compile COMMAND.COM (FreeCOM) with Turbo C++ 1.01.
It is critical that we use those versions, mainly for COMMAND.COM. If we don't , the console will lock up as soon as we execute a DIR command, before showing the file/free/size bytes information.
Apparently we can also use OpenWatcom for the kernel, but the cleanest tool options are indicated by default in the MAK scripts and BAT files (CLEAN.BAT, CONFIG.BAT and BUILD.BAT).
Source code and tools to install (contains a directory with the kernel and COMMAND.COM already compiled, and the config/build scripts already set up to make the process totally clear):
https://archive.org/download/FreeDOS1.2_2017_04_28/FreeDOS%201.2.zip
For FreeDOS 1.2, it's vital that we execute a DIR command right after it finishes loading, since it will show us if COMMAND.COM has been correctly compiled with the right tools (Turbo C++ 1.01).
_______________________________________________
_______________________________________________
Baseically, we need to set the following variables using SET, in CONFIG.BAT:
XNASM - Must point to the absolute path to NASM 0.98 for DOS.
TC2_BASE - Turbo C 2.01 - Base directory that contains BIN, H, LIB, BGI (for the kernel)...
TP1_BASE - Turbo C 1.01 - Base directory that contains BIN, H, LIB, BGI (for COMMAND.COM/FreeCOM)...
XUPX - We must comment it out or the compilation will think that the binaries are too big for a COM (or search an adequate UPX version).
XCPU - For Turbo C it must be 86, for OpenWatcom it can be 386.
XFAT - It's better for it to be 32 unless we don't want FAT32 support.
PATH - Must contain %TC2_BASE% and probably %TC2BASE%\bin . It must also contain %TP1_BASE% and probably %TP1_BASE%\bin .
NOTE: Once we compile the kernel, we must delete the install directory for Turbo C 2.01 or remove it from the PATH and start a new DOS console, for being able to cleanly use Turbo C 1.01 to compile COMMAND.COM .
http://www.youtube.com/watch?v=Uwk91x5KgPc
After watching this 40-minute tutorial and trying out the accompanying sample source distribution ZIP file, you should be able to compile and install FreeDOS 1.2, that is, the kernel and the COMMAND.COM console by yourself with no complications.
It shows you how to install to a floppy, but you can use Rufus to set up other media such as USB drives. You just need to replace the FreeDOS core system files created by Rufus, by the ones you compile.
For this tutorial you can use DOSBox, any 16 or 32-bit Windows or Wine, anything that has access to DOS.
For this we need:
- To compile the FreeDOS kernel with Turbo C++ 2.01.
- To compile COMMAND.COM (FreeCOM) with Turbo C++ 1.01.
It is critical that we use those versions, mainly for COMMAND.COM. If we don't , the console will lock up as soon as we execute a DIR command, before showing the file/free/size bytes information.
Apparently we can also use OpenWatcom for the kernel, but the cleanest tool options are indicated by default in the MAK scripts and BAT files (CLEAN.BAT, CONFIG.BAT and BUILD.BAT).
Source code and tools to install (contains a directory with the kernel and COMMAND.COM already compiled, and the config/build scripts already set up to make the process totally clear):
https://archive.org/download/FreeDOS1.2_2017_04_28/FreeDOS%201.2.zip
For FreeDOS 1.2, it's vital that we execute a DIR command right after it finishes loading, since it will show us if COMMAND.COM has been correctly compiled with the right tools (Turbo C++ 1.01).
_______________________________________________
_______________________________________________
Baseically, we need to set the following variables using SET, in CONFIG.BAT:
XNASM - Must point to the absolute path to NASM 0.98 for DOS.
TC2_BASE - Turbo C 2.01 - Base directory that contains BIN, H, LIB, BGI (for the kernel)...
TP1_BASE - Turbo C 1.01 - Base directory that contains BIN, H, LIB, BGI (for COMMAND.COM/FreeCOM)...
XUPX - We must comment it out or the compilation will think that the binaries are too big for a COM (or search an adequate UPX version).
XCPU - For Turbo C it must be 86, for OpenWatcom it can be 386.
XFAT - It's better for it to be 32 unless we don't want FAT32 support.
PATH - Must contain %TC2_BASE% and probably %TC2BASE%\bin . It must also contain %TP1_BASE% and probably %TP1_BASE%\bin .
NOTE: Once we compile the kernel, we must delete the install directory for Turbo C 2.01 or remove it from the PATH and start a new DOS console, for being able to cleanly use Turbo C 1.01 to compile COMMAND.COM .