17

The FreeDOS project offers a number of downloads, but all of these contain an installer that tries to install FreeDOS from an installation media onto the hard disk.

Selecting the USB flash drive as installation target is not supported. Since USB flash drive are usually large enough to contain the OS plus applications, writing onto the hard disk is often not intended.

Some pages point to tools like Rufus, which can create a bootable FreeDos installation from a template, but this disk is then missing the typical FreeDos components.

So how can a complete FreeDOS be installed on a bootable USB flash drive to create a live USB flash drive version with FreeDOS?

Giacomo1968
  • 58,727
Peter B.
  • 451

6 Answers6

17

Unfortunately the current information on the FreeDOS Wiki is not up to date, but with the help from FreeDos Developer Jim Hall I could find the solution:

  1. Download the USB “Full” installer from the FreeDOS page.
  2. Unpack the downloaded zip
  3. Use a USB formatting tool (for example rufus) to write the image to USB (take care to write over the right drive)
  4. Move the directory D:\FDSETUP\BIN to D:\BIN
  5. Edit first and last two lines in D:\FDCONFIG.SYS as follows

    !COUNTRY=001,858:\BIN\COUNTRY.SYS
    !LASTDRIVE=Z
    !BUFFERS=20
    !FILES=40
    
    DOS=HIGH
    DOS=UMB
    DOSDATA=UMB
    
    DEVICE=\BIN\HIMEMX.EXE
    
    SHELLHIGH=COMMAND.COM \BIN /E:2048 /P=\AUTOEXEC.BAT
    
  6. Edit D:\AUTOEXEC.BAT as follows (Windows will hide this file, but you can open it by directly giving the filename). Only the line setting the DOSDIR needs to be changed and some display code at the end of AUTOEXEC.BAT are to be removed

    @echo off
    SET DOSDIR=
    SET LANG=
    SET PATH=%dosdir%\BIN
    
    SET DIRCMD=/P /OGN /Y
    
    rem SET TEMP=%dosdir%\TEMP
    rem SET TMP=%TEMP%
    
    rem SET NLSPATH=%dosdir%\NLS
    rem SET HELPPATH=%dosdir%\HELP
    rem SET BLASTER=A220 I5 D1 H5 P330
    rem SET COPYCMD=/-Y
    
    DEVLOAD /H /Q %dosdir%\BIN\UDVD2.SYS /D:FDCD0001
    
    SHSUCDX /QQ /D3
    
    rem SHSUCDHD /QQ /F:FDBOOTCD.ISO
    
    FDAPM APMDOS
    
    rem SHARE
    
    rem NLSFUNC %dosdir%\BIN\COUNTRY.SYS
    rem DISPLAY CON=(EGA),858,2)
    rem MODE CON CP PREP=((858) %dosdir%\CPI\EGA.CPX)
    rem KEYB US,858,%dosdir%\bin\keyboard.sys
    rem CHCP 858
    rem PCNTPK INT=0x60
    rem DHCP
    rem MOUSE
    
    rem DEVLOAD /H /Q %dosdir%\BIN\UIDE.SYS /H /D:FDCD0001 /S5
    
    SHSUCDX /QQ /~ /D:?SHSU-CDR,D /D:?SHSU-CDH,D /D:?FDCD0001,D /D:?FDCD0002,D /D:?FDCD0003,D
    
    rem MEM /C /N
    
    SHSUCDX /D
    
    rem DOSLFN
    
    rem LBACACHE.COM buf 20 flop
    
    SET AUTOFILE=%0
    SET CFGFILE=\FDCONFIG.SYS
    alias reboot=fdapm warmboot
    alias reset=fdisk /reboot
    alias halt=fdapm poweroff
    alias shutdown=fdapm poweroff
    
    rem alias cfg=edit %cfgfile%
    rem alias auto=edit %0
    
    vecho /p Done processing startup files /fCyan FDCONFIG.SYS /a7 and /fCyan AUTOEXEC.BAT /a7/p
    
  7. Delete D:\SETUP.BAT

  8. Done, safe your files and safely remove the USB stick

Boot and test

The USB key now boots directly into FreeDOS and loads into high memory, leaving roughly 600KB of common memory for programs.

Peter B.
  • 451
4

The easiest version I've found so far is this one: https://www.scivision.dev/freedos-flash-bios-linux/

Determine USB drive device (e.g. /dev/mmcblk0) by issuing this command before and after USB drive insertion:

lsblk

Format (permanently erase) this USB drive with

umount /dev/mmcblk0
mkdosfs -F 32 /dev/mmcblk0

Download the FreeDOS “USB Full Image” and extract the FD*.img file. Write this image to the USB stick:

dd if=FD*.img of=/dev/mmcblk0 bs=4M

the image write will take a minute or two, depending on the write speed of the USB stick. To be sure it’s done, wait for this command to exit in a second Terminal window:

sync
Giacomo1968
  • 58,727
breversa
  • 181
4

To add detail to breversa's answer, which then worked for me:

  • Find out USB device and partition as described. (e.g., whole USB stick is /dev/sdc, with first partition /dev/sdc1)
  • Use mkdos on the partition level. (e.g., /dev/sdc1)
  • Use dd on the whole device level, not on the partition level. (i.e., use dd [...] of=/dev/sdc)
  • Otherwise, dd will produce an invalid partition and the USB stick is not bootable.
  • You can then mount /dev/sdc1 and add any additionally needed files. (a BIOS/firmware updater in my case)
  • No additional changing of FreeDOS files was necessary in my case.
  • If my hardware gave a 'boot error' (or whatever) message, I found that in most cases the 'culprit' is the USB stick itself; different models work with different computers (or don't); usually, newer USB flash drives work better than older ones.
Giacomo1968
  • 58,727
7enderhead
  • 53
  • 6
3

As of 2022-12-20, after various attempts, they only way I was able to get any FreeDOS live (i.e., whether full or not) onto a USB thumb drive was using Rufus (it's current version is 3.21 as of now) and choosing FreeDOS from the “Boot selection” dropdown list. I let Rufus create a bootable thumb drive, mounted the drive, and manually copied whichever software I needed to the drive. Using this drive, FreeDOS booted by default in a laptop from year 2014 but not (or at least not by default) in a laptop from year 2022.

At least 3 other methods failed for me:

  1. In Linux, letting unetbootin put FreeDOS 1.0 to my thumb drive according to https://wiki.ubuntuusers.de/BIOS_aktualisieren/#DOS-USB-Methode (outcome: doesn't boot on the 2014 laptop).

  2. In Linux, letting unetbootin put self-downloaded Full or Legacy FreeDOS 1.3 to my thumb drive according to https://wiki.ubuntuusers.de/BIOS_aktualisieren/#DOS-USB-Methode (outcome: neither Full FreeDOS nor Legacy FreeDOS boot on the 2014 laptop),

  3. Using “odin“ FreeDOS edition according to http://wiki.freedos.org/wiki/index.php/How_to_Create_a_USB_Boot_Disk_Using_FreeDOS (outcome: the URL given there is rotten away).

Of course, I don't claim I tried all possible options and variations of 1.-3. and all BIOS/UEFI boot options of all laptops. So, dear reader, your experiences might vary.

0

Yes, the Rufus way works, and so far it's the only way I know to make a FreeDOS USB boot.

But it partitions and formats the drive without alignment, which will produce excessive write/erase activity of the flash memory and prematurely wear out the drive.

That's not a problem if you're just flashing a BIOS or something, but it is if you will be often updating files.

BTW, if you use the trishtech link, there is a problem installing FreeDOS into VirtualBox, at the "install freedos to hdd" screen. If you just go ahead, you will get rolling "illegal instruction" messages.

Workaround: Press Tab, then add " raw" (no quotes) to the boot line, then press Enter.

Giacomo1968
  • 58,727
Fred B
  • 1
0

In 2025 and Probably ealier as well, it seems to be possible to install also from ISO.

I used virt-manager (Libvirt, KVM+QEMU) to do this, but I believe the same could be achieved with Virtualbox or other Virtualization Solutions.

  1. Make a Backup (if needed) of the existing USB Flashdrive. Then delete all existing Partitions from the USB Flashdrive

  2. Download FreeDOS 1.3 from https://www.freedos.org/download/ by selecting the LiveCD Version (Direct Link: https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.3/official/FD13-LiveCD.zip)

  3. Extract the ISO from the ZIP Archive to FD13LIVE.iso

  4. Pass-through your USB Flashdrive to the VM

  5. Configure your Virtual Machine CD ROM Drive to use FD13LIVE.iso as a CD-ROM Drive (I selected SATA as Type)

  6. You might need to enable the Boot Menu in Boot Options (particularly if you had something else on the USB Flashdrive, otherwise just delete all Partitions before starting, see 0)

  7. Boot the Installer up

  8. Choose to Install FreeDOS

  9. Select Install to Hard Disk

  10. When Prompted that the Disk is not Initialized, select that you want the Installer to Initialize the Disk

  11. It will automatically Reboot

  12. Go through the same Procedure and select again "Initialize Disk"

  13. After Partitioning, select "Install all Applications and Extras"

  14. Once the installation Finishes, remove the CD-ROM Drive (or set ISO Image to None or (empty)) then reboot

Further Notes:

  • You might want to Remove ALL Partitions EXCEPT the First one where FreeDOS is installed. See this Resource for some further Information.

    In my case I simply used gparted /dev/sdc, selected all existing Partitions EXCEPT the first one (where FREEDOS itself is installed) and remove those. Then I created a ~ 6GB FAT32 DATA Partition in their Place.

  • You can configure the Keyboard Layout in case you forgot to do so earlier: you can see a List of the existing Layouts at this Website. Once you found yours, you can set it using keyb <layout> so for instance keyb de for German Keyboard Layout

    That however is not setting the Keyboard Layout Persistent across Reboots.

    I didn't find a reliable Way to do that using "Old" Solutions.

    I managed to get it working by editing fdauto.bat using edit fdauto.bat and adding near the end AFTER the Various if exist ... and BEFORE the :END the following:

    call %dosdir%\bin\keyb.exe <layout>