The first step is making a version of the NetbootCD 4.0 initrd (nbinit4.gz) that can fit in the available space. I make it as small as possible by not adding pxe-kexec (and its dependencies: openssl, curl, and readline) or bash (which is used for the "script" feature that reads syslinux.cfg files)
and by removing filesystem utilities like fsck, the filesystem library libext2fs, and kernel modules for IDE, USB, SCSI, and parallel port. I don't need to remove the filesystem tools anymore, because the amount of space they save isn't enough to lower the number of disks. Anyway, this is then built into a new initrd (nbflop4.gz).
The first disk in the set contains a bootable FreeDOS system, with the following files:
The kernel and the initrd are the two files that need to be copied over multiple floppies, but only one file can be split apart easily while still maximizing space. To avoid the overhead of including a program like unzip.exe, the two files are simply conatenated together, biggest first:
cat nbflop4.gz kexec.bzI > nbcd4.cat
Then they are split up into chunks to fit on FAT-formatted floppies, using all available space:
split -b 1457644 nbcd4.cat PART
This makes PARTaa, PARTab, etc. These are renamed to PART.000, PART.001, etc., so chunk.exe can combine them later.
The last part goes on the first floppy disk, because that is the smallest part, and hopefully it can fit on there along with the DOS files. The first part goes on disk 2, the second on disk 3, and so on. T:\tinycore.bat copies them all to the ramdisk, then uses chunk.exe to combine them:
CHUNK.EXE /C PART NBCD4.CAT
Then, it seperates the initrd from the kernel by cutting the file at just the right point. The size of the nbflop4.gz file was 4703621 bytes, and kexec.bzI was smaller, so this command is run:
CHUNK.EXE /S4703621 NBCD4.CAT FILE
This creates two files: FILE.000, which is the initrd, and FILE.001, which is the kernel. These are loaded using loadlin.exe:
LINLD.COM image=FILE.001 initrd=FILE.000 cl=quiet