Other Can FreeBSD be used to create a bootable USB flash drive with the freedos OS?

I've downloaded and built ms-sys and tried it with ms-sys -d /dev/da0 which works fine.

Not sure how to use a Linux loop device on FreeBSD... Is that equivalent to using mdconfig ?
 
According to https://unix.stackexchange.com/ques...-bootable-usb-flash-drive-with-the-freedos-os

There are the only these steps involved. Some are simpler than others.

** Step 1: Install Prerequites (ms-sys):
Install ms-sys from source if its not available with your package manager:

** Step 2: Create a blank disk image and create a msdos partition:
Create an empty file for the disk image:

** Step 3: Confirm location of the starting sector of the first partition:
Use fdisk to determine the starting sector:

** Step 4: Format the partition with a FAT file-system
Search for a free loop device:

** Step 5: Use ms-sys to write to the Master Boot Record (MBR) and Volume Boot Record (VBR):
First write the VBR while the partition is still loaded as a loop device:
** Step 6: Write Basic FreeDos files and any other programs you need to the partition on the disk image:
Mount partition:

** Step 7: You are Done!
Unmount the disk image:
 
Just dd the image over to your USB device.

If you have an image of a bootable operating system just copy it over with DD. That works the same on Linux FreeBSD or any Unix system with the DD command.
 
Just dd the image over to your USB device.

If you have an image of a bootable operating system just copy it over with DD. That works the same on Linux FreeBSD or any Unix system with the DD command.
I'm trying to create a USB bootable PC DOS, which I can get from:-


but haven't managed to create one yet.
 
I would suggest getting a USB floppy disk drive and finding a copy of the pc-dos version that you would like to use online. I installed pc dos 6.3 a couple of years ago from the original floppy disks in the box and it worked just fine. You would just need to make sure that the box had been properly stored to ensure the data is uncorrupted on the disk. I still use floppy disks for quite a few things and they stand the test of time rather well I've had very few go bad.
 
I would suggest getting a USB floppy disk drive and finding a copy of the pc-dos version that you would like to use online. I installed pc dos 6.3 a couple of years ago from the original floppy disks in the box and it worked just fine. You would just need to make sure that the box had been properly stored to ensure the data is uncorrupted on the disk. I still use floppy disks for quite a few things and they stand the test of time rather well I've had very few go bad.
Actually looking at ms-sys it gives me an opportunity to install numerous OSes by provided an opportunity to install numerous MBRs and understand how boot records (VBRs) and MBRs work together, Something I've never really understood.
 
Actually looking at ms-sys it gives me an opportunity to install numerous OSes by provided an opportunity to install numerous MBRs and understand how boot records (VBRs) and MBRs work together, Something I've never really understood.
That sounds rather brilliant I find that very interesting myself. I guess you can disregard my advice on the floppy disk media then.
 
According to https://unix.stackexchange.com/ques...-bootable-usb-flash-drive-with-the-freedos-os

There are the only these steps involved. Some are simpler than others.

** Step 2: Create a blank disk image and create a msdos partition:
Create an empty file for the disk image:
Here are Linux based instructions, which I'd like to use on FreeBSD

Step 2: Create a blank disk image and create a msdos partition:​

  • Create an empty file for the disk image:
    $ truncate -s 50M disk.img
This works OK.

  • Note: Here a 50 MiB size disk image is created but you can make this any size you need
  • Partition the disk image:
    $ fdisk disk.img
    Command (m for help): o
    Created a new DOS disklabel with disk identifier 0x1234abcd.

    Command (m for help): n
    Partition type
    p primary (0 primary, 0 extended, 4 free)
    e extended (container for logical partitions)
    Select (default p): p
    Partition number (1-4, default 1): <ENTER>
    First sector (2048-102399, default 2048): 2048
    Last sector, +sectors or +size{K,M,G,T,P} (2048-102399, default 102399): <ENTER>

    Command (m for help): t
    Selected partition 1
    Partition type (type L to list all types): c

    Command (m for help): a
    Selected partition 1
    The bootable flag on partition 1 is enabled now.

    Command (m for help): w

    Note: The fdisk commands above assume you want a FAT32 file-system. If you want to use a FAT16 file-system then for the question above Partition type (type L to list all types): enter e instead of c
Can FreeBSD partition a disk image?
 
Yes, using mdconfig(8) as you suggest, and gpart(8) :

This is the same method as Linux, but syntax is different. As root:

Code:
truncate -s 50M disk.img
# Create memory disk with id 42  and 63 sectors 255 cylinders
mdconfig -u 42 -a -t vnode -f disk.img -x 63 -y 255
# Create an MBR scheme
gpart create -s mbr /dev/md42
# Add a fat16 partition
gpart add -t fat16 /dev/md42
# Create msdos FS
newfs_msdos -F 16 /dev/md42s1
# Mount FS
mount -t msdosfs /dev/md42s1 /mnt

Copy all the files you want to /mnt, and clean-up:

Code:
umount /mnt
# Add dos MBR (Untested)
ms-sys --mbrdos /dev/md42
# Delete memory disk
mdconfig -u 42 -d

You can check /usr/src/tools/tools/nanobsd/legacy.sh for examples and explanations.
 
Back
Top