The goal of this tutorial is to edit the FDUBCD.IMG 2880KB FAT12 floppy image so to have more space available in it, and maybe to make it work a little bit faster - though, probably unnoticeable faster - while maintaining the maximum compatibility possible.
This tutorial will use freeware/donationware GUI tools under Windows.
The method is aplicable for any floppy image, like for example the standards 1440KB, 2880KB or any other. For UBCD51a3 (and up), the modifications, as shown in the tutorial, were already made. In any case, further customizations can be made using the same method.
Is there any other method? Sure.
Is there any "better" method? Probably.
If you have any suggestions or feedback, those are always welcome; specially, if you know about any other tool that could be used instead of the ones in this tutorial to get to the final goal (even if it uses a different approach).
There is NO need to have a real physical floppy drive.
Required Items/Tools:
_ The original 2880KB standard FAT12 FDUBCD.IMG floppy image;
_ RoadKil's Boot Build (portable version available);
_ HxD Hex eDitor (portable version available);
_ ImDisk (or the ol' VFD, if you already have it installed).
Additional recommended Items/Tools:
_ (Un)compression tool, like for example 7-zip, for all the extraction/expansion/decompression/test tasks of zip / gzip / iso / img formats.
(Please, don't ask here for the links to their websites. These tools are very easy to find, if you just want to.)
In this tutorial, I get into the details about the steps for RoadKil's BootBuild and for HxD, just to make it clear and easy for more inexperienced users, but I'm not explaining so many details for ImDisk. This is NOT because ImDisk is easier. In fact, BootBuild and HxD have portable versions (which I recommend for this tutorial); but it might be "tricky" to correctly install ImDisk. The reason NOT to detail ImDisk is because explaining its correct installation, all its concepts and specially how to avoid/reduce problems with it, is probably out of the scope of this tutorial, and could need an additional tutorial by itself. Having said that, ImDisk GUI is simple enough to use.
So, my recommendation would be, in case you have problems with ImDisk (like for example correctly installing it), try to find a solution, and test it, before starting with this tutorial.
Don't get discarriaged by the number of steps of the tutorial; it's not really too much time-consuming, and it should be easy to follow. The number of steps of the tutorial comes from the (maybe too) detailed explanations.
It could be also a good idea to learn about the concepts used in this tutorial, but for a user to successfully follow the tutorial this is not an "absolute" requirement. Moreover, for many users those concepts might result boring or useless.
Before starting, download the required items and tools (almost all are portable), "correctly" install ImDisk (please read its website's documentation for instructions on installing it) and have a backup of the original FDUBCD.IMG floppy image (or the original UBCD.ISO image).
Some last recommendations before starting. Read carefully the complete tutorial at least once before starting doing anything, follow the steps closely, and be aware that this type of customizations are "not for everyone". If you have never customized UBCD before, then probably this is not the ideal place to start doing so.
DISCLAIMER: YOU and only YOU are the only exclusive responsible for anything you do in your copy of UBCD with this info/tutorial, and for any undesired consequences. Feedback is welcome anyway.
Tutorial's Steps:
1_ Use RoadKil's BootBuild to retrieve the boot sector from fdubcd.img.
Open BootBuild -> File -> Import from File -> select fdubcd.img -> Open.
The default values for a standard 2880KB FAT12 floppy image should be displayed in BootBuild. When opening your floppy image file, if you happen to see different values from the expected ones, then the most probable reason is because that specific floppy image file has in its boot sector different values from the ones shown here.
Code: Select all
Bytes Per Sector: 512
Sectors Per Cluster: 2
Reserved Sectors: 1
Media Descriptor: 1.44M+ "FD"
Sectors Per Track: 36
Number of Heads: 2
Total Sectors: 5760
Serial Number: (none, blank)
Sectors per FAT: 9
Number of FATs: 2
Hidden Sectors: 0
Max Root Entries: 240
Physical Number: 0
Signature: 41
Don't worry about your original fdubcd.img. The values you are going to change are not being immediately saved, until you explicitly select a (new) file where to save them.
We want to change "Number of FATs" to "1" and "Max Root Entries" to "96".
Code: Select all
Bytes Per Sector: 512
Sectors Per Cluster: 2
Reserved Sectors: 1
Media Descriptor: 1.44M+ "FD"
Sectors Per Track: 36
Number of Heads: 2
Total Sectors: 5760
Serial Number: (none, blank)
Sectors per FAT: 9
Number of FATs: 1
Hidden Sectors: 0
Max Root Entries: 96
Physical Number: 0
Signature: 41
File -> Export to File -> Change the name of the file to be saved -> Save.
It is recommended to use a relevant name so to clearly identify the new boot sector.
Since the new file is not a complete image, but only a boot sector, it is recommended to save the file with the ".bin" extension, instead of the common ".img" extension.
For example, save the new boot sector as "FDUBCD1FAT96ROOTS.BIN".
Although the button for "saving" might say "Open", it actually saves when you have selected the function to "export to file".
This "export" function saves the complete 512B boot sector; not only the structural values that being display in the UI of BootBuild.
Now you can close BootBuild with File -> Exit.
4_ Open HxD and start a new hex file with File -> New.
5_ Select Edit -> "Insert bytes...".
6_ Under the "Bytecount", from the 3 available possibilities "hex", "dec", "oct", select "dec" (decimal).
7_ To the right side of "Bytecount", insert the value
Code: Select all
" 3 " (without the quotation marks)
Code: Select all
" F0 FF FF " (without the quotation marks)
8_ Press "OK". The value "F0 FF FF" is inserted in the main hex editor window of HxD. The cursor blinks to the right side of the third value. This is important, because the next following values should be inserted in the correct position.
Code: Select all
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00000000 F0 FF FF ðÿÿ
To the right side of "Bytecount", insert the value:
Code: Select all
" 2947581 " (without the quotation marks)
Under the "Fill pattern" -> "Hex-values:", insert the code
Code: Select all
" 00 " (without the quotation marks)
10_ Then press "OK". The value "00" is repeatedly inserted in the main hex editor window of HxD. The cursor blinks to the right side of the last value. This is important, because the next following values should be inserted in the correct position.
Code: Select all
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
...
...
...
002CF9D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
002CF9E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
002CF9F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
11_ Once again, select Edit -> "Insert bytes...". Under the "Bytecount", from the 3 available possibilities "hex", "dec", "oct", select "dec" (decimal).
To the right side of "Bytecount", insert the value:
Code: Select all
" 1024 " (without the quotation marks)
Under the "Fill pattern" -> "Hex-values:", insert the code
Code: Select all
" F6 " (without the quotation marks)
12_ Then press "OK". The value "F6" is repeatedly inserted in the main hex editor window of HxD.
Code: Select all
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
...
...
...
002CFDD0 F6 F6 F6 F6 F6 F6 F6 F6 F6 F6 F6 F6 F6 F6 F6 F6 öööööööööööööööö
002CFDE0 F6 F6 F6 F6 F6 F6 F6 F6 F6 F6 F6 F6 F6 F6 F6 F6 öööööööööööööööö
002CFDF0 F6 F6 F6 F6 F6 F6 F6 F6 F6 F6 F6 F6 F6 F6 F6 F6 öööööööööööööööö
13_ Select File -> Save.
Change the name of the file to be saved to some filename easy to identify, with the classical ".img" extension; for example, "TAIL.IMG". Then press "OK" so to save the file.
14_ Close the just-saved "TAIL.IMG" file, but leave HxD open.
15_ Select "Extras" -> "File tools" -> "Concatenate...".
Click on "Add..." and select the first file we saved from BootBuild, "FDUBCD1FAT96ROOTS.BIN"; then click "Open". The "FDUBCD1FAT96ROOTS.BIN" file is added to the list.
Click once again in "Add..." and select the file we just saved from HxD, "TAIL.IMG"; then click "Open". The "TAIL.IMG" file is added to the list.
16_ In the "Output File name:" box, select the name you want to use for the new modified floppy image, for example "FDUBCD1FAT96ROOTS.IMG" (Note that I am not using "bin" as file extension, as I used before, from BootBuild).
You can click on the "Browse" button (...) to browse to a specific location to save the file. In that case, it is better to browse to the desire location before typing the file name to be saved.
17_ Press "OK". The new (empty) floppy image file is saved. You can close HxD now.
18_ Close all windows of Windows Explorer. Open ImDisk. Mount the new floppy image file "FDUBCD1FAT96ROOTS.IMG" with the following settings:
Code: Select all
Image File: <path\to\> "FDUBCD1FAT96ROOTS.IMG"
Drive letter: "A"
Device Type: Floppy
Select "Removable media"
Code: Select all
Image File: <path\to\> "fdubcd.img"
Drive letter: "B"
Device Type: Floppy
Select "Removable media"
Select "Read-only media".
20_ Now open Windows Explorer, and "show all hidden and system files". Select "A:" and using its properties, add a suitable Volume Label (for example "FDUBCD142").
21_ Open "B:". Copy one-by-one the following files, in this same order , from "B:" to "A:".
21.1_ Kernel.sys
21.2_ Command.com
21.3_ Config.sys
21.4_ Autoexec.bat
21.5_ Diskid.txt
21.6_ Each of the rest of the files in the root, if there is any, one-by-one.
21.7_ Each of the folders in the root, one-by-one (meaning, do NOT select all the folders in the root altogether as a group to copy them in just one pass).
NOTE1: This operation also generates a "defragmented" floppy image, with better compression potential.
NOTE2: The method used in this tutorial does NOT change the original bootstrap code of FDUBCD.IMG. Hence, the same original "system" files from the original FDUBCD.IMG floppy image should be copied into the new modified floppy image. If you want/need a different set of "system" files ( different OS ), you need to start this tutorial from a floppy image that already contains the desired OS, so to copy (transfer) the relevant "system" files into the new modified floppy image. Of course, there are also different additional methods, but they are not covered by this specific tutorial.
22_ Close all Windows Explorer windows, and Unmount the floppy images from ImDisk. There is NO need to save the floppy image as a new additional "third" separate image. ImDisk already updated the modified floppy image in "a:" with the new files while you were transferring them. Close ImDisk. Check in Windows Explorer that the floppy images are NOT displayed. If they are still displayed in Windows Explorer after Unmounting them from ImDisk, it is recommended to close Windows and reboot.
23_ Optional step. If you know how to edit the "VolumeLabel" in the boot sector, you could optionally do it. This is:
_ not escential; and,
_ involves explaining several additional technical details.
So I decided to leave this optional step outside the scope of this tutorial; at least for now. So for those that want to skip this optional step, simply go on to the next step, 24_.
For those users that would like to try it anyway, in a nutshell:
23.1_ Use HxD to find the "VolumeLabel" you inserted in the above step 20_ (in the example, "FDUBCD142"). For the new floppy image we are building in this tutorial, the most probable location for it would be at offset (h) 1400.
23.2_ Select 11 bytes. For our example, that would be from offset (h) 1400 to offset (h) 140A.
23.3_ Edit -> Copy
23.4_ Position the cursor at offset (h) 002B and select 11 bytes, from offset (h) 002B to offset (h) 0035, both included.
23.5_ Edit -> “Paste write” (Do NOT select paste insert in this step).
23.6_ Save the new modified floppy image and close HxD.
24_ Do you have a backup of your original "FDUBCD.IMG" floppy image? This is the last opportunity to make it, before overwriting the original. Now you can copy the newly created "FDUBCD1FAT96ROOTS.IMG" file to "FDUBCD.IMG" in the adequate folder, so to run the appropriate scripts to remaster (rebuild) UBCD with the new modified FDUBCD.IMG floppy image.