Review your favorite Linux distribution.
Go Back > Blogs > number22
User Name


Rate this Entry

Bootable PC-DOS usb drive

Posted 10-06-2016 at 10:23 PM by number22
Updated 10-07-2016 at 10:38 PM by number22

We need a system to run old DOS program. Microsoft's Win98 lacks proper memory management for modem computer with larger amount memory. We have PC-DOS (from IBM) lay around.

Basic setup: Syslinux + floppy image with boot.bss

Need create a empty floppy image on usb drive.(your usb is already fdisk with FAT16 partition, and mkfs.msdos formatted).
#mount -t msdos /dev/usbpartition# /mnt/usb
#cd /mnt/usb
#dd bs=512 count=2880 if=/dev/zero of=fd0.img
2880+0 records in
2880+0 records out
1474560 bytes (1.5 MB, 1.4 MiB) copied, 0.00706025 s, 209 MB/s
dos format this fd0.img and mount it with loop device
#mkfs.msdos fd0.img
#losetup -f --show fd0.img
#mount /dev/loop0 /mnt/floppy
make copy IBMBIO.COM IBMDOS.COM and COMMAND.COM into /mnt/floppy (keep the order)
#mcopy /source/IBMBIO.COM /mnt/floppy
#mcopy /source/IBMDOS.COM /mnt/floppy
#mcopy /source/COMMAND.COM /mnt/floppy
find a floppy boot file on internet or form a bootable floppy disk and drive.
#dd if=/dev/fd0 of=boot.bss bs=512 count=1
#mcopy boot.bss /mnt/floppy
open your text editor, write a syslinux.cfg for fd0.img
DEFAULT floppy
LABEL floppy
KERNEL boot.bss
save it and sync it, Change out to usb mounting point and
#cd /mnt/usb
#syslinux /dev/loop0
#losetup -d /dev/loop0
#umount /mnt/floppy
you need 2nd syslinux at your usb drive

#mcopy /usr/share/syslinux/memdisk /mnt/usb
#vi syslinux.cfg

SAY Welcome PCDOS boot disk
DEFAULT floppy
LABEL floppy
LINUX memdisk
INITRD fd0.img
APPEND floppy
Save then and unmount usb

#umount /mnt/usb
#syslinux /dev/usbpartition#
reboot to bios and select your bootable usb hdd or usb key

your A: drive contents are just image under pc-dos can't be altered. But you can modify it under mounted linux directory. Should add proper Autoexec.bat, Config.sys and other utilities file before closing fd0.img.

we test memdisk and chain.c32; memdisk is faster and lean. Although, chain.c32 has pcdos=IBMBIO.COM, but I failed to make it works.

note: PC-DOS doesn't support FAT32, only FAT12/FAT16, if you want to transfer files with your usb drive, create a small FAT16 partition.

#fdisk -c=dos /dev/usb
#mkfs.msdos  -F 16 -f 2 -s 128 -S 512 /dev/usbpartion1
note2: if you put SYS.COM in your fd0.img, you can use it to transfer system files of ibm dos to other hard drive, make it boot directly to pc-dos.

Posted in Uncategorized
Views 2023 Comments 1
« Prev     Main     Next »
Total Comments 1


  1. Old Comment
    Why not use DOSBox?
    Posted 10-09-2016 at 01:02 AM by rkelsen rkelsen is offline


All times are GMT -5. The time now is 12:52 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration