-C : Create a the image file (use it when you don't have an existing image file)-f 2880 : Specifies the size of the DOS filesystem to format. 2880 kb, double-sided, 36 sectors per track, 80 cylinders (for 3 1/2 ED)-v FDUBCD141 : Set volume label of floppy image to "FDUBCD141".-d 1 : Sets the number of FAT copies. Default is 2. Setting this to 1, gives use a bit more space ( = number of sectors set as length of FAT)-r 6 : Sets the size of the root directory (in sectors) (default value = 15 for 3 1/2 ED floppy) A value of 6 will give us a limit of 96 ROOT files and/or directories. (512 bytes per sector) / (32 bytes per entry) = (16 entries per sector) In the subdirectories, there is no limit in the number of subdirectories or files, except that the total number of files and directories can't be more than the total number of data clusters available.-L 9 : Sets the length of the FAT (in sectors) Each entry in the FAT12 table is 1.5 bytes long. 512 bytes per sector / 1.5 bytes per entry * 9 sectors = 3072 entries In FAT12, the first 2 entries are reserved, so a value of 9 will give use 3070 allocatable clusters. One cluster in a 3 1/2 ED FAT12 floppy is 2 sectors long by default ==> 1 cluster is 1 KB. A 2880KB floppy has more than enough with a FAT table with 3070 entries.-i fdubcd-clean-filesystem.img : Filename of our new floppy image

You only need to create the fdubcd-clean-filesystem.img file once. The next time you want to make a modified FDUBCD floppy image, you can start from that image file, copy the needed files inside the image and get a nice fresh floppy image with all files defragmented and with all unused sectors zeroed out (will give a smaller compressed size).

Copy the clean 2880k floppy image with the FreeDOS boot sector installed fdubcd-clean-filesystem.img to a new file on which we can work further (fdubcd-fresh-files.img)

Code:

cp fdubcd-clean-filesystem.img fdubcd-fresh-files.img

If you started from the fdubcd-clean-filesystem.img file and the FDUBCD version number is updated, you can update the Volume Label with mlabel.

Code:

mlabel -i fdubcd-fresh-files.img ::FDUBCD141

Make a temporary directory (remove the previous one, if it already exists):

Code:

rm -rf /tmp/fdubcdmkdir /tmp/fdubcd

Copy the files of the original image (fdubcd-original.img) to the temporary directory:

Code:

mcopy -s -m -p -v -i fdubcd-original.img :: /tmp/fdubcd

Code:

- s Recursive copy. Also copies directories and their contents- p Preserves the attributes of the copied files- m Preserve the file modification time.- v Verbose. Displays the name of each file as it is copied.

Change the files you want to change inside the floppy image, by editing the files in the temporary directory.

Sometimes the files in the temporary directory aren't all uppercase, so lets fix this.FreeDOS can work with them, but it looks nicer if all the filenames look similar.

Convert all lowercase filenames to uppercase:

Code:

cd /tmp/fdubcd/

find . -exec bash -c 'file={}; mv -v "${file}" "${file^^}"' \;

cd -

Copy the files in the temporary directory to our new image (fdubcd-fresh-files.img):

Code:

mcopy -s -m -p -v -i fdubcd-fresh-files.img /tmp/fdubcd/* ::

Test your new floppy image in a virtual machine to see if it works:The FDUBCD image in UBCD is always loaded with MEMDISK, so no changes are written to the fdubcd.img file. Therefore, we load our new image with MEMDISK too, so to test it in a Virtual Machine. Only qemu supports direct booting of MEMDISK (linux kernel format).

Code:

qemu -kernel memdisk -initrd fdubcd-fresh-files.img -append 'raw'

Copy your fdubcd-fresh-files.img to fdubcd.img and rebuild the fdubcd.iso.gz image.

With this method, I have now 9 kb more space than in the original FDUBCD141 floppy image (due the parameters given to mformat).

FAT info for the new floppy image created with mformat (custom values):

Not needed. We can use UBCDxxx.ISO instead. I'll use UBCD51a2.ISO in the following procedures.

Quote:

Open your virtual machine software (qemu, VirtualBox, ..) and attach:

fdubcd-clean-filesystem.img as floppy image

fdbasecd.isoUBCD51a2.ISO as CD image

and boot from CD (FreeDOSUBCD):

Qemu:

Code:

qemu -boot d -cdrom fdbasecd.iso -fda fdubcd-clean-filesystem.img

Use instead:

Code:

qemu -boot d -cdrom ubcd51a2.iso -fda fdubcd-clean-filesystem.img

Quote:

VirtualBox:VirtualBox doesn't seem to like to attach 2880 kb floppies, but there is a workaround.

Move fdubcd-clean-filesystem.img to fdubcd-clean-filesystem-2880.img

Create a 1440 kb floppy with the same name:

Code:

mformat -C -f 1440 -v FDUBCD141 -i fdubcd-clean-filesystem.img ::

Attach this floppy image to VirtualBox

Close VirtualBox

Remove the 1440 kb fdubcd-clean-filesystem.img

Move fdubcd-clean-filesystem-2880.img to fdubcd-clean-filesystem.img

Start VirtualBOX and see your 2880 kb floppy image attached

The last, next step after that one, *was*:

Attach the FreeDOS base ISO (fdbasecd.iso)

But now I use instead:

Attach the UBCD ISO (UBCD51a2.iso)

(and use it to boot the VM).

So now you can skip all the FreeDOS instructions. Instead, in UBCD51a2:

From the Syslinux menu, select FDUBCD DOS and boot into the default booting mode (1).

Once the boot process finishes, select "EXIT" so to go to the DOS prompt.

Then type the following commands:

Code:

a:sys b:xcopy a: b: /e /h /i /n /q /wpoweroff

The last step there (poweroff) should close the VM.

Quote:

Now we can close the virtual machine software.

Just to continue with the same names that Icecube used originally:

Code:

cp fdubcd-clean-filesystem.img fdubcd-fresh-files.img

But now that step is not really necessary. It is only "convenient", so to follow the next steps easily, as Icecube wrote them. I also delete here the rest of the comments around that last copy command.

Quote:

If you started from the fdubcd-clean-filesystem.img file and the FDUBCD version number is updated, you can update the Volume Label with mlabel.

Code:

mlabel -i fdubcd-fresh-files.img ::FDUBCD141

The next steps are completely unnecessary now.

Quote:

Make a temporary directory (remove the previous one, if it already exists):

Code:

rm -rf /tmp/fdubcdmkdir /tmp/fdubcd

Copy the files of the original image (fdubcd-original.img) to the temporary directory:

Code:

mcopy -s -m -p -v -i fdubcd-original.img :: /tmp/fdubcd

Code:

- s Recursive copy. Also copies directories and their contents- p Preserves the attributes of the copied files- m Preserve the file modification time.- v Verbose. Displays the name of each file as it is copied.

Change the files you want to change inside the floppy image, by editing the files in the temporary directory.

The next following step is optional, as it was before. It seems this step also changes the "modification date" of the files involved, which IMO is not a desirable change. So I repeat it here to respect the original tutorial, but I do NOT recommend it.

Quote:

Sometimes the files in the temporary directory aren't all uppercase, so lets fix this.FreeDOS can work with them, but it looks nicer if all the filenames look similar.

Convert all lowercase filenames to uppercase:

Code:

cd /tmp/fdubcd/

find . -exec bash -c 'file={}; mv -v "${file}" "${file^^}"' \;

cd -

Again, the following steps are not necessary now, since the files are already copied into the new floppy image.

Quote:

Copy the files in the temporary directory to our new image (fdubcd-fresh-files.img):

Code:

mcopy -s -m -p -v -i fdubcd-fresh-files.img /tmp/fdubcd/* ::

The rest are additional steps for building the new fdubcd.ISO and the new modified UBCDxxx.ISO, and for testing it. The new FDUBCD.IMG floppy image was already finished and complete when we ran the "xcopy" command above, so I won't repeat here the same procedures and info.

This simple changes reduces the necessary steps, avoids building a temporary directory and 2 "mcopy" commands. It also avoids downloading and using the "extra" FreeDOS ISO image.

In addition, those steps work under both Linux and Windows, while the original "mcopy" steps have some problems under Windows.

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum