What is MEMDISK?
MEMDISK is meant to allow booting legacy operating systems via PXE, and as a workaround for BIOSes where ISOLINUX image support doesn't work.
MEMDISK simulates a disk by claiming a chunk of high memory for the disk and a (very small - 2K typical) chunk of low (DOS) memory for the driver itself, then hooking the INT 13h (disk driver) and INT 15h (memory query) BIOS interrupts.
How can I use MEMDISK?
MEMDISK is an auxillary module used in conjunction with one of the SYSLINUX bootloaders, usually PXELINUX or ISOLINUX. You need a disk image as well as the memdisk file itself. As far as the bootloader is concerned, memdisk is the "kernel" and disk image is the initial ramdisk (initrd).
You can use MEMDISK straight off the boot loader command line like the following:
... where, of course, diskimg.img is the name of the disk image file. The memdisk file and the disk image need to be present in the appropriate location (for PXELINUX, on your TFTP server, for ISOLINUX, in the /isolinux directory on your CD, etc.)
Normally, however, you would put something like following in the configuration file:
label dos kernel memdisk append initrd=dosboot.img
How should the image be constructed?
The image file should contain a disk image, either a floppy disk or hard disk image. The disk image can be compressed with gzip if you have MEMDISK 2.03 or later, otherwise it should not be compressed.
If the disk image is one of the following sizes, it's assumed to be a floppy image:
368,640 bytes 360K floppy (DD 5.25") 737,280 bytes 720K floppy (DD 3.5") 1,222,800 bytes 1200K floppy (HD 5.25") 1,474,560 bytes 1440K floppy (HD 3.5") 1,720,320 bytes 1680K floppy (HD 3.5" extended format) 1,763,328 bytes 1722K floppy (HD 3.5" extended format) 2,949,120 bytes 2880K floppy (ED 3.5")
For any other size, the image is assumed to be a hard disk image, and should typically have an MBR and a partition table. It may optionally have a DOSEMU geometry header; in which case the header is used to determine the C/H/S geometry of the disk. Otherwise, the geometry is determined by examining the partition table, so the entire image should be partitioned for proper operation (it may be divided between multiple partitions, however.)
It is also possible to specify the geometry manually, overriding the autodetect feature, by specifying the following command-line options:
[=number] c=number Specify the number of cylinders (max 1024*) h=number Specify the number of heads (max 256*) s=number Specify the number of sectors (max 63) floppy[=number] The image is a floppy disk image** harddisk[=number] The image is a hard disk image**
- MS-DOS only allows max 255 heads, and only allows 255 cylinders on floppy disks.
- Normally MEMDISK emulates the first floppy or hard disk. This can be overridden by specifying an index, e.g. floppy=1 will simulate fd1 (B:). This may not work on all operating systems or BIOSes.
MEMDISK version 2.13 and later also supports the following options:
ro Make the simulated disk readonly. raw Use raw access to protected mode memory.
MEMDISK normally uses the BIOS "INT 15h mover" API to access high memory. This is well-behaved with extended memory managers which load later. Unfortunately it appears that the "DOS boot disk" from WinME/XP intentionally(!) crashes the system when this API is invoked. This command-line option tells MEMDISK to enter protected mode directly, whenever possible. It may, however, break other things.
bigraw Use raw access to protected mode memory, return to big real mode.
(New in 3.08) This is like raw, but leaves the CPU in "big real mode" afterwards. This may work for some systems when the raw option doesn't.