LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > number22
User Name
Password

Notices


Rate this Entry

Bootable PC-DOS usb drive

Posted 10-06-2016 at 09:23 PM by number22
Updated 10-07-2016 at 09: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).
Code:
#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
#sync
dos format this fd0.img and mount it with loop device
Code:
#mkfs.msdos fd0.img
#losetup -f --show fd0.img
/dev/loop0
#mount /dev/loop0 /mnt/floppy
make copy IBMBIO.COM IBMDOS.COM and COMMAND.COM into /mnt/floppy (keep the order)
Code:
#mcopy /source/IBMBIO.COM /mnt/floppy
#sync
#mcopy /source/IBMDOS.COM /mnt/floppy
#sync
#mcopy /source/COMMAND.COM /mnt/floppy
#sync
find a floppy boot file on internet or form a bootable floppy disk and drive.
Code:
#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
Code:
DEFAULT floppy
LABEL floppy
KERNEL boot.bss
APPEND -
save it and sync it, Change out to usb mounting point and
Code:
#cd /mnt/usb
#syslinux /dev/loop0
#sync
#losetup -d /dev/loop0
#umount /mnt/floppy
you need 2nd syslinux at your usb drive

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

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

Code:
#cd 
#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.

Code:
#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.

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

Comments

  1. Old Comment
    Why not use DOSBox?

    http://www.dosbox.com
    Posted 10-09-2016 at 12:02 AM by rkelsen rkelsen is offline
 

  



All times are GMT -5. The time now is 08:20 AM.

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