From: crash!bblue@SDCSVAX.ARPA Date: Sun, 23 Jun 85 22:28:22 PDT To: info-apple@brl Subject: Christensen Protocol extensions for Apple In response to several requests regarding the extensions to the Christensen Protocol that are implemented in our ASCII Express "Pro" series of software: -------------------------- Ascii Express "The Professional" Extensions to the Christensen Protocol This document Copyright (c) 1985 by Mark Robbins and Bill Blue, United Software Industries, Inc. Document date: 06/02/85 Ascii Express "The Professional" (ProDOS and DOS 3.3 versions) hereafter referred to as AEPro, uses Christensen non-batch checksum protocol, with one (DOS 3.3) or two (Pro-DOS) extensions for the Apple world. Throughout this discussion, it is assumed you have a working knowledge of the original Christensen protocol. There is one additional packet at startup exchanged when transferring between two DOS 3.3 AEPro's, and two additional packets exchanged (one at startup and one at the end) between two ProDOS AEPro's. A STARTUP PACKET tells the receiving side that a DOS 3.3 file type is about to be sent, and identifies that type. It also indicates to a ProDOS AEPRO that a FINAL PACKET will be sent at the end of the DATA PACKETS. Prior to receipt of the STARTUP PACKET the receiving AEPro will have already opened the specified file as a standard ($00 filetype) textfile. After the STARTUP PACKET is received and the filetype is not $00, the file is deleted and reopened under the correct filetype. If no Special Start Of Header is received, AEPro will fall into standard Christensen receive, leaving the filetype as Text. The format of the STARTUP PACKET is: Byte 1 Special Start Of Header SOH+msb ($81) Byte 2 DOS 3.3 file type (MSB stripped) See "Beneath Apple Dos" AEPro ProDOS version always sends $00 Byte 3 Complement of byte 2 (xor Byte 2 with $FF) The receiving side must send an ACK ($06) to the sending side to acknowledge successful reception of the STARTUP PACKET. Successful reception is assumed if bytes two and three are received as complements of each other. The regular Christensen protocol begins for all remaining DATA PACKETS. If the receiver is not an AEPro, but is some other implementation of Christensen protocol, it will NAK ($15) the Special Start Of Header. Upon receipt of a NAK, the sender will try two more times, and then fall into standard protocol mode. The FINAL PACKET will be received only if the file is being sent by a ProDOS AEPro. This packet is designed to tell the receiving side all about the file; i.e., filetype, number of blocks used, the modification date and time, End of File marker, etc. At the conclusion of all the DATA PACKETS, receipt of the final EOT ($04) from the sender, responding to it with an ACK, and if a STARTUP PACKET was received at the beginning of the exchange, the ProDOS receiving side then sends a SYN ($16) and waits two seconds for an ETB ($17) from the sender. It retries the SYN and waits for an ETB up to three times before giving up. If the ETB is received then it sends a NAK to start the FINAL PACKET. If all went well to this point, the receiver expects a block of data in the following format. The block is identified as number $AA. {$01} {$AA} {$55} {128 data bytes} {checksum of the data bytes} This packet is handled the same way as DATA PACKETS, ACK if okay and NAK if not. Checksums are calculated by adding all data bytes mod 256, with any carry ignored. Currently, of the 128 bytes of data, only the first 23 bytes are currently significant. Essentially, these bytes are made up of the ProDOS GET_FILE_INFO and GET_EOF paramater lists. For the exact meaning of each byte, refer to the Apple ProDOS Technical Reference Manual. GET_FILE_INFO Parameter List: Byte 1 param_count (always send $0A) Byte 2 fixed_param (always send $D4) Byte 3 fixed_param (always send $41) Byte 4 access byte 5 file_type Byte 6 low aux_type Byte 7 high aux_type Byte 8 storage_type Byte 9 low blocks_used Byte 10 high blocks_used Byte 11 byte 0 mod_date Byte 12 byte 1 mod_date Byte 13 byte 0 mod_time Byte 14 byte 1 mod_time Byte 15 byte 0 create_date Byte 16 byte 1 create_date Byte 17 byte 0 create_time Byte 18 byte 1 create_time SET_EOF Parameter List: Byte 19 param_count (always send $02) Byte 20 ref_num (doesn't matter) Byte 21 EOF Low byte Byte 22 EOF Middle byte Byte 23 EOF High byte -------------------------- --Bill Blue crash!bblue@ucsd {ihnp4, cbsogd, sdcsvax, noscvax}!crash!bblue