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 harddisk. Selecting the mobile stick as installation target is not supported. Since USB sticks are usually large enough to contain the OS plus applications, writing onto the harddisk is often not intented. 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 onto a bootable USB stick to create a live USB version with FreeDos?
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:
- Download the USB “Full” installer from the FreeDOS page.
- Unpack the downloaded zip
- Use a USB formatting tool (for example rufus) to write the image to USB (take care to write over the right drive)
- Move the directory D:\FDSETUP\BIN to D:\BIN
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
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
- 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.
To detail 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
mkdoson the partition level (e.g.,
ddon the whole device level, not on the partition level (i.e., use
dd [...] of=/dev/sdc)
ddwill produce an invalid partition and the USB stick is not bootable
- you can then mount
/dev/sdc1and add any additionally needed files (a BIOS/firmware updater in my case)
- no additional changing of FreeDOS files was necessary in my case
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:
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).
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),
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.
I'm pretty sure the OP wants to create a complete LiveUSB install of FreeDOS. This creates a USB flash drive that boots FreeDOS and has all the software installed:
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:
Format (permanently erase) this USB drive with
mkdosfs -F 32 /dev/mmcblk0
Download the FreeDOS “USB Full Image” and extract the
FD*.imgfile. 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:
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.