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
manual install
Select "Use FreeDOS 1.3 in Live Environment mode" to boot the LiveCD

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 8Set the system memory ("RAM") to 8 megabytes
-boot menu=on,strict=onUse a boot menu, so I can select if I want to boot from the CD-ROM image or the hard drive image
-hda freedos.imgUse freedos.img as the hard drive image
-cdrom FD13LIVE.isoUse FD13LIVE.iso as the CD-ROM image
-device sb16 -device adlib -soundhw pcspkDefine 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 mouseRecognize 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.

using fdisk
Select "1" to create a partition
using fdisk
Select "1" on the next menu to make a primary 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.

using fdisk
You need to reboot to recognize the new partition

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.

C:\>format /S :C

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:

Running SYS in a shell: sys C:
FreeDOS System Installer v3.6e, May 11 2016

Processing boot sector...
FAT type: FAT16
Now copying system files...
Copying D:KERNEL.SYS...
46685 Bytes transferred
Copying shell (command interpreter)...
Copying D:COMMAND.COM...
85048 Bytes transferred

System transferred.

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:

D:\PACKAGES\BASE>dir /w
 Volume in drive D is FD13-LiveCD

 Directory of D:\PACKAGES\BASE

[.]            [..]           AMBHELP.ZIP    APPEND.ZIP     ASSIGN.ZIP
ATTRIB.ZIP     CHKDSK.ZIP     CHOICE.ZIP     COMP.ZIP       CPIDOS.ZIP
CTMOUSE.ZIP    DEBUG.ZIP      DEFRAG.ZIP     DELTREE.ZIP    DEVLOAD.ZIP
DISKCOMP.ZIP   DISKCOPY.ZIP   DISPLAY.ZIP    EDIT.ZIP       EDLIN.ZIP
EXE2BIN.ZIP    FC.ZIP         FDAPM.ZIP      FDHELPER.ZIP   FDISK.ZIP
FDXMS.ZIP      FDXMS286.ZIP   FIND.ZIP       FORMAT.ZIP     FREECOM.ZIP
GRAPHICS.ZIP   HIMEMX.ZIP     HTMLHELP.ZIP   INDEX.DE       INDEX.FR
INDEX.GZ       INDEX.LST      INDEX.TR       JEMM.ZIP       KERNEL.ZIP
KEYB.ZIP       KEYB_LAY.ZIP   LABEL.ZIP      LBACACHE.ZIP   MEM.ZIP
MIRROR.ZIP     MKEYB.ZIP      MODE.ZIP       MORE.ZIP       MOVE.ZIP
NANSI.ZIP      NLSFUNC.ZIP    PRINT.ZIP      RECOVER.ZIP    REPLACE.ZIP
SAMCFG.ZIP     SHARE.ZIP      SHSUCDX.ZIP    SORT.ZIP       SWSUBST.ZIP
TREE.ZIP       UNDELETE.ZIP   UNFORMAT.ZIP   XCOPY.ZIP     
        62 file(s)     11,619,461 bytes
         2 dir(s)               0 bytes free
D:\PACKAGES\BASE>for %f in (*.ZIP) do unzip %f -d C:\FDOS

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.

  inflating: C:/FDOS/BIN/XCOPY.EXE   
   creating: C:/FDOS/DOC/RXCOPY/
  inflating: C:/FDOS/DOC/RXCOPY/COPYING.TXT  
  inflating: C:/FDOS/DOC/RXCOPY/XCOPY.TXT  
  inflating: C:/FDOS/DOC/RXCOPY/HISTORY.TXT
  inflating: C:/FDOS/NLS/XCOPY.SL
  inflating: C:/FDOS/NLS/XCOPY.PL    
  inflating: C:/FDOS/NLS/XCOPY.RU    
  inflating: C:/FDOS/NLS/XCOPY.IT    
  inflating: C:/FDOS/NLS/XCOPY.DE    
  inflating: C:/FDOS/NLS/XCOPY.TR    
  inflating: C:/FDOS/NLS/XCOPY.FR    
  inflating: C:/FDOS/NLS/XCOPY.ES    
  inflating: C:/FDOS/NLS/XCOPY.EN    
   creating: C:/FDOS/SOURCE/XCOPY/
  inflating: C:/FDOS/SOURCE/XCOPY/TCPP3.MAK  
  inflating: C:/FDOS/SOURCE/XCOPY/XCOPY.MAP  
  inflating: C:/FDOS/SOURCE/XCOPY/PRF.C  
  inflating: C:/FDOS/SOURCE/XCOPY/MAKEFILE
  inflating: C:/FDOS/SOURCE/XCOPY/SHARED.INC  
  inflating: C:/FDOS/SOURCE/XCOPY/TURBOC.CFG
  inflating: C:/FDOS/SOURCE/XCOPY/KITTEN.H  
  inflating: C:/FDOS/SOURCE/XCOPY/XCOPY.C  
  inflating: C:/FDOS/SOURCE/XCOPY/KITTEN.C  
D:\PACKAGES\BASE>

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.

Booting from local disk...
FreeDOS kernel 2042 (build 2042 OEM:0xfd) [compiled May 11 2016]
Kernel compatibility 7.10 - WATCOMC - FAT32 support

(C) Copyright 1995-2012 Pasquale J. Villani and The FreeDOS Project.
All Rights Reserved. This is free software and comes with ABSOLUTELY NO
WARRANTY; you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation;
either version 2, or (at your option) any later version.
C: HD1, Pri[ 1], CHS=    0-1-1, start=     0 MB, size=   119 MB

FreeCom version 0.84-pre7 - WATCOMC - XMS_Swap [Dec 29 2019 15:32:39]
Current date is Sat 05-15-2021
Enter new date (mm-dd-[cc]yy): 
Current time is  7:13:20.84 pm
Enter new time:
C:\>

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.