How to install FreeDOS manually
FreeDOS has grown up to be a modern DOS, including a variety of tools, editors, compilers, and applications that were not present in the original DOS from the 1980s and 1990s. Over time, we've worked hard to make the install process very smooth. These days, you only need to answer a few quick prompts to install a fresh version of FreeDOS.
But DOS is a simple operating system, and you don't need to use an install program. You can actually install FreeDOS the old-school way, doing every step "by hand," like it was the 1980s. This lets you make FreeDOS as small as you want it. If you want to customize your next FreeDOS installation, follow these general steps:
- Partition the disk with
FDISK - Create a DOS filesystem with
FORMAT - Unzip the packages to the disk
Installing to a virtual machine
For this demonstration, I'll install into a virtual machine. I like to use QEMU, which should be available by default on every Linux system. However, there is no graphical front-end to QEMU; you need to set up everything via the command line. We'll stick to the basics, which should make this pretty straightforward.
To start, we'll need a virtual disk to install to. Create a disk
image using the qemu-img program, using these options to use the QCOW2
image format and 120MB size:
qemu-img create -f qcow2 freedos.qcow2 120M
Download the FreeDOS 1.4 distribution to your computer, and unzip the file. You should end up with a file called FD14LIVE.iso, which is a CD-ROM image file.
With the virtual disk image we created with qemu-img and with the
FreeDOS LiveCD image, we can boot an instance of QEMU with both:
$ qemu-system-i386 -enable-kvm -m 16 -hda freedos.qcow2 -cdrom FD14LIVE.iso -boot order=d
That might seem like a complicated command line, but let's look at the components:
qemu-system-i386 starts the QEMU emulator using an i386 compatible
CPU. -enable-kvm uses the Linux kernel virtualization support, which
allows the virtual machine to run much faster. You need an Intel CPU on
your Linux host machine for this option; if you are doing this on a
non-Intel system, like a Raspberry Pi, then you should omit the
-enable-kvm option. Everything else will run the same, but more
slowly.
-m 16 defines the virtual machine with 16MB of memory. The -hda
option tells QEMU to use a disk image for the first hard drive, and
-cdrom says to use another disk image for the CD-ROM. Finally,
-boot order=d will boot the virtual machine from the CD-ROM, so
labeled because most PCs running Windows would likely identify the
CD-ROM drive as the D: drive. (You can also use order=c to boot
from the hard drive, order=a to use the floppy drive, or order=n to
boot from a network device.)
1. Partition the disk with FDISK
At the boot menu, select the option to "Use FreeDOS 1.4 in Live Environment mode." This boots into a "live" FreeDOS environment, which includes the basic FreeDOS commands and a few interesting programs and games. But just to install FreeDOS, we will only use the FreeDOS commands.
At the DOS prompt, type fdisk to run the FDISK fixed disk setup
program. Use the menu to create a DOS partition on the disk, as a
primary partition, using the full space on the disk. This will also
mark the partition as "Active" so that it will boot FreeDOS.
Edit FDISK, and reboot the virtual machine. FreeDOS reads the
disk's partition table only once, at boot-up, which means you need
to reboot so FreeDOS can read the new partition information. To reboot,
type reboot.
2. Create a DOS filesystem with FORMAT
When you're at the boot menu again, select the "Use FreeDOS 1.4 in Live Environment mode" option again. Now we can use the FORMAT program to create a DOS filesystem on the disk. This is called "formatting" the disk.
We can also use an option with the FORMAT program to transfer the "system" files (the kernel and the COMMAND shell), all in one step. At the prompt, type this command:
format C: /S
The /S option will also copy over the system files after formatting
the partition, which makes the disk bootable.
3. Unzip the packages to the disk
With a bootable disk, now we need to copy over the rest of the FreeDOS files to the new drive. FreeDOS installs everything as packages, so every part of FreeDOS is stored in a separate package file. FreeDOS packages are really just zip files with a special structure and some tracking information - but to install FreeDOS like we were "old-school," we can use the UNZIP program to extract the packages directly.
The packages are stored in the D:\PACKAGES directory, and the core
components of FreeDOS (the "Base" packages) are under
D:\PACKAGES\BASE. Since you should already be at the root of the D:
drive, you can just type cd packages followed by cd base to get into
the D:\PACKAGES\BASE directory.
The BASE directory contains about 60 zipped packages. Note that each
FreeDOS package also includes a copy of the source code, but the 120MB
virtual disk is big enough to store that.
for %f in (*.zip) do unzip %f -d C:\FREEDOS
This is an example of a loop on the DOS command line. It means that for
every zip file, DOS will run the unzip command to extract the package,
and put the files into the C:\FREEDOS directory. The FREEDOS
directory doesn't exist yet (because we just formatted the disk,
and haven't set up any directories yet) but with this command
line, UNZIP will create it for you.
Ready to use!
After the unzipping is complete, you're ready to use FreeDOS! Halt
the FreeDOS virtual machine with the shutdown command, which will also
exit QEMU. Back at your Linux prompt, you can now run QEMU with a
slightly different command line to boot directly from the C: drive,
without the CD-ROM:
$ qemu-system-i386 -enable-kvm -m 16 -hda freedos.qcow2 -boot order=c
FreeDOS will prompt for the date and time because this fresh system doesn't include an FDCONFIG.SYS or AUTOEXEC.BAT file. You can create these on your own to further configure how you want FreeDOS to run.
Most users should be able to use the more user-friendly process to install FreeDOS on a new computer. But if you want to install it yourself the "old-school" way, you can also run the installation steps manually. This can provide some additional flexibility and control because you install everything yourself. And now you know how to do it.
*Adapted from How to install FreeDOS the old-school way