A Kermit File Transfer Protocol for the Apple II Series Personal Computers : John Patrick Francisco Lehigh University
Total Page:16
File Type:pdf, Size:1020Kb
Lehigh University Lehigh Preserve Theses and Dissertations 1986 A Kermit file transfer protocol for the Apple II series personal computers : John Patrick Francisco Lehigh University Follow this and additional works at: https://preserve.lehigh.edu/etd Part of the Electrical and Computer Engineering Commons Recommended Citation Francisco, John Patrick, "A Kermit file transfer protocol for the Apple II series personal computers :" (1986). Theses and Dissertations. 4628. https://preserve.lehigh.edu/etd/4628 This Thesis is brought to you for free and open access by Lehigh Preserve. It has been accepted for inclusion in Theses and Dissertations by an authorized administrator of Lehigh Preserve. For more information, please contact [email protected]. A KERMIT FILE TRANSFER PROTOCOL FOR THE APPLE II SERIES PERSONAL COMPUTERS (Using the Apple Pascal Operating system) by John Patrick Francisco A Thesis Presented to the Graduate Committee of Lehigh University in Candidacy for the Degree of Master of Science 1n• Computer Science Lehigh University March 1986 This thesis is accepted and approved in partial fulfillment of the requirements for the degree of Master of science.• (date) Professor in Charge -------------- --------------- Chairman of the Division Chairman of the Department • • -11- ACKNOWLEDGEMENTS It would be somewhat of an understatement to say this project was broad in scope as the disciplines involved ranged from Phychology to Electrical Engineering. Since the project required an extensive amount of detailed in formation in all fields, I was impelled to seek the help, advice and opinion of many. There were also numerous t friends and relatives upon whom I relied for both moral and financial support. Therefore, any reasonalble acknowledge ment could only be a partial list of all those who stood by me during this protracted ordeal. The mere listing that I do provide is, at best, an unworthy expression of the extent of their contribution, and in no way could totally express my deepest and sincerest gratitude. I would first and foremost like to thank Dr. Edwin Kay, ) my advisor, for taking on this project with me, despite the fact that for the past six months we have lived on opposite . " . I sides of the continental U.S. I would especially like to thank Dr. Green for his invaluable assistance. Those two hours he spent with me one August morning not only elimi nated my apprehension toward manipulating the Apple II's hardware, but also rescued this project from its nearly. lethal quagmire and set it onto a steady course to comple tion. I would also like to express my appreciation to Lois Swigart, the secretary for the Psychology Department, for her • • • -111- .' 'l support and assistance with the numerous administative duties and dealings necessitated by my work. I would like to acknowledge the following people for their technical assistance: Samuel Gulden, Dr. Martin Richter, Dr. George Shortess, Dr. s. Lloyd Williams,_Dr.···- Richard Kimbal, Dr. Abdulah Hakawati, Dr. Leroy Tusher, Dr. James Gimple, Frank da Cruz, Peter Floriani, Steve Lidie, William Reynolds, Phillip Goldman, Steve Corbesero, William Mirth, Timothy Foley, Blair Bernhardt, Mark Miller, Deborah McCauley, and last but not least my brother, Frank F. Francisco III. In addition I would like to thank my parents, family and friends for their moral and, in \he case of my father, his financial support, with special thanks to John-Austen McCauley, J. Jeffery Briggs, David Masters, and Dr. John Wydila. Finally I wish to dedicate this work to those who remain. -1v-I TABLE OF CONTENTS Abstract 1 Introduction 3 Chapter 1: Background 6 Chapter 2: The Kermit Protocol 12 Overview 12 System Requirements 13 Terminal Emulation 15 File Transfer 17 Packet Format 30 Negotiations 41 File Types 48 Optional Feature 53 Chapter 3: File Structures 56 Apple II 57 DEC-20 60 Cyber 66 Chapter4: Implementation 74 Conclusion 126 0 Bibliography 127 Appendix A: KERMIT User's Manual 129 Appendix B: Illustrative Programs ·143 . Biography of Author 150 -v- ' ' LIST OF FIGURES 1. Text file transfer from the DEC-20 to the Apple II (File includes line numbers) 29 ,:.. 2. Kermit.packet structure 31 3. Subfields of an Initial Packet Data field 31 4. Packet checksum calculation in binary 38~ 5. Send Initiate Packet breakdown a. DEC-20 49 b. Cyber 50 c. Apple II 51 6. Line structure of an Apple Pascal file 58 7. File structure of an Apple Pascal file 59 8. File transfer from the Apple to the DEC-20 61 9. Line structure of a DEC-20 text file 62 10. File structure of a DEC-20 text file a. including line numbers 64 b. without line numbers 64 c. line numberless file transfer from the DEC-20 65 11. Line structure of a Cyber text file 67 12. File structure of a Cyber text file 70 a. including line numbers ' . b. without line numbers 70 -v1-• 13. File transfers from the Cyber a. without line numbers 71 b. including line numbers 72 14. Externally defined assembly-language procedure 77 15. External variable refe{ence and definition 82 16. External reference routing mechanisms a. control routing routine 83 b. external referencing macros 84 17. Apple Kermit corporate structure 86 18. Table of line addresses for Apple II screen memory 90 19. Screen manipulation routine 92 20. ACIA registers and related routines 97 21. Pascal/Assembly-language linking structures 101 22. Stack safety routine 105 23. Keyboard input routine 107 24. Portion of Adjust Baud routine 109 25. File data to packet data transformation 113 26. File creation routine 118 27. Automatic packet response routine 121 • • -Vll- ABSXRACT Developed by Bill Catchings and Frank da Cruz in the early 1980's, the Kermit protocol provides a means for two computers to exchange files, regardless of any dissimilar ities in hardware or software design, using standard tele communications equipment. The pr9tocol is implemented through the use of programs running on each of the comput ers involved in the commu~ication. These programs encode their system-specific data structures to a Kermit normal ized form when sending a file and translate this Kermit normalized form back again when receiving a file. In ad dition the file is broken down into small segments, called packets, and further encoded with self descriptive infor mation in an effort to maximize data integrity. With this simple design, all that is required to link any two comput ers together is to implement a Kermit protocol program on each of them and have access to a standard communication line. The paper centers around the development and imple- mentation of such a Kermit file transfer protocol program for the Pascal operating system on the Apple II series personal computers. The Kermit protocol itself is pre sented, and its packetizing process for file transfer ex amined. The history of the Kermit protocol is traced from its humble origins at Columbia University to its current -1- ' I international status. The dissimilar file structures of the three computers~involved in the intended communication (the DEC-20, Cyber and Apple II) are also discussed with regard to how these structures affect file transfers using . ,. ~ the Kermit protocol. Finally, an overview of the Pascal and 6502 assembly-language hybrid program, designed to im plement the Kermit protocol, is presented. t 0 -2- ' / .... INTRODUCTION The word "protocol" is derived from the Greek word "protokollon" ( "protos" meaning firs~ and "kollan" meaning to glue together). Protokollon referred to the first sheet of a papyrus roll which bore the data of man ufacture and other pertinent facts about the contents to follow. The Merriam-Webster Dictionary defines protocol as "a preliminary memorandum of diplomatic negotiation [or] a code of diplomatic or military etiquette and precedence." As it applies to computer communications, a protocol de fines the nature of the communication, specifying how to send, receive, and interpret the information or data that is being exchanged. Just as it was important for the Clas sical Greeks to read the "protokollon" first before the rest of the document, so is it imperative that computers are aware of the protocol before communication between them can be established. Today there are hundreds of distinct computer brands, each with its own hardware and software designs. Even the so-called "look-alikes" must be different in some way in order not to violate patent laws. Despite this, the de mands of today's information age require that computers ex- . change information quickly, efficiently, and reliably no ; matter what company produces them. For this reason, ther~ are<:~ numerous protocols designed for computer communica- -3- \ ,: -, tions. The Kermit file transfer protocol is just one of them. Unlike most, Kermit does not require additional ex pensive hardware devices, but relies solely on the most in expensive and readily available medium for data transfer today: the asynchronous telecommunications line. This protocol is carried out by two Kermit programs • running on a computer at either end of a serial communi cation line. A file on the computer designated as the sender is broken down into discrete segments called pack ets, encoded with control and signaling characters, and sent to the designated receiving computer, using an ASCII character-oriented transmission. The receiving computer ,,,,~- then reconstructs the file, interpreting the received pack ets and control characters in accordance with the Kermit protocol and with regard to its own internal structure. All that is necessary for any two computers to communicate, no matter how dissimilar, is to have programs designed to implement the Kermit protocol running on each of them and an asynchronous communication line running between them. There are a mulitiude of Kermit programs written for every type of computer from the largest mainframe to the smallest personal computer. At Lehigh University alone there exist Kermit programs for both the Cyber and DEC-20 mainframes as well as Kermit programs for the Zenith, IBM, and various other personal computers and micros.