Skip to content

Conversation

eduardocasino
Copy link

Hi,

More than a pull request, this is more a basis for discussion about the evolution of the SD-drive firmware and protocol, as I think we are the only two people actively maintaining it.

I'm finishing a port of CP/M-65 to the KIM-1 with the SD-Shield, which includes an image manipulation utility. While working on it, I missed some functionality that wasn't present or did not work well in the current firmware. I've added this new functionality with backwards compatibility in mind, so a host can query for the new features and work gracefully with older or newer versions. The list of changes is:

  • Manage unknown commands properly, discarding all the data from the host and returning a NAK with an error code.
  • Validate the drive number in all relevant operations.
  • Various bug fixes.
  • Re-implementation of the GET_VERSION function. It is not working in the current 1.X firmware anyway, so I've decided that it would be better to return a MAJOR and MINOR byte instead of a string.
    *As we can't rely on the older PC_GET_VERSION function and also calling unknown commands produces a deadlock in versions 1.X, I've bumped the PROTOCOL_VERSION to 2, so it is possible to use the undocumented PR_VERSION_INFO command to distinguish between older and newer firmware.
    *Implement new commands for managing disk images: PC_FORMAT, PC_COPY, PC_RENAME, PC_ERASE.

I know it is a large patch. I can try to break it up if that eases the discussion.

Cheers,

@eduardocasino eduardocasino changed the title Protocol and feature improvements, prepars for future extendions Protocol and feature improvements, prepare for future extendions Jan 22, 2025
@eduardocasino eduardocasino changed the title Protocol and feature improvements, prepare for future extendions Protocol and feature improvements, prepare for future extensions Jan 22, 2025
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