Difference between revisions of "Protocols"

From Ninerpedia
Jump to navigation Jump to search
Line 6: Line 6:
== XModem protocol ==
== XModem protocol ==


The XModem protocol transmits data in a sequence of blocks.
The XModem protocol transmits data in a sequence of blocks.
 
=== Basic XModem ===
 
Each block contains 128 bytes of the file to be transmitted.


{| class="xmodem"
{| class="xmodem"
Line 16: Line 20:
|}
|}


where each block is defined in this way (numbers tell the number of bytes for each field):
Each block is defined in this way (numbers tell the number of bytes for each field):


{| class="xmodem"
{| class="xmodem"
Line 26: Line 30:
|-
|-
| SOH
| SOH
| Number
| /Number
| Data bytes
| Checksum
|}
The number is a sequence number which increases by one for each successive block. The /Number field is the one's complement of the Number field and calculates as 255-Number.
The checksum field contains the least significant byte of the sum of the data bytes of this block.
The receiver has a timeout of 10 seconds, after which it transmits a NAK.
=== XModem-1K ===
XModem-1K is a variation of XModem with 1K (1024) bytes for each data block.
{| class="xmodem"
! 1
! 1
! 1
! style="width:400px" | 1024
! 1
|-
| STX
| Number
| Number
| /Number
| /Number

Revision as of 21:01, 7 May 2011

Communication with devices

Here is a commented log when formatting a SSSD floppy disk with the TI disk controller. Actually, this dump was achieved using MESS and putting in some printf lines.


XModem protocol

The XModem protocol transmits data in a sequence of blocks.

Basic XModem

Each block contains 128 bytes of the file to be transmitted.

Block Block Block ... Block

Each block is defined in this way (numbers tell the number of bytes for each field):

1 1 1 128 1
SOH Number /Number Data bytes Checksum

The number is a sequence number which increases by one for each successive block. The /Number field is the one's complement of the Number field and calculates as 255-Number.

The checksum field contains the least significant byte of the sum of the data bytes of this block.

The receiver has a timeout of 10 seconds, after which it transmits a NAK.

XModem-1K

XModem-1K is a variation of XModem with 1K (1024) bytes for each data block.

1 1 1 1024 1
STX Number /Number Data bytes Checksum