Creating a PC-DOS bootable USB stick

I'm trying to create a bootable USB stick which has PC-DOS 2000 installed on it, and can't find an option for creating it. So I came up with the idea of using gpart to format the USB stick as FAT16 and then install the MBR... Once that is done I should be able to copy the
PC-DOS files and be able to boot.. Yes?
If so, I guess I just need to dd if=pcdos.mbr of=/dev/da0... but where can I find pcdos.mbr? - not msdos.mbr
Maybe I could extract 512 bytes from sys.com or fdisk.com using dd if only I knew where to look...

I found an interesting site describing MBR - but it didn't really help..
http://thestarman.pcministry.com/asm/mbr/#MBR
 
Revisiting an old thread.... I thought I should be able to create a DOS bootable USB stick from FreeBSD using gpart(), something like:-
Bash:
gpart destroy -F da0
gpart create -s mbr da0
gpart add -t FAT32 da0
gpart set -a active da0
gpart bootcode -b /boot/boot da0
newfs_msdos /dev/da0s1
gpart bootcode -b /tmp/DOSMBR da0s1

Assuming I have a DOSMBR, am I on the right lines towards creating a bootbale DOS USB stick? I do realise I need to add a COMMAND.COM and CONFIG.SYS.
 
Wow, it's been ages that I dealt with DOS boot. I do remember that the boot partition used to have a bootable flag - I suppose the active flag does that?
Here's some additional hints, that might be helpful - even if it's originating from Gentoo: https://wiki.gentoo.org/wiki/Bootable_DOS_USB_stick
This project might also be helpful, if you manage to get it running on FreeBSD (didn't find it in ports with a cursory search): https://sourceforge.net/projects/ms-sys/
 
traditionally you need io.sys, msdos.sys and command.com and mbr boot code and fs boot.code
mbr. boot code is standard (freebsd boot0 will work) but the fs one is not
files may have different names lile ibmbio.com and ibmdos.com instead of io.sys and msdos.sys. new free-doses my differ too
also files need do be copied in order in the first free sectors of the empty fs (boot code does not use fat, just reads the first fs sectors)
 
traditionally you need io.sys, msdos.sys and command.com and mbr boot code and fs boot.code
mbr. boot code is standard (freebsd boot0 will work) but the fs one is not
files may have different names lile ibmbio.com and ibmdos.com instead of io.sys and msdos.sys. new free-doses my differ too
also files need do be copied in order in the first free sectors of the empty fs (boot code does not use fat, just reads the first fs sectors)
As I understand it, all you need are three files, IBMBIO.COM, IBMDOS.COM, COMMAND.COM for PC-DOS. MS-DOS uses different files,
so what I'm trying to figure out is what I need.... or rather which boot/mbr I need to add using 'gpart bootcode'

This gets me to the FreeBSD boot manager menu which has the option of

F1 Win

Code:
gpart destroy -F da0                                                                                                                                                                            
gpart create -s mbr da0                                                                                                                                                                             
gpart add -t FAT32 da0                                                                                                                                                                             
#gpart set -a active da0                                                                                                                                                                           
newfs_msdos /dev/da0s1                                                                                                                                                                             
gpart bootcode -b /boot/boot0 da0                                                                                                                                                                   
mount -t msdosfs /dev/da0s1 /mnt/dos                                                                                                                                                               
cd /root/projects/PCDOS-2000/PCDOS7                                                                                                                                                                 
cp IBMBIO.COM /mnt/dos                                                                                                                                                                             
cp IBMDOS.COM /mnt/dos                                                                                                                                                                             
cp COMMAND.COM /mnt/dos

According to:-


I need to apply bootcode to the device, and then to the partition.
Is this line specific to FreeBSD or is it generic?

gpart bootcode -b /boot/mbr da0
 
root@X1:~/projects/FreeBSD# gpart bootcode -b /boot/boot da0s1
gpart: No such geom: da0s1.

root@X1:~/projects/FreeBSD# gpart show da0
=> 63 15280129 da0 MBR (7.3G)
63 15280129 1 fat32 [active] (7.3G)

Why is there no such geom as da0s1 ?
 
FreeDOS source for the files and I use Win7 with HP USB tool.
 
FreeDOS source for the files and I use Win7 with HP USB tool.
The aim of the exercise was to try and use FreeBSD rather than Windows to create a DOS bootable USB stick, but I thought I'd try what you suggested.

I have a directory with all the files from PC-DOS 7 but the HP tool would not recognise them, so I thought I'd just format, but the tool said the USB stick was write protected, which is odd since I was able to format without problems using the built in formater.
 
The aim of the exercise was to try and use FreeBSD rather than Windows to create a DOS bootable USB stick, but I thought I'd try what you suggested.

I have a directory with all the files from PC-DOS 7 but the HP tool would not recognise them, so I thought I'd just format, but the tool said the USB stick was write protected, which is odd since I was able to format without problems using the built in formater.
With the aid of:-

View: https://www.youtube.com/watch?v=NidagvFl5kI


I found I needed to Windows Diskpart to sort out the 'write protected' error and now have a 'Dos' bootable USB stick, but I'd still be interested in knowing I can create one using FreeBSD.
 
Back
Top