home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / FSC.ZIP / FSC-0015.DOC < prev    next >
Text File  |  1988-02-11  |  36KB  |  832 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.                  Fundamentals of FOSSIL implementation and use
  15.  
  16.                         Version 5,  February 11,  1988
  17.  
  18.                        Rick Moore,  Solar Wind Computing
  19.                           FidoNet Address:  1:115/333
  20.  
  21.  
  22.  
  23.  
  24.  
  25.                  FidoNet Standards Committee index:  FSC-0015
  26.  
  27.                  This document supersedes/obsoletes: FSC-0008
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  Copyright (C) 1987, VEP Software, Naugatuck, CT 06770. All rights reserved.
  48.  Copyright (C) 1988, Rick Moore,  Homewood,  IL, 60430. All rights reserved.
  49.  
  50.  This document may be freely used or copied by anyone interested in the data
  51.  contained herein. No fees may be charged for distribution of this document.
  52.  You will be held  accountable for all such charges,  and expected to either
  53.  reimburse those persons or organizations so charged,  or to make a donation
  54.  in the exact amount of those fees to the International FidoNet Association,
  55.  to  assist  them in their  efforts to  advance the  technology of  personal
  56.  computer telecommunications.
  57.  
  58. Fundamentals of FOSSIL implementation and use                       FSC-0015
  59. Introduction                                                          Page 2
  60.  
  61.  
  62.  
  63.  A. Objectives of this document
  64.  
  65.     This document is directed at implementors or intellectuals.  It is meant
  66.     for use in implementing applications that can use FOSSIL drivers, or for
  67.     details needed to implement a new FOSSIL. As such it won't always go out
  68.     of its way to explain itself to the neophyte.
  69.  
  70.     This document will have served its purpose to you if you are able to use
  71.     the data contained within to perform either of the above tasks.   If you
  72.     feel  that necessary  data has  been omitted  please contact  Rick Moore
  73.     at the above listed address so that the  appropriate changes can be made.
  74.     Any lines changed in the current version are marked with "|" in the left
  75.     margin.
  76.  
  77.  
  78.  B. Historical perspective
  79.  
  80.     For those people who were not lucky enough to have an IBM PC or a system
  81.     nearly completely compatible, the world has not been very friendly. With
  82.     his implementation of the Generic Fido(tm) driver,  Tom Jennings made it
  83.     possible for systems that had nothing in common with an IBM PC except an
  84.     808x-class processor, and the ability to run MS-DOS Version 2 and above,
  85.     to run his Fido(tm) software. That was a lot to ask, and a lot of people
  86.     thought it was enough.
  87.  
  88.     But not everyone.  While Thom Henderson was debugging Version 4.0 of his
  89.     SEAdog(tm) mail package,  an "extended" Generic driver was designed  (in
  90.     cooperation with Bob Hartman)   as a quick kludge to help him get past a
  91.     problem with certain UART chips.The new hook was quickly pounced upon by
  92.     Vince Perriello,  who, with almost DAILY prodding (ouch! it still hurts)
  93.     by Ken Kaplan,had been working with Henderson to get DEC Rainbow support
  94.     into SEAdog. Vince then coded a driver to use this hook and - Voila! -
  95.     SEAdog 4.0 started working like a champ on the Rainbow.
  96.  
  97.     At the same time something was rotten in the state of Texas. Wynn Wagner
  98.     started  encountering some serious  difficulties in his Opus development
  99.     effort. Specifically, he couldn't force the Greenleaf(tm) Communications
  100.     Libraries to behave in exactly the way he felt Opus required.  Enter Bob
  101.     Hartman.Having already enjoyed success in the effort with Thom Henderson,
  102.     he suggested to Wynn that with very few extensions,  any driver that was
  103.     already  SEAdog(tm) 4.0 compatible could drive Opus as well.  About that
  104.     time, Vince called Wynn to discuss porting Opus to the DEC Rainbow. Wynn
  105.     called Bob, Bob called Vince, and the FOSSIL driver came into existence.
  106.  
  107.     FOSSIL is an acronym for "Fido/Opus/SEAdog Standard Interface Layer". To
  108.     say that the concept has gained wide acceptance in the FidoNet community
  109.     would be an understatement. Henk Wevers' DUTCHIE package uses the FOSSIL
  110.     communications services.   Ron Bemis' OUTER package uses FOSSIL services
  111.     for everything it does and as a result it is completely generic.   There
  112.     are already FOSSIL implementations for the Tandy 2000, Heath/Zenith 100,
  113.     Sanyo 555 and other "non-IBM" architectures. With each new 'port' of the
  114.     spec, the potential of a properly coded FOSSIL application grows!
  115.  
  116. Fundamentals of FOSSIL implementation and use                       FSC-0015
  117. Basic conventions and calling method                                  Page 3
  118.  
  119.  
  120.  
  121.  C. Basic principles of a FOSSIL driver
  122.  
  123.     1)  Interrupt 14h.
  124.  
  125.     The one basic rule that the driver depends upon,  is the ability for ANY
  126.     target machine to allow the vector for INT 14h (usually pointing to BIOS
  127.     comm functions) to be "stolen" by the driver.  In a system where the INT
  128.     14h vector is used already, it must be possible to replace the "builtin"
  129.     functionality with that of a FOSSIL,  when an application that wants the
  130.     use of a FOSSIL is to be run on the target machine.
  131.  
  132.  
  133.     2)  How to install a FOSSIL driver in a system
  134.  
  135.     There's no hard and fast way to do this. The FOSSIL might be implemented
  136.     as part of a device driver (like Ray Gwinn's X00.SYS) and therefore gets
  137.     loaded using a line in CONFIG.SYS at bootup time.  It might be done as a
  138.     TSR (terminate and stay resident) program, in which event you install it
  139.     by running the program  (DECcomm by Vince Perriello and Opus!Comm by Bob
  140.     Hartman work this way, for example).
  141.  
  142.  
  143.     3)  How an application can detect the presence of a FOSSIL
  144.  
  145.     The driver has a "signature" that can be used to determine whether it is
  146.     present in memory. At offset 6 in the INT 14h service routine is a word,
  147.     1954h,  followed  by a  byte that  specifies the maximum function number
  148.     supported by the driver. This is to make it possible to determine when a
  149.     driver is present and what level of functionality it provides. Also, the
  150.     Init call (see below)  returns a 1954h  in AX.  SEAdog(tm)  looks at the
  151.     signature and Opus just goes for the Init. Fido doesn't do either.
  152.  
  153.  
  154.     4)  How to call a FOSSIL function
  155.  
  156.     The FOSSIL driver  is entered  by issuing  a software Interrupt 14h from
  157.     the application  program. The code corresponding to the desired function
  158.     should be in 8-bit register AH. For calls that relate to communications,
  159.     the port number will be passed from the application in register DX. When
  160.     DX contains a zero (0) it signifies use of COM1, or whatever the "first"
  161.     serial port on your machine is called. A one (1) in DX points the driver
  162.     at COM2, and so on.  A value of 00FFh in DX is considered a special case
  163.     where the driver  should do no actual processing but return SUCCESS.  In
  164.     the specific case of Init/Uninit with DX=00FFh,the FOSSIL should perform
  165.     all non-communications  processing  necessary  with such calls.  In some
  166.     machines  (H/Z-100 for example),  the FOSSIL must  assume control of the
  167.     keyboard in order to service the keyboard functions.
  168.  
  169.     FOR ALL FUNCTIONS,  ALL REGISTERS NOT SPECIFICALLY CONTAINING A FUNCTION
  170.     RETURN VALUE MUST BE PRESERVED ACROSS THE CALL.
  171.  
  172. Fundamentals of FOSSIL implementation and use                       FSC-0015
  173. Communications functions                                              Page 4
  174.  
  175.  
  176. D. Functions currently defined for FOSSILs
  177.  
  178.  
  179.     AH = 00h    Set baud rate
  180.  
  181.             Parameters:
  182.                 Entry:  AL = Baud rate code
  183.                         DX = Port number
  184. |               Exit:   AX = Port status (see function 03h)
  185.  
  186.     This works the same as the  equivalent IBM PC BIOS call,  except that it
  187.     ONLY selects a baud rate.  This is passed in the high order 3 bits of AL
  188.     as follows:
  189.  
  190.                 010 =   300 baud
  191.                 011 =   600  ''
  192.                 100 =  1200  ''
  193.                 101 =  2400  ''
  194.                 110 =  4800  ''
  195.                 111 =  9600  ''
  196.                 000 = 19200  '' (Replaces old 110 baud mask)
  197.                 001 = 38400  '' (Replaces old 150 baud mask)
  198.  
  199.     The low order 5 bits can be implemented or not by the FOSSIL, but in all
  200.     cases, if the low order bits of AL are 00011,  the result should be that
  201.     the communications device should be set to eight data bits, one stop bit
  202.     and no parity. This setting is a  MINIMUM REQUIREMENT  of Fido, Opus and
  203.     SEAdog.  For purposes of completeness,  here are the IBM PC "compatible"
  204.     bit settings:
  205.  
  206.     Bits 4-3 define parity:     0 0       no parity
  207.                                 1 0       no parity
  208.                                 0 1      odd parity
  209.                                 1 1     even parity
  210.  
  211.     Bit 2 defines stop bits:      0        1 stop bit;
  212.                                   1      1.5 bits for 5-bit char;
  213.                                            2 for others
  214.  
  215.     Bits 1-0 character length:  0 0        5 bits
  216.                                 0 1        6 bits
  217.                                 1 0        7 bits
  218.                                 1 1        8 bits
  219.  
  220. Fundamentals of FOSSIL implementation and use                       FSC-0015
  221. Communications functions                                              Page 5
  222.  
  223.  
  224.     AH = 01h    Transmit character with wait
  225.  
  226.             Parameters:
  227.                 Entry:  AL = Character
  228.                         DX = Port number
  229.                 Exit:   AX = Port status (see function 03h)
  230.  
  231.     AL contains the character to be sent.   If there is room in the transmit
  232.     buffer the return will be immediate,  otherwise it will wait until there
  233.     is room to store the character in the transmit buffer.  On return, AX is
  234.     set as in a status request (see function 03h).
  235.  
  236.  
  237.     AH = 02h    Receive character with wait
  238.  
  239.             Parameters:
  240.                 Entry:  DX = Port number
  241.                 Exit:   AH = 00h
  242.                         AL = Input character
  243.  
  244.     If there is a character  available in the  receive buffer,  returns with
  245.     the next character in AL.  It will wait until a character is received if
  246.     none is available.
  247.  
  248.  
  249.     AH = 03h    Request status
  250.  
  251.             Parameters:
  252.                 Entry:  DX = Port number
  253.                 Exit:   AX = Status bit mask (see below)
  254.  
  255.     Returns with the line and modem status in AX.  Status bits returned are:
  256.  
  257.             In AH:
  258.                 Bit 0 = RDA  - input data is available in buffer
  259. |               Bit 1 = OVRN - the input buffer has been overrun.  All
  260. |                              characters received after the buffer is
  261. |                              full should be discarded.
  262.                 Bit 5 = THRE - room is available in output buffer
  263.                 Bit 6 = TSRE - output buffer is empty
  264.  
  265.             In AL:
  266. |               Bit 3 = Always 1 (always return with this bit set to 1)
  267.                 Bit 7 = DCD  - carrier detect
  268.  
  269.     This can be used by the application to determine  whether carrier detect
  270.     (CD) is set,  signifying the presence/absence of a remote connection, as
  271.     well as monitoring both the input and output buffer status.  Bit 3 of AL
  272.     is always returned set to enable programs to use it as a carrier detect
  273.     bit on hardwired (null modem) links.
  274.  
  275. Fundamentals of FOSSIL implementation and use                       FSC-0015
  276. Communications functions                                              Page 6
  277.  
  278.  
  279.     AH = 04h    Initialize driver
  280.  
  281.             Parameters:
  282.                 Entry:  DX = port number
  283.                       ( BX = 4F50h
  284. |                       ES:CX = ^C flag address --- optional )
  285.                 Exit:   AX = 1954h if successful
  286. |                       BL = maximum function number supported
  287. |                            (not counting functions 7Eh and above)
  288. |                       BH = rev of FOSSIL doc supported
  289.  
  290.     This is used to tell the driver to begin  operations,  and to check that
  291.     the driver is installed. This function should be called before any other
  292.     communications calls are made.  At this point all interrupts involved in
  293.     supporting the comm port (specified in DX) should be set up for handling
  294.     by  the  FOSSIL, then  enabled.  If BX contains 4F50h,  then the address
  295.     specified in ES:CX is that of a ^C flag byte in the application program,
  296.     to be incremented when  ^C is detected in the keyboard service routines.
  297.     This is an optional service and only need be supported on machines where
  298.     the keyboard service can't (or won't) perform an INT 1Bh or INT 23h when
  299. |   a Control-C is entered.  DTR is raised by this call.  The baud rate must
  300. |   NOT be changed by this call.
  301.  
  302.     NOTE: Should an additional call to this service occur  (2 Inits or Init,
  303.     Read,Init, etc.) the driver should reset all buffers, flow control, etc.
  304.     to the INIT state and return SUCCESS.
  305.  
  306.  
  307.     AH = 05h    Deinitialize driver
  308.  
  309.             Parameters:
  310.                 Entry:  DX = Port number
  311.                 Exit:   None
  312.  
  313.     This is used to tell the driver that comm port operations are ended. The
  314.     function should be called  when no more comm port functions will be used
  315.     on the port specified in DX.  DTR is NOT affected by this call.
  316.  
  317.  
  318.     AH = 06h    Raise/lower DTR
  319.  
  320.             Parameters:
  321.                 Entry:  DX = Port number
  322.                         AL = DTR state to be set (01h = Raise, 00h = Lower)
  323.                 Exit:   None
  324.  
  325.     This function is used to control the DTR line to the modem. AL = 00h means
  326.     lower DTR (disable the modem), and AL = 01h means to raise DTR (enable the
  327.     modem).  No other function (except Init) should alter DTR.
  328.  
  329. Fundamentals of FOSSIL implementation and use                       FSC-0015
  330. Communications functions                                              Page 7
  331.  
  332.  
  333.     AH = 07h    Return timer tick parameters
  334.  
  335.             Parameters:
  336.                 Entry:  None
  337.                 Exit:   AL = Timer tick interrupt number
  338.                         AH = Ticks per second on interrupt number in AL
  339.                         DX = Approximate number of milliseconds per tick
  340.  
  341.     This is used to  determine the parameters of the timer tick on any given
  342.     machine.  Three numbers are returned:
  343.  
  344.         AL =   Timer tick interrupt number
  345.         AH =   Ticks per second on interrupt number shown in AL
  346.         DX =   Milliseconds per tick (approximate)
  347.  
  348.     Applications can use this for critical timing  (granularity of less than
  349.     one second) or to set up code  (such as a watchdog)  that is executed on
  350.     every timer tick. See function 16h (add/delete function from timer tick)
  351.     for the preferred way of actually installing such code.
  352.  
  353.  
  354.     AH = 08h    Flush output buffer
  355.  
  356.             Parameters:
  357.                 Entry:  DX = Port number
  358.                 Exit:   None
  359.  
  360.     This is used to force any pending output.   It does not return until all
  361.     pending output has been sent.  You should use this call with care.  Flow
  362.     control  (documented below)  can make your system hang on this call in a
  363.     tight uninterruptible loop under the right circumstances.
  364.  
  365.  
  366.     AH = 09h    Purge output buffer
  367.  
  368.             Parameters:
  369.                 Entry:  DX = Port number
  370.                 Exit:   None
  371.  
  372.     This is used to purge any pending output.   Any output data remaining in
  373.     the output buffer (not transmitted yet) is discarded.
  374.  
  375.  
  376.     AH = 0Ah    Purge input buffer
  377.  
  378.             Parameters:
  379.                 Entry:  DX = Port number
  380.                 Exit:   None
  381.  
  382.     This is used to purge any pending input.   Any input data which is still
  383.     in the buffer is discarded.
  384.  
  385. Fundamentals of FOSSIL implementation and use                       FSC-0015
  386. Communications functions                                              Page 8
  387.  
  388.  
  389.     AH = 0Bh    Transmit no wait
  390.  
  391.             Parameters:
  392.                 Entry:  DX = Port number
  393.                 Exit:   AX = 0001h - Character was accepted
  394.                            = 0000h - Character was not accepted
  395.  
  396.     This is exactly the same as the "regular"  transmit call, except that if
  397.     the driver is  unable to  buffer the character  (the buffer is full),  a
  398.     value of 0000h is returned in AX. If the driver accepts the character
  399.     (room is available),  0001h is returned in AX.
  400.  
  401.  
  402.     AH = 0Ch    Non-destructive read-ahead
  403.  
  404.             Parameters:
  405.                 Entry:  DX = Port number
  406.                 Exit:   AH = 00h           - Character is
  407.                         AL = Next character    available
  408.                         AX = FFFFh         - Character is not available
  409.  
  410.     Return in AL the next character in the receive buffer.  If the receive
  411.     buffer is empty,  return  FFFFh.  The  character  returned  remains in
  412.     the receive buffer. Some applications call this "peek".
  413.  
  414.  
  415.     AH = 0Dh    Keyboard read without wait
  416.  
  417.             Parameters:
  418.                 Entry:  None
  419.                 Exit:   AX = IBM-style scan code (Character available)
  420.                            = FFFFh               (Character not available)
  421.  
  422.     Return in  AX the  next character  (non-destructive read ahead)  from the
  423.     keyboard; if nothing is currently in the keyboard buffer, return FFFFh in
  424.     AX.   Use IBM-style  function  key mapping  in the high order byte.  Scan
  425.     codes for non-"function" keys  are not specifically required,  but may be
  426.     included. Function keys return 00h in AL and the "scan code" in AH.
  427.  
  428.  
  429.     AH = 0Eh    Keyboard read with wait
  430.  
  431.             Parameters:
  432.                 Entry:  None
  433.                 Exit:   AX = IBM-style scan code
  434.  
  435.     Return in AX the next character from the keyboard;  wait if no character
  436.     is available. Keyboard mapping should be the same as function 0Dh.
  437.  
  438. Fundamentals of FOSSIL implementation and use                       FSC-0015
  439. Communications functions                                              Page 9
  440.  
  441.  
  442.     AH = 0Fh    Enable or disable flow control
  443.  
  444.             Parameters:
  445.                 Entry:  AL = Bit mask describing requested flow control
  446.                         DX = Port number
  447.                 Exit:   None
  448.  
  449.     TRANSMIT flow control allows the "other end" to restrain the transmitter
  450.     when you are  over-running it.  RECEIVE flow control tells the FOSSIL to
  451.     attempt to do just that if it is being overwhelmed.
  452.  
  453.     Two kinds of basic flow control are supported:
  454.  
  455.                 Bit 0 = 1       Xon/Xoff on transmit
  456.                 Bit 1 = 1       CTS/RTS (CTS on transmit, RTS on receive)
  457.                 Bit 2           Reserved
  458. |               Bit 3 = 1       Xon/Xoff on Receive
  459.  
  460.     Flow control is enabled, or disabled, by setting the appropriate bits in
  461.     AL  for the types of flow control we want to ENABLE (value = 1),  and/or
  462.     DISABLE  (value = 0),  and calling this function.  Bit 2 is reserved for
  463.     DSR/DTR,  but is not currently supported in any implementation.
  464.  
  465.     Enabling  transmit  Xon/Xoff will cause the FOSSIL  to stop transmitting
  466.     upon receiving an Xoff.  The FOSSIL will resume transmitting when an Xon
  467.     is received.
  468.  
  469.     Enabling CTS/RTS will cause the FOSSIL to cease transmitting when CTS is
  470.     lowered.  Transmission will resume  when CTS is raised.  The FOSSIL will
  471.     drop RTS when the receive buffer reaches a predetermined percentage full
  472.     The FOSSIL will  raise RTS  when the  receive buffer  empties below  the
  473.     predetermined  percentage full.  The  point(s)  at which  this occurs is
  474.     left to the individual FOSSIL implementor.
  475.  
  476. |   Enabling receive  Xon/Xoff will cause the FOSSIL to send a Xoff when the
  477. |   receive buffer reaches a pre-determined percentage full.  An Xon will be
  478. |   sent when the receive buffer empties below the pre-determined percentage
  479. |   full. The point(s) at which this occurs is left to the individual FOSSIL
  480. |   implementor.
  481.  
  482.     Applications  using this  function  should set all bits  ON  in the high
  483.     nibble of AL as well.  There is a compatible  (but not identical) FOSSIL
  484.     driver implementation that uses the  high nibble as a control mask.   If
  485.     your application sets the high nibble to all ones,  it will always work,
  486.     regardless of the method used by any given driver.
  487.  
  488. Fundamentals of FOSSIL implementation and use                       FSC-0015
  489. Communications functions                                             Page 10
  490.  
  491.  
  492.     AH = 10h    Extended Control-C / Control-K checking and transmit on/off
  493.  
  494.             Parameters:
  495.                 Entry:  AL = Bit mask (see below)
  496.                         DX = Port number
  497.                 Exit:   AX = 0001h - Control-C/K has been received
  498.                            = 0000h - Control-C/K has not been received
  499.  
  500.     This is used for BBS  operation,  primarily.  A bit mask is passed in AL
  501.     with the following flags:
  502.  
  503.                 Bit 0   Enable/disable Control-C / Control-K checking
  504.                 Bit 1   Disable/enable the transmitter
  505.  
  506.     The Enable (bit 0 = 1) and Disable (Bit 0 = 0) Control-C/Control-K check
  507.     function is meant primarily for BBS use. When the checking is enabled, a
  508.     Control-C or Control-K received  from the communications port will set a
  509.     flag internal to the FOSSIL driver,  but will not be stored in the input
  510.     buffer. The next use of this function will return the value of this flag
  511.     in register AX then clear the flag for the next occurrence. The returned
  512.     value is used by the BBS  software to determine whether output should be
  513.     halted or not.
  514.  
  515.     The Disable (Bit 1 = 1) and Enable (Bit 1 = 0) Transmitter function lets
  516.     the application restrain the asynchronous driver from output in much the
  517.     same way as XON/XOFF would.
  518.  
  519.  
  520.     AH = 11h    Set current cursor location.
  521.  
  522.             Parameters:
  523.                 Entry:  DH = Row (line)
  524.                         DL = Column
  525.                 Exit:   None
  526.  
  527.     This function looks exactly like like INT 10h, subfunction 2, on the IBM
  528.     PC. The cursor location is passed in DX: row in DH and column in DL. The
  529.     function treats the screen as a coordinate  system whose origin (0,0) is
  530.     the upper left hand corner of the screen.
  531.  
  532.  
  533.     AH = 12h    Read current cursor location.
  534.  
  535.             Parameters:
  536.                 Entry:  None
  537.                 Exit:   DH = Row (line)
  538.                         DL = Column
  539.  
  540.     Looks exactly like INT 10h,  subfunction 3,  on the IBM PC.  The current
  541.     cursor location  (using the same coordinate  system as  function 16h) is
  542.     passed back in DX.
  543.  
  544. Fundamentals of FOSSIL implementation and use                       FSC-0015
  545. Communications functions                                             Page 11
  546.  
  547.  
  548.     AH = 13h    Single character ANSI write to screen.
  549.  
  550.             Parameters:
  551.                 Entry:  AL = Character to display
  552.                 Exit:   None
  553.  
  554.     The character in AL is sent to the screen by the fastest method possible
  555.     that allows ANSI processing to occur (if available). This routine should
  556.     not be used in such a way that DOS output  (which is not re-entrant) can
  557.     not be employed by some FOSSIL driver to perform the function  (in fact,
  558.     on the IBM PC that is likely to be how it's done).  On some systems such
  559.     as the DEC Rainbow this will be a very fast method of screen writing.
  560.  
  561.  
  562.     AH = 14h    Enable or disable watchdog processing
  563.  
  564.             Parameters:
  565.                 Entry:  AL = 01h - Enable watchdog
  566.                            = 00h - Disable watchdog
  567.                         DX = Port number
  568.                 Exit:   None
  569.  
  570.     When watchdog is enabled,   the state of the carrier detect (CD) line on
  571.     the comm port specified in DX should be constantly monitored. Should the
  572.     state of that line become FALSE (carrier lost), the system should be re-
  573.     booted, to enable the BBS (or other application) to start up again. This
  574.     monitor is not affected by Init/Uninit etc.
  575.  
  576.  
  577.     AH = 15h    Write character to screen using BIOS support routines
  578.  
  579.             Parameters:
  580.                 Entry:  AL = Character to display
  581.                 Exit:   None
  582.  
  583.     The character in AL is sent to the screen using  BIOS-level Input/Output
  584.     routines. This differs from function 13h in that DOS I/O CAN NOT be used,
  585.     as this function might be called from driver level.
  586.  
  587. Fundamentals of FOSSIL implementation and use                       FSC-0015
  588. Communications functions                                             Page 12
  589.  
  590.  
  591.     AH = 16h    Insert or delete a function from the timer tick chain
  592.  
  593.             Parameter:
  594.                 Entry:  AL = 01h - Add a function
  595.                            = 00h - Delete a function
  596. |                       ES = Segment of function
  597.                         DX = Offset of function
  598.                 Exit:   AX = 0000h - Operation successful
  599.                            = FFFFh - Operation unsuccessful
  600.  
  601.     This function is used to allow a  central authority  to manage the timer
  602.     interrupts, so that as code is loaded and unloaded, the integrity of the
  603.     "chain" is not compromised.  Rather than using the traditional method of
  604.     saving the old contents of the timer vector, storing the address of your
  605.     routine there,  and executing a far call to the "old" routine when yours
  606.     is done, instead you call this function. It manages a list of such entry
  607.     points and calls them on a timer tick (interrupt) using a FAR call.  All
  608.     the usual cautions about making DOS calls apply (that is, DON'T!).
  609.  
  610.     This makes it possible for a program to get in and out of the tick chain
  611.     without having to know whether another program has also done so since it
  612.     first insinuated itself.   At least 4 entries should be available in the
  613.     driver's table (including one to be used by Watchdog if implemented that
  614.     way).
  615.  
  616.  
  617.     AH = 17h    Reboot system
  618.  
  619.             Parameters:
  620.                 Entry:  AL = 00h - "Cold boot"
  621.                            = 01h - "Warm boot"
  622.  
  623.     Perform the old 3-finger salute.  Used in extreme emergency by code that
  624.     can't seem to find a "clean" way out of the trouble it has gotten itself
  625.     into.  Hopefully it won't happen while you're computing something in the
  626.     other half of a DoubleDOS system. If your machine can make a distinction
  627.     between a "cold" (power-up, self-test and boot) and a "warm" (just boot)
  628.     bootstrap,  your FOSSIL should support the flag in AL. Otherwise just do
  629.     whatever bootstrap is possible.
  630.  
  631. Fundamentals of FOSSIL implementation and use                       FSC-0015
  632. Communications functions                                             Page 13
  633.  
  634.  
  635. |   AH = 18h    Read block (transfer from FOSSIL to user buffer)
  636.  
  637. |           Parameters:
  638. |               Entry:  CX = Maximum number of characters to transfer
  639. |                       DX = Port number
  640. |                       ES = Segment of user buffer
  641. |                       DI = Offset into ES of user buffer
  642. |               Exit:   AX = Number of characters actually transferred
  643.  
  644. |   A "no-wait"  block read of 0 to FFFFh characters from the FOSSIL inbound
  645. |   ring buffer to the calling routine's buffer. ES:DI are left unchanged by
  646. |   the call; the count of bytes actually transferred will be returned in AX.
  647.  
  648.  
  649. |   AH = 19h    Write block (transfer from user buffer to FOSSIL)
  650.  
  651. |           Parameters:
  652. |               Entry:  CX = Maximum number of characters to transfer
  653. |                       DX = Port number
  654. |                       ES = Segment of user buffer
  655. |                       DI = Offset into ES of user buffer
  656. |               Exit:   AX = Number of characters actually transferred
  657.  
  658.  
  659. |   A  "no-wait"  block  move of 0  to FFFFh  characters  from  the  calling
  660. |   program's  buffer into  the  FOSSIL outbound ring buffer. ES:DI are left
  661. |   unchanged by the call;  the count of bytes actually transferred  will be
  662. |   returned in AX.
  663.  
  664.  
  665. |   AH = 1Ah    Break begin or end
  666.  
  667. |           Parameters:
  668. |               Entry:  AL = 01h - Start sending 'break'
  669.                            = 00h - Stop sending 'break'
  670. |                       DX = port number
  671. |               Exit:   None
  672.  
  673. |   Send a break signal to the modem. If AL=01h the driver will commence the
  674. |   transmission of a break.  If AL=00h the driver will end the break.  This
  675. |   is useful for communications with devices that can only go into 'command
  676. |   mode' when a BREAK is received. Note: the application is responsible for
  677. |   the timing of the BREAK.  Also,  if the FOSSIL has been restrained by an
  678. |   Xoff received from the modem, the flag will be cleared.   An Init or Un-
  679. |   Init will stop an in-progress BREAK.
  680.  
  681. Fundamentals of FOSSIL implementation and use                       FSC-0015
  682. Communications functions                                             Page 14
  683.  
  684.  
  685. |   AH = 1Bh    Return information about the driver
  686.  
  687. |           Parameters:
  688. |               Entry:  CX = Size of user info buffer in bytes
  689. |                       DX = Port number
  690. |                       ES = Segment of user info buffer
  691. |                       DI = Offset into ES of user info buffer
  692. |               Exit:   AX = Number of bytes actually transferred
  693.  
  694. |   Transfer information about the driver and its current status to the user
  695. |   for use in determining,  at the application level, limits of the driver.
  696. |   Designed to assist  "generic" applications  to adjust to "foreign" gear.
  697.  
  698. |   The data structure currently returned by the driver is as follows (sorry
  699. |   but you'll have to live with assembly syntax):
  700.  
  701. |       info    equ     $               ; define begin of structure
  702. |       strsiz  dw      info_size       ; size of the structure in bytes
  703. |       majver  db      curr_fossil     ; FOSSIL spec driver conforms to
  704. |       minver  db      curr_rev        ; rev level of this specific driver
  705. |       ident   dd      id_string       ; "FAR" pointer to ASCII ID string
  706. |       ibufr   dw      ibsize          ; size of the input buffer (bytes)
  707. |       ifree   dw      ?               ; number of bytes left in buffer
  708. |       obufr   dw      obsize          ; size of the output buffer (bytes)
  709. |       ofree   dw      ?               ; number of bytes left in the buffer
  710. |       swidth  db      screen_width    ; width of screen on this adapter
  711. |       sheight db      screen_height   ; height of screen    "     "
  712. |       baud    db      ?               ; ACTUAL baud rate, computer to modem
  713. |       info_size equ $-info
  714.  
  715. |   The ident string should be  null-terminated,  and NOT contain a newline.
  716. |   The baud rate byte contains the bits that  Function 00h would use to set
  717. |   the port to that speed.
  718.  
  719. |   The fields related to a particular port (buffer size,  space left in the
  720. |   buffer,  baud rate) will be undefined if port FFh  or an invalid port is
  721. |   contained in DX.
  722.  
  723. |   Additional information will always be passed after these,  so that,  for
  724. |   example, offset "sheight" will never change with FOSSIL revision changes.
  725.  
  726. Fundamentals of FOSSIL implementation and use                       FSC-0015
  727. "Layered Application" services                                       Page 15 
  728.  
  729.  
  730.  
  731. |   The functions below are not necessarily FOSSIL related. However, because
  732. |   dispatchers  that support them are hooked on Interrupt 14H,  it behooves
  733. |   the FOSSIL developer to support them as well to avoid fragmenting memory
  734. |   with several dispatchers.
  735.  
  736.  
  737.  
  738. |   AH = 7Eh    Install an "external application" function
  739.  
  740. |           Parameters:
  741. |               Entry:  AL = Code assigned to external application
  742. |                       DX = Offset of application entry point
  743. |                       ES = Segment of application entry point
  744. |               Exit:   AX = 1954h
  745. |                       BL = Code assigned to application (same as input AL)
  746. |                       BH = 01h - Installation was successful
  747. |                          = 00h - Installation failed
  748.  
  749. |   This call is used by external application code  (special screen drivers,
  750. |   modem code, database code, etc) to link into the INT 14h service for use
  751. |   by multiple applications. The "error return" (BH=0 with AX=1954h) should
  752. |   mean that  another application layer has  already been installed at that
  753. |   particular code. Codes 80h through BFh should be supported.
  754.  
  755. |   External application codes 80h-83h are  reserved by FOSSIL developers for
  756. |   re-organizing FOSSIL services by type (comm, screen, keyboard, system).
  757.  
  758. |   Installed application code will be entered, via a FAR call, from the INT
  759. |   14H dispatcher whenever it is entered with AH=(application code).
  760.  
  761. |   If the value returned in AX from this function is not 1954h, the service
  762. |   code that is trying to be installed should bring up its own INT 14h code
  763. |   that can service INT 14h functions 7h-BFh (80h-BFh are "applications").
  764.  
  765.  
  766. |   AH = 7Fh    Remove an "external application" function
  767.  
  768. |           Parameters:
  769. |               Entry:  AL = Code assigned to external application
  770. |                       DX = Offset of application entry point
  771. |                       ES = Segment of application entry point
  772. |               Exit:   AX = 1954h
  773. |                       BL = Code assigned to application (same as input AL)
  774. |                       BH = 01h - Removal was successful
  775. |                          = 00h - Removal failed
  776.  
  777. |   Removes an application's entry into the table.  Usually so it can remove
  778. |   itself from memory. Error return means ES:DX did not match or that there
  779. |   is no entry at the slot described by AL.
  780.  
  781. |   An application that wants to remove itself from memory can issue the  7F
  782. |   function to remove itself from the table, then, if it is successful, get
  783. |   out of memory. If it had to install itself with an INT 14h dispatcher it
  784. |   may back itself out, provided no other applications  have been installed
  785. |   on top of it (using its dispatcher).
  786.  
  787.  
  788. Fundamentals of FOSSIL implementation and use                       FSC-0015
  789.                                                                      Page 16
  790.  
  791.  
  792.  
  793. E.  Validation Suite.
  794.  
  795.     Well, there is one, but it's involved.   Here is a list of software that
  796.     is known to use FOSSIL calls,  and the range of calls used by that
  797.     software:
  798.  
  799.         Software package                        Fossil calls used
  800.  
  801.     Fido,  V11w,  generic version                  00h - 07h
  802.     SEAdog,  V4.1b                                 00h - 0Eh
  803.     Opus,  V1.03a                                  00h - 17h
  804.     BinkleyTerm,  V1.30                            00h - 1Bh
  805.  
  806.     While  there is  certainly no  guarantee that your FOSSIL is bug-free if
  807.     all the above software runs  with it,  you  have probably  done as  much
  808.     as you  can in  a test environment if your FOSSIL is tested with each of
  809.     these packages.
  810.  
  811.  
  812.  
  813.  F. Technical Discussion.
  814.  
  815.     A FOSSIL echomail conference exists,  for the purpose of exchanging info
  816.     and implementation details for FOSSIL drivers.  It is coordinated by Ray
  817.     Gwinn at FidoNet node 1:109/639.  Contact him for details on how to join.
  818.     Keep in mind though,  that this conference is intended  SPECIFICALLY for
  819.     implementors of FOSSIL  software and not as a general Q&A conference for
  820.     people who think FOSSILs have something to do with paleontology.
  821.  
  822.  
  823.  
  824. G. Distribution Of This Document.
  825.  
  826.    This document may be distribute freely as long as it is  not  modified in
  827.    any  way.  Please  list  all  changes  and  deviations  in a given FOSSIL
  828.    implementation in an addendum contained in a  separate file added  to the
  829.    FOSSIL archive.   Also,  please  do  not distribute this document without
  830.    the accompanying version of FOSSIL.CHT.   This will help avoid confusion,
  831.    among both FOSSIL implementors and application developers.
  832.