============================================================================
Zdisk v1.28 - Kent Robotti <krobot@erols.com> (5-4-99)

The purpose of 'zdisk' is to have a kernel and a rescue system on one
floppy, there's a 'make zdisk' option for the kernel that just copies 
the kernel to a floppy.

Zdisk copies the kernel to a floppy and puts a little rescue system
on the same floppy, creating a boot-rescue floppy.

The 'zdisk' script will expect to find 'ramflop.gz' in the same directory 
as it is.

Format a floppy to 1722 and put it in drive A. 

It's usually /dev/fd0H1722 or fd0u1722.

Use fdformat or superformat to format the floppy.

# fdformat /dev/fd0u1722
# superformat /dev/fd0u1722

The kernel you want to put on the floppy can't be more than 720Kb
in size.

The kernel must have RAM & MSDOS filesystem support, when you do 
'make config' for the kernel answer yes to these options.

RAM disk support
CONFIG_BLK_DEV_RAM

Initial RAM disk (initrd) support
CONFIG_BLK_DEV_INITRD

DOS FAT fs support
CONFIG_FAT_FS
 
MSDOS fs support
CONFIG_MSDOS_FS

Tell zdisk where the kernel you want to put on the floppy is.

zdisk -k path_to_kernel

Some possible paths to the kernel.

zdisk -k /vmlinuz
zdisk -k /boot/vmlinuz
zdisk -k /usr/src/linux/arch/i386/boot/zImage
zdisk -k /usr/src/linux/arch/i386/boot/bzImage
============================================================================

If you want to boot the 'ramflop' system from the hard drive on a 
Dos/Win95/98 system, you would put loadlin.exe, rescue.gz, and a 
kernel on the DOS system.

Ramflop.gz is a msdos filesystem you can see it's contents on a
linux system like this, you need loop device support to mount it.

# gzip -dc ramflop.gz > ramflop
# mount -t msdos -o loop ramflop /dir 

You can't boot linux in windows, quit windows and restart in dos mode.
Dos mode is when windows is closed and all you have is a C:\ D:\ etc.
prompt.

Create a ramflop directory and put rescue.gz, kernel, & loadlin.exe in it.

C:\ mkdir ramflop
C:\ a:
A:\ copy kernel c:\ramflop
A:\ copy rescue.gz c:\ramflop
A:\ c:
C:\ cd ramflop

Boot ramflop...

C:\ramflop> loadlin kernel initrd=rescue.gz root=/dev/ram rw

You can create a 'linux.bat' file with this below in it.

@echo off
loadlin kernel initrd=rescue.gz root=/dev/ram rw

C:\ramflop> linux

============================================================================
This is a step by step guide to how the whole thing was created ...
============================================================================

The syslinux program is used to boot the floppy system, you can get
syslinux in a number of places on the net, it's also on the rescue
system that comes with zdisk.

Format a floppy disk to 1722 and create a dos filesystem on it.

# fdformat /dev/fd0u1722
# dd if=/dev/zero of=/dev/fd0u1722
# mkdosfs -v /dev/fd0u1722

Mount the floppy disk.

# mount -t msdos /dev/fd0u1722 /mnt/floppy

Put syslinux.cfg file and message.txt on the floppy disk.

# cp syslinux.cfg /mnt/floppy
# cp message.txt /mnt/floppy

Unmount floppy drive and run syslinux on it.

# umount /mnt/floppy
# syslinux -s /dev/fd0u1722

You need to have "loop" device support in the kernel or as a module
to mount the rescue image you create with dd and mke2fs below.

Answer y to these questions when you do 'make config' before
compiling the kernel.

/usr/src/linux# make config 

* Additional Block Devices
 
Loopback device support  (N/m/y/?) y      
Ram disk support (N/m/y/?) y
Initial Ram disk (initrd) support (N/y/?) y

Create rescue system.

# dd if=/dev/zero of=rescue bs=1k count=3000
# mke2fs -m0 -F rescue
# mount -t ext2 -o loop rescue /dir
# cd /dir

Create directories /bin /sbin /dev /etc /proc /usr/bin etc. and put 
the programs you want in them.

# umount /dir
# gzip -9 rescue

Copy rescue.gz system to the floppy disk.

# mount -t msdos /dev/fd0u1722 /mnt/floppy
# cp rescue.gz /mnt/floppy
# umount /mnt/floppy

If you want to copy the floppy image to your hard drive.

# dd if=/dev/fd0u1722 of=ramflop
# gzip -9 ramflop

To put the image on a 1722 formatted floppy.

# cat ramflop.gz | gzip -dc > /dev/fd0u1722

If you ever want to mount rescue.gz, you have to gunzip it first.

# gzip -d rescue.gz
# mount -t ext2 -o loop rescue /dir

You also have the contents of ramflop.gz that comes with zdisk as a guide, 
it tells above how to gunzip and mount it.

End ...
============================================================================
