<HTML ><HEAD ><TITLE >Xmodem, Ymodem and Zmodem</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="Remote Serial Console HOWTO" HREF="index.html"><LINK REL="UP" TITLE="Uploading files from a serial console" HREF="upload.html"><LINK REL="PREVIOUS" TITLE="ASCII upload and cat" HREF="upload-cat.html"><LINK REL="NEXT" TITLE="Kermit" HREF="upload-kermit.html"></HEAD ><BODY CLASS="SECTION" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >Remote Serial Console HOWTO</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="upload-cat.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" >Appendix B. Uploading files from a serial console</TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="upload-kermit.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="SECTION" ><H1 CLASS="SECTION" ><A NAME="UPLOAD-ZMODEM" ></A >B.3. <SPAN CLASS="APPLICATION" >Xmodem</SPAN >, <SPAN CLASS="APPLICATION" >Ymodem</SPAN > and <SPAN CLASS="APPLICATION" >Zmodem</SPAN ></H1 ><P ><SPAN CLASS="APPLICATION" >Xmodem</SPAN > sends 128 bytes and a checksum, waits for a Acknowledgment to say all is well and sends the next block. If a negative acknowledgement is received or if no <SPAN CLASS="ACRONYM" >ACK</SPAN > or <SPAN CLASS="ACRONYM" >NAK</SPAN > ever appears then the block is sent again.</P ><P ><SPAN CLASS="APPLICATION" >Xmodem</SPAN > is a simple protocol, as you would expect of a program written for 8-bit computers running <SPAN CLASS="SYSTEMITEM" >CP/M</SPAN >. It has lots of inefficiencies and minor problems, such as rounding up the file size to the next 128 byte boundary. These deficiencies lead to an evolution of the protocol with revisions of <SPAN CLASS="APPLICATION" >Xmodem</SPAN >, then <SPAN CLASS="APPLICATION" >Ymodem</SPAN > and finishing with <SPAN CLASS="APPLICATION" >Zmodem</SPAN >. <SPAN CLASS="APPLICATION" >Zmodem</SPAN > is substantially faster than <SPAN CLASS="APPLICATION" >Xmodem</SPAN > and has no niggling problems. The <SPAN CLASS="APPLICATION" >Zmodem</SPAN > protocol is substantially more complex than the <SPAN CLASS="APPLICATION" >Xmodem</SPAN > protocol, but since we only seek to at most compile the code, that complexity need not concern us.</P ><DIV CLASS="INFORMALFIGURE" ><A NAME="AEN3472" ></A ><P ></P ><TABLE BORDER="1" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><FONT COLOR="#000000" ><PRE CLASS="SCREEN" ><TT CLASS="PROMPT" >remote bash$</TT > <B CLASS="COMMAND" >rz</B > <TT CLASS="COMPUTEROUTPUT" >... waiting to receive.**B0100000023be50</TT ></PRE ></FONT ></TD ></TR ></TABLE ><TABLE BORDER="1" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><FONT COLOR="#000000" ><PRE CLASS="SCREEN" ><B CLASS="KEYCAP" >Alt</B >-<B CLASS="KEYCAP" >S</B > <SPAN CLASS="GUIMENU" >Upload</SPAN > <SPAN CLASS="GUIMENUITEM" >zmodem</SPAN > <SPAN CLASS="GUILABEL" >[zmodem upload - Press CTRL-C to quit] Sending: upload.bin Bytes Sent: 3072/ 10000 BPS:2185 ETA 00:09</SPAN ></PRE ></FONT ></TD ></TR ></TABLE ><P ></P ></DIV ><P >If an upload fails and you are left with <B CLASS="COMMAND" >rz</B > waiting to recieve a file then typing <B CLASS="KEYCAP" >Ctrl</B >-<B CLASS="KEYCAP" >X</B > a number of times will return you to the command prompt. This also works for <SPAN CLASS="APPLICATION" >Xmodem</SPAN >'s <B CLASS="COMMAND" >rx</B > and <SPAN CLASS="APPLICATION" >Ymodem</SPAN >'s <B CLASS="COMMAND" >ry</B >.</P ><P >Useful <SPAN CLASS="APPLICATION" >Zmodem</SPAN > abilities are resuming failed uploads and sending multiple files in a single upload session.</P ><P >An implementation of <SPAN CLASS="APPLICATION" >Xmodem</SPAN >, <SPAN CLASS="APPLICATION" >Ymodem</SPAN > and <SPAN CLASS="APPLICATION" >Zmodem</SPAN > for <SPAN CLASS="ACRONYM" >POSIX</SPAN > computers is available from <A HREF="http://www.ohse.de/uwe/software/lrzsz.html" TARGET="_top" >http://www.ohse.de/uwe/software/lrzsz.html</A >. <SPAN CLASS="PRODUCTNAME" >Red Hat Linux</SPAN > distribute this in the <TT CLASS="FILENAME" >lrzsz</TT > <SPAN CLASS="ACRONYM" >RPM</SPAN > package. <SPAN CLASS="APPLICATION" >lrzsz</SPAN > is a enhanced free software branch of the public domain version of <A HREF="ftp://ftp.cs.pdx.edu/pub/zmodem/rzsz.zip" TARGET="_top" ><SPAN CLASS="APPLICATION" >rzsz</SPAN ></A > from <A HREF="http://www.omen.com/" TARGET="_top" >Omen Technology</A >.</P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="upload-cat.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="upload-kermit.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><SPAN CLASS="ACRONYM" >ASCII</SPAN > upload and <B CLASS="COMMAND" >cat</B ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="upload.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><SPAN CLASS="APPLICATION" >Kermit</SPAN ></TD ></TR ></TABLE ></DIV ></BODY ></HTML >