FreeDOS
Configuration
Creating Custom FreeDOS Image
To create your own custom FreeDOS image file (such as creating your own BIOS update boot USB/PXE image):
- Get FreeDOS
- Get the FreeDOS sys-freedos-linux package
- Create an empty file of the desired size
- Create a msdos filesystem
- Load the FreeDOS boot sector image
- Copy the FreeDOS files into the image
- Copy any additional files to the image
- Unmount
## Download FreeDOS (the floppy image works) and mount it.
# wget fdboot.img
# mount fdboot.img freedos
## Create an file for the image. Eg. 10 MB
# dd if=/dev/zero of=freedos.img bs=1024 count=10240
10240+0 records in
10240+0 records out
10485760 bytes (10 MB) copied, 0.232655 s, 45.1 MB/s
## Make the MSDOS filesystem (vfat)
# mkfs.msdos freedos.img
mkfs.vfat 3.0.9 (31 Jan 2010)
## Load the boot sector to the image, requires nasm
# ./sys-freedos.pl --disk=freedos.img
DOS boot sector for freedos.img will be created by:
nasm -o /dev/stdout -dISFAT16 ./bootsecs/boot.asm
Using FAT16. Partn offset 0, CHS *x64x32 Drive 0, (0x0, 0x29),
SerNo 5C9-916A, Strings ' ', 'FAT16 '.
Boot sector successfully updated.
## Mount and copy the FreeDOS system files over
# mount -o loop -t vfat freedos.img /mnt/freedos
# cp -r freedos/* /mnt/freedos
## Copy any other files over such as BIOS updates. Make any other changes
# cp -r bios_update.exe /mnt/freedos
# vi /mnt/freedos/AUTOEXEC.BAT # tweak any other settings as required
# vi /mnt/freedos/CONFIG.SYS # tweak any other settings as required
## Unmount and deploy.
# umount /mnt/freedos
See Also
Gentoo has a guide outlining how to create a custom FreeDOS environment imaage
PXE Boot FreeDOS
With a custom FreeDOS image created as outlined above, you should be able to PXE boot the image using Syslinux's memdisk.
Assuming that you have all the PXE infrastructure set up (DHCP + TFTP + /tftpboot/pxelinux.cfg), add an entry in the pxelinux.cfg directory containing:
LABEL Dell-BIOS-Update
MENU LABEL Dell-BIOS-Update
kernel /images/Dell-BiosUpdate/memdisk
append initrd=/images/Dell-BiosUpdate/freedos-bios.img
Use the memdisk binary from syslinux.
Dell BIOS updates seem to work only when himem and the emm386 are not loaded. With them loaded, the BIOS update will fail.
My settings for the following files are:
CONFIG.SYS
DOS=HIGH
rem ?DEVICE=\FDOS\HIMEM.EXE /VERBOSE
rem ?DEVICE=\FDOS\EMM386.EXE /VERBOSE
rem ?DEVICE=\UMBPCI.SYS
FILES=20
BUFFERS=20
!rem SHELL=A:\COMMAND.COM /E:512 /MSG /P
SHELLHIGH=\COMMAND.COM /E:256 /P
AUTOEXEC.BAT
@ECHO OFF
CLS
ECHO Welcome to FreeDOS (http://www.freedos.org)!
O9020A19.exe
iPXE Boot
For more details, see the iPxe page.
If you do not have a DHCP server set up to do PXE boot (ie, next-server and filename isn't set), you could use iPXE instead to boot FreeDOS via network.
I was able to boot FreeDOS using the following iPXE embedded script. Note the imgargs values; these are required for a successful boot.
:retry_dhcp
dhcp || goto retry_dhcp
echo Booting FreeDOS BIOS Update
kernel tftp://${netX/next-server}/images/Dell9020-BiosUpdate/memdisk
initrd tftp://${netX/next-server}/images/Dell9020-BiosUpdate/freedos-9020-bios.img
imgargs memdisk raw
boot