How to install FreeDOS without the installer
Most people should be able to install FreeDOS 1.3 RC4 very easily using the installer. The FreeDOS installer asks a few questions, then takes care of the rest - including making space for FreeDOS and making the system bootable.
But what if the installer doesn't work for you? Or what if you prefer to set up your FreeDOS system manually, without using the installer? With FreeDOS, you can do that too! Let's walk through the steps to install FreeDOS without using the installer. I'll do all of these steps using the QEMU virtual machine, using a blank hard drive image. I created a one hundred megabyte ("100M") hard drive image with this Linux command:
$ qemu-img create freedos.img 100M
I downloaded the FreeDOS 1.3 RC4 installation LiveCD as FD13LIVE.iso, which provides a "live" environment where I can run FreeDOS, including all the standard tools. Most users also use the LiveCD to install FreeDOS with the regular installer, but here I'll only use the LiveCD to install FreeDOS using individual commands from the command line.
I started the virtual machine with this rather long QEMU command, and selected the "Use FreeDOS 1.3 in Live Environment mode" boot menu entry:
$ qemu-system-x86_64 -name FreeDOS -machine pc-i440fx-4.2,accel=kvm,usb=off,dump-guest-core=off -enable-kvm -cpu host -m 8 -overcommit mem-lock=off -no-user-config -nodefaults -rtc base=utc,driftfix=slew -no-hpet -boot menu=on,strict=on -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny -msg timestamp=on -hda freedos.img -cdrom FD13LIVE.iso -device sb16 -device adlib -soundhw pcspk -vga cirrus -display sdl -usbdevice mouse
That QEMU command line includes a bunch of options that may seem confusing at first. You configure QEMU entirely with command line options, so there is a lot to examine here. But I'll briefly highlight a few important options:
-m 8 | Set the system memory ("RAM") to 8 megabytes |
-boot menu=on,strict=on | Use a boot menu, so I can select if I want to boot from the CD-ROM image or the hard drive image |
-hda freedos.img | Use freedos.img as the hard drive image |
-cdrom FD13LIVE.iso | Use FD13LIVE.iso as the CD-ROM image |
-device sb16 -device adlib -soundhw pcspk | Define the machine with a SoundBlaster16 sound card, AdLib digitial music card, and PC speaker emulation (these are useful if you want to play DOS games) |
-usbdevice mouse | Recognize the user's mouse as a USB mouse (click in the QEMU window to use the mouse) |
Partition the hard drive
You can use FreeDOS 1.3 RC4 from the LiveCD, but if you want to install FreeDOS to your computer, you'll first need to make space on the hard drive. This requires creating a partition with the FDISK program.
From the DOS command line, type FDISK
to run the fixed disk setup program. FDISK is a full-screen interactive program, and you only need to type a number to select a menu item. From the main FDISK menu, enter "1" to create a DOS partition on the drive, then enter "1" on the next screen to create a primary DOS partition.
FDISK will ask you if you wish to use the full size of the hard disk to create the partition. Unless you need to share space on this hard drive with another operating system, such as Linux, you should answer "Y" to this prompt.
After FDISK creates the new partition, you'll need to reboot before DOS can recognize the new partition information. Like all DOS operating systems, FreeDOS identifies the hard drive inforamtion only when it boots up. So if you create or delete any disk partitions, you'll need to reboot so FreeDOS will recognize the changed partition information. FDISK reminds you to reboot, so you don't forget.
You can reboot by stopping and restarting the QEMU virtual machine, but I prefer to reboot FreeDOS from the FreeDOS command line, using the FreeDOS Advanced Power Management tool. To reboot, type the command FDADPM /WARMBOOT
and FreeDOS will reboot itself.
Formatting the hard drive
After FreeDOS has restarted, you can continue setting up the hard drive. Creating the disk partition was "step 1" in this process; now you need to make a DOS filesystem on the partition so FreeDOS can use it.
DOS sytems identify "drives" using the letters A
through Z
. FreeDOS will recognize the first partition on the first hard drive as the C
drive, and so on. You often indicate the drive with the letter and a colon (:
) so the new partition we created above is actually the C:
drive.
You can create a DOS filesystem on the new partition with the FORMAT command. This command takes a few options, but we'll only use the /S
option to tell FORMAT to make the new filesystem bootable - the "S" means to install the FreeDOS "System" files. Type FORMAT /S C:
to make a new DOS filesystem on the C:
drive.
With the /S
option, FORMAT will run the SYS program to transfer the system files. You'll see this as part of the output from FORMAT:
Installing software
Having created a new partition with FDISK and a new filesystem with FORMAT, the new C:
drive will basically be empty. At this point, the C:
drive will only contain a copy of the kernel and the COMMAND.COM
command line shell. To do anything useful with the new disk, we need to install software on it. This is the last step to the manual install process.
The FreeDOS 1.3 RC4 LiveCD contains all of the software you might want to install on the new system. Each FreeDOS program is available as a separate "package," which is really just a Zip archive file. The packages that set up the standard DOS environment are stored in the BASE
directory, under the PACKAGES
directory on the LiveCD.
You could install each of the packages by "unzipping" them to the hard drive, one at a time. With 62 individual packages in the "Base" group, installing each package individually would take a very long time. However, you can run a one-line FOR
"loop" command to "unzip" each program. Then FreeDOS can "unzip" all of the packages for you.
The basic usage of the FOR
loop indicates a single-letter variable (let's use %F
) that FreeDOS will use to "fill in" the filename later. The FOR
also requires a list of files in brackets, and the command that it should run against each of the files. The syntax to unzip a list of Zip files looks like this:
FOR %F IN (*.ZIP) DO UNZIP %F
This will extract all of the Zip files into the current directory. To extract or "unzip" the files into a different location, use the -d
("destination") option at the end of the UNZIP
command line. For most FreeDOS systems, you will want to install the software packages to the C:\FDOS
directory:
FreeDOS will take care of the rest, installing all 62 packages to your system. This may take several minutes, because DOS can be slow when working with lots of individual files - and this command needs to extract 62 Zip files. The installation process would run a lot faster if we used a single BASE.ZIP
archive file, but using packages provides more flexibility in what software you might want to install versus what you choose to leave out.
After you've installed everything, reboot your system with FDADPM /WARMBOOT
. Installing manually means your new FreeDOS system won't have the usual FDCONFIG.SYS
configuration file, so FreeDOS will assume a few typical default values when it starts up. Without the AUTOXEC.BAT
file, FreeDOS will also prompt you for the time and date.
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 will install everything yourself. And now you know how to do it.