FreeDOS: Difference between revisions
Created page with "== PXE Boot FreeDOS == You may want to PXE boot FreeDOS to do BIOS updates. {{highlight|lang=terminal|code= # mount -o loop freedos-9020-biosa19.img mount ## do whatever #..." |
No edit summary |
||
| Line 1: | Line 1: | ||
== 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 [https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/dos/sys/sys-freedos-linux/ 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 | |||
{{highlight|lang=terminal|code= | |||
## Download FreeDOS (the floppy image works) and mount it. | |||
# wget fdboot.img | |||
# mount fdboot.img freedos | |||
## Create an file for the image. Eg. 50 MB | |||
# dd if=/dev/null of=freedos.img bs=1024 seek=51200 | |||
## Make the MSDOS filesystem (vfat) | |||
# mkfs.msdos freedos.img | |||
## Load the boot sector to the image | |||
# ./sys-freedos.pl --disk=freedos.img | |||
## 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 | |||
}} | |||
== PXE Boot FreeDOS == | == PXE Boot FreeDOS == | ||
With a custom FreeDOS image created as outlined above, you should be able to PXE boot the image using {{code|memdisk}}. | |||
Assuming that you have all the PXE infrastructure set up (DHCP + TFTP + /tftpboot/pxelinux.cfg), add an entry in | |||
the {{code|pxelinux.cfg}} directory containing: | |||
{{highlight|lang=text|code= | |||
LABEL Dell-BIOS-Update | |||
MENU LABEL Dell-BIOS-Update | |||
kernel /images/Dell-BiosUpdate/memdisk | |||
append initrd=/images/Dell-BiosUpdate/freedos-bios.img | |||
}} | |||
Use the {{code|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: | |||
{{code|CONFIG.SYS}} | |||
{{highlight|lang=text|code= | |||
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 | |||
}} | |||
{{code|AUTOEXEC.BAT}} | |||
{{highlight|lang=text|code= | |||
@ECHO OFF | |||
CLS | |||
ECHO Welcome to FreeDOS (http://www.freedos.org)! | |||
O9020A19.exe | |||
}} | }} | ||
=== iPXE Boot === | |||
If you do not have a DHCP server set up to do PXE boot (ie, {{code|next-server}} and {{code|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: | |||
{{highlight|lang=text|code= | {{highlight|lang=text|code= | ||
: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 | |||
}} | }} | ||
The {{code|imgargs}} is important as it won't boot otherwise. | |||
Revision as of 22:19, 18 May 2017
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. 50 MB
# dd if=/dev/null of=freedos.img bs=1024 seek=51200
## Make the MSDOS filesystem (vfat)
# mkfs.msdos freedos.img
## Load the boot sector to the image
# ./sys-freedos.pl --disk=freedos.img
## 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
PXE Boot FreeDOS
With a custom FreeDOS image created as outlined above, you should be able to PXE boot the image using 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
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:
:retry_dhcp
dhcp
The imgargs is important as it won't boot otherwise.