Skip to content

Floppy Support ‐ Dynamic Image Mounting

dbalsom edited this page Aug 26, 2024 · 1 revision

This page describes features in active development, intended for a future release of MartyPC.

Dynamic Image Mounting

MartyPC can dynamically build standard disk images containing a FAT filesystem from either a directory or ZIP file. The size of the image created is determined by the size of the configured disk drive commanded to mount the directory/ZIP.

ZIP files placed in the /media/floppies directory tree will appear in the image browser as if they were any other kind of disk image format.

To mount a directory, select a directory from the 'Load from Directory' menu under Media, Floppy Drive 0/1. Mount points should be created as individual directories in the /mount/floppies/ directory. The path of this directory can be modified in MartyPC's configuration file by redefining the autofloppy resource path.

Only a single level of mount point directories is supported - any nested directories will be created inside the resulting floppy image.

A warning notification will occur if the files present in the directory are too large to fit into the disk image. Keep an eye on the lower-right of the window when mounting either a ZIP or directory.

Limitations

Note that mounting a directory does NOT create a 'live' filesystem. If you add or remove files from the mount directory, you will need to re-mount the directory to see the changes. This may change in the future. Correspondingly, files created within the emulator will not automatically appear in the mount directory - you will need to save the disk image back to the directory via the Media menu.

You cannot currently specify attributes for the created files, or specify the order in which they should be loaded to disk, except for DOS system files which will be detected and installed first (see below).

Making Bootable Images From Directories

Boot Sector Injection

You can inject a custom boot sector into the resulting image by providing a bootsector.bin file of up to 512 bytes. If the file provided is smaller than that, it will be padded to 512 bytes and the boot marker added to the last two bytes (0x55AA). This makes it convenient to assemble and execute small programs directly as boot sectors.

Note that DOS boot sectors reference specific disk geometry in the BIOS Parameter Block (BPB). A boot sector from a DOS-bootable 360K image cannot be used directly in a 720K disk image without modification. For your convenience, MartyPC will attempt to detect the type of boot sector present, and if it can, will patch the BIOS Parameter Block to support the resulting disk image size. You can disable this feature in the configuration file if you are doing experiments or want more precise control.

Making a Bootable DOS Image

To make a bootable dos image from a directory, you will need a bootsector.bin containing a boot sector from a DOS diskette, as well as the system files for the appropriate version of DOS:

  • For MS-DOS, include the files IO.SYS, MSDOS.SYS and COMMAND.COM
  • For PC-DOS, include the files IBMBIO.COM, IBMDOS.COM and COMMAND.COM.
  • For FreeDOS, include the files KERNEL.SYS and COMMAND.COM.

You may also wish to create an AUTOEXEC.BAT and CONFIG.SYS which will be handled as you would expect.

Saving Dynamically Mounted Images

Disk images created dynamically from a directory can be 'written back' to the mount directory - In essence, the files present in the FAT filesystem on the disk will be exported. Exercise caution when saving an FAT filesystem to a directory. Files deleted from the disk within the emulator will not be deleted from the mount directory, so it is possible that you will not be able to re-mount the resulting directory due to size limits.

File attributes will not be preserved.

Export of a corrupted disk image may result in the creation of files with garbage filenames and impossible file sizes. MartyPC will try to detect FAT corruption when exporting files, but cannot guarantee that data loss will not occur. Do not store irreplaceable data in a mount directory.