home *** CD-ROM | disk | FTP | other *** search
- Avatar Serial Dispatcher Page 1
- Copyright (C) 1991 G. Adam Stanislav
- All Rights Reserved January 20, 1991
-
- 1. This document is intended for programmers writing communication software
- for IBM PC/XT/AT and compatible computers.
-
- 2. A common problem we have to deal with is the fact that another program
- may be running concurrently with ours, trying to access a serial port which
- shares the same IRQ with our own serial port.
-
- 3. Up till now the only feasible solution was to use a FOSSIL driver loaded
- before the multitasking program. Unfortunately, there is a limitation to
- this solution: Not all programmers like using FOSSIL, mostly because it may
- not be available to program user, or at times because it does not do all our
- program needs.
-
- 4. Avatar Serial Dispatcher (ASD) offers a new solution to this problem. As
- long as software is written to comply with the following specs, different
- programs can access serial ports sharing the same IRQ, whether using a FOSSIL
- or their own routines.
-
- 5. ASD is built into AVATAR.SYS, both the commercially available versions
- and the version included for free with the AVT/1 console specs.
-
- 6. ASD is an int 0Bh and int 0Ch dispatcher. Whenever one of these interrupts
- occurs, the ASD will call user installed routines starting with the most
- recently installed, ending with the first one or with the one that returns
- with AX = 0.
-
- 7. ASD saves all registers and allocates enough local stack. ASD takes care
- of sending 20h to port 20h after all routines were called. Under no
- circumstances should the installed routines send 20h to port 20h on their
- own.
-
- 8. Each routine should end with a far return. It should make AX = 0 if it
- finds the interrupt was meant for it. Otherwise it should make AX equal
- something else. Each and every routine is called with AX unequal 0, so if
- the interrupt is not for you, you can just leave AX as it is.
-
- 8. The commercially available versions of AVATAR.SYS can have up to 20
- different routines installed for int 0Bh and 20 others for int 0Ch.
- The version that comes with AVT/1 console specs has room for up to 8 each.
-
- 9. To install a routine, make ES:DI point at your routine, AX = 1Ah, BX = 'AV',
- AL = 'B' or 'C', depending on whether you want the routine called by int 0Bh
- or int 0Ch. Make sure DS contains the data segment your routine needs.
- Then call int 2Fh. ASD will restore your DS before calling your routine.
- That is very handy for routines written in high languages, such as C, Pascal,
- or Basic.
-
- 10. Int 2Fh will return AX unchanged if AVATAR.SYS (or another ASD handler)
- is not installed. It will return AX = 0, if no more room is left in ASD.
- On success, AX will contain a handle which you can later use to deinstall
- your routine.
- Avatar Serial Dispatcher Page 2
- Copyright (C) 1991 G. Adam Stanislav
- All Rights Reserved January 20, 1991
-
-
- 11. To deinstall your routine, make AH = 1Ah, BX = 'AV', CX = handle,
- AL = 'b' or 'c'. Then call int 2Fh.
-
- 12. If installation fails because there is no ASD handler, use the old
- method of installing your own int 0Bh or 0Ch handler which saves all
- registers, allocates local stack, sets DS, and calls the same routine you
- would otherwise install with ASD.
-
- 13. It is possible to modify existing FOSSIL drivers to follow this spec.
- That way FOSSIL programs can co-exist with programs that use their own
- serial routines.
-
- 14. The important thing to remember is that ASD saves all registers, checks
- the value of AX after each routine, restores all registers and informs the
- PIC of the end of interrupt. Thus, the routines need not worry about saving
- and restoring any registers, and about sending 20h to port 20h. They should
- make sure to return 0 in AX if the interrupt was meant for them.
-
- 15. Most high languages place return values in AX, which makes it very
- easy to use ASD.
-
- 16. If this document is too terse, let me know, I will expand it further.
- I can be reached via Fidonet at 1:129/39.0, or via US Mail at Stanislav
- Publishing, 322 Mall Blvd., Suite 174, Monroeville, PA 15146.
-
-