The current implementation of synchronous commands in the disk emulator utilizes a magic number exchange between the Atari ST code and the RP2040 code to confirm message transmission and acknowledgment. While this method ensures the execution of synchronous operations and safe data exchange, it is not foolproof.
Issues can arise during data transfer if bits are misplaced due to bus contention while accessing the network or SD drive. In such cases, although the magic number may be correctly exchanged, the data itself can become corrupted.
To address this, we propose adding a checksum verification mechanism to enhance data integrity during disk transfer operations. This process would involve the following steps:
Reading Data:
The Atari ST requests to read data from the RP2040.
The RP2040 calculates a checksum for the data and appends it to the outgoing data packet.
The Atari ST first checks the magic number. If it matches, it proceeds; if not, it retries from step 1.
The Atari ST then calculates a checksum for the received data and compares it to the RP2040's checksum. If they match, the process continues; otherwise, it retries as in the magic number check.
Writing Data:
The Atari ST calculates a checksum for the data to be written and sends this along with the data to the RP2040.
The RP2040 verifies the received checksum against its calculation. If they match, the data is stored and an acknowledgment is sent; if not, a negative acknowledgment is returned.
The Atari ST first validates the magic number. If correct, it continues; otherwise, it retries from step 1.
The Atari ST checks the acknowledgment from the RP2040. If positive, the operation completes; if negative, it retries from step 1.
This enhancement aims to improve data transfer reliability, especially in conditions where UART and debugging are enabled, which have been identified as scenarios where this issue is more likely to manifest.
The current implementation of synchronous commands in the disk emulator utilizes a magic number exchange between the Atari ST code and the RP2040 code to confirm message transmission and acknowledgment. While this method ensures the execution of synchronous operations and safe data exchange, it is not foolproof.
Issues can arise during data transfer if bits are misplaced due to bus contention while accessing the network or SD drive. In such cases, although the magic number may be correctly exchanged, the data itself can become corrupted.
To address this, we propose adding a checksum verification mechanism to enhance data integrity during disk transfer operations. This process would involve the following steps:
Reading Data:
Writing Data:
This enhancement aims to improve data transfer reliability, especially in conditions where UART and debugging are enabled, which have been identified as scenarios where this issue is more likely to manifest.