Posting refers to the SCSI manager making a FAR call to a post routine as specified in the SRB. This can be used by a driver much like a hardware interrupt might be used. Post routines have all the same privileges and restrictions as a hardware-interrupt service routine in OS/2. Posting is optional, but should almost always be used in OS/2.

To use Posting, the post bit must be set in the SCSI request flags. The post routine is called to indicate that the requested I/O is complete. The specific SRB completed is indicated by the four-byte SRB pointer on the stack. The DS of the post routine as specified in the SRB is also passed to the stack. The post routine will be called with interrupts enabled. It is assumed that all registers are preserved by the post routine.

   ASPI_Post          proc         far
                      push         bp             ;Use bp as a reference
                      mov          bp,sp

                      pusha                       ;Save all registers
                      push         es             ;Save ES
                      mov          bx,[bp+6]      ;Load DS of POST routine
                      mov          ax,[bp+10]     ;Physical address of SRB-->AX:BX
                      mov          ax,[bp+8]
                                   .
                                   .
                                   .
                      pop          es             ;Restore registers
                      popa
                      pop          ds

                      pop          bp
                      retf
   ASPI_Post                                  endp

When your post routine is first entered, the stack looks like this:

                       ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
Top of Stack  [SP+0] > ³ Return Address (Offset)  ³
                       ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
              [SP+2] > ³ Return Address (Segment) ³
                       ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
              [SP+4] > ³ SRB Pointer (Offset)     ³
                       ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
              [SP+6] > ³ SRB Pointer (Segment)    ³
                       ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
                       ³        . . .             ³
                       ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
                       ³        . . .             ³
                       ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
                       ³        . . .             ³
                       ³                          ³
                       ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

You can issue any ASPI command from within your post routine except for an abort command. Your post routine should get in and out as quickly as possible.


[Back: SCSI Command Linking With ASPI]
[Next: ASPI Command Code = 3: Abort SCSI I/O Request]