Skip to content

Conversation

@vklachkov
Copy link
Contributor

@vklachkov vklachkov commented Jan 15, 2026

Blocked by #15.

This PR completely replaces the original formatting function with a function for creating an empty disk image and also adds tests for it.

Unlike the previous implementation, this one:

  1. Initializes the entire disk with the correct pattern (4x 0xFF, the rest with 0x55)
  2. Correctly initializes the boot sector without using magic offsets, both for bubble memory images and for floppy/hard disk images
  3. Writes the boot code to the image, as done by the InitializeMedia~Run~ program
  4. Correctly initializes the bitmap
  5. Initializes the name and dates in the superblock
  6. Adds partial support for disk images for GRiDCase
  7. Adds tests to compare partially modified images obtained from InitializeMedia~Run~
  8. Fixes calc_inode_blocks_checksum method.

Obtaining Test Images

Reference images were obtained using the MAME emulator, via my fork which supports image formatting.

Then, the bitmap and superblock numbers were written into the images.

After that, the dates in the superblock were slightly edited. This is because for some reason, the GRiD Compass emulation in MAME returns an incorrect day-of-week number: Thursday is reported as the 6th day of the week, and Monday as the 3rd. I didn't have time to investigate, so the images were manually edited after formatting, and the checksum was recalculated.

Obtaining Boot Code

The boot code was obtained from copies of official floppy disks.

GRiDCase Support

Theoretically, floppy disk images with the CCOS_DISK_FORMAT_GRIDCASE format should work in GRiD-OS 3.2.0 under GRiDCase, even without fully populating the boot sector. However, since a GRiDCase emulator still doesn't exist and my laptop is broken so I can't test images, this option is not available to the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant