Annotation of sbbs/src/sbbs3/fossinfo.c, revision 1.1.1.1

1.1       root        1: /* Builds with Borland C++ for DOS, v3.1 */
                      2: 
                      3: #include <dos.h>
                      4: #include <stdio.h>
                      5: #include <memory.h>
                      6: #include <string.h>            /* _fstrncpy */
                      7: #include "fossdefs.h"
                      8: 
                      9: void main(int argc, char** argv)
                     10: {
                     11:        BYTE far*       bp;
                     12:        fossil_info_t info;
                     13:        WORD    ax,bx;
                     14:        char id_string[128];
                     15:        union REGS regs;
                     16:        struct SREGS sregs;
                     17: 
                     18:        printf("\nChecking FOSSIL interrupt vector (interrupt 0x%02X)\n", FOSSIL_INTERRUPT);
                     19:        bp=(void far*)_dos_getvect(FOSSIL_INTERRUPT);
                     20: 
                     21:        printf("FOSSIL interrupt vector: 0x%08lX\n",bp);
                     22:        printf("Signature: 0x%04X (should be 0x%04X)\n", *(WORD far*)(bp+6), FOSSIL_SIGNATURE);
                     23:        printf("Highest function supported: 0x%02X\n", *(BYTE far*)(bp+8));
                     24: 
                     25: 
                     26:        printf("\nInitializing FOSSIL\n");
                     27:        regs.h.ah = FOSSIL_FUNC_INIT;
                     28:        int86(FOSSIL_INTERRUPT, &regs, &regs);
                     29:        printf("AX=0x%04X (should be 0x%04X)\n", regs.x.ax, FOSSIL_SIGNATURE);
                     30:        printf("BX=0x%04X (FOSSIL rev %u, highest function supported: 0x%02X)\n"
                     31:                ,regs.x.bx, regs.h.bh, regs.h.bl);
                     32: 
                     33:        printf("\nGetting FOSSIL Information\n");
                     34:        printf("sizeof(info)=%u\n",sizeof(info));
                     35:        memset(&info,0,sizeof(info));
                     36: 
                     37: /**
                     38:  AH = 1Bh    Return information about the driver
                     39: 
                     40:            Parameters:
                     41:                Entry:  CX = Size of user info buffer in bytes
                     42:                        DX = Port number
                     43:                        ES = Segment of user info buffer
                     44:                        DI = Offset into ES of user info buffer
                     45:                Exit:   AX = Number of bytes actually transferred
                     46: 
                     47: **/
                     48: 
                     49:        bp = (BYTE far*)&info;
                     50:        regs.h.ah = FOSSIL_FUNC_GET_INFO;
                     51:        regs.x.cx = sizeof(info);
                     52:        regs.x.dx = 0;
                     53:        sregs.es = FP_SEG(bp);
                     54:        regs.x.di = FP_OFF(bp);
                     55: 
                     56:        int86x(FOSSIL_INTERRUPT, &regs, &regs, &sregs);
                     57:        printf("AX=0x%04X (%u)\n",regs.x.ax,regs.x.ax);
                     58:        printf("Information structure size: %u\n", info.info_size);
                     59:     printf("FOSSIL specific revision: %u\n", info.curr_fossil);
                     60:     printf("FOSSIL driver revision: %u\n", info.curr_rev);
                     61:     printf("ID string: 0x%08lX\n",info.id_string);
                     62:        if(info.id_string) {
                     63:                _fstrncpy(id_string,(char far *)info.id_string,sizeof(id_string));
                     64:                printf("ID string: %s\n", id_string);
                     65:        }
                     66:     printf("Receive buffer size: %u\n", info.inbuf_size);
                     67:     printf("Receive buffer space: %u\n",info.inbuf_free);
                     68:     printf("Transmit buffer size: %u\n", info.outbuf_size);
                     69:     printf("Transmit buffer space: %u\n",info.outbuf_free);
                     70:     printf("Screen width: %u\n",info.screen_width);
                     71:     printf("Screen height: %u\n", info.screen_height);
                     72:     printf("Baud rate: 0x%02X (%u %c-%u-%u)\n"
                     73:                ,info.baud_rate
                     74:                ,fossil_baud_rate[(info.baud_rate&FOSSIL_BAUD_RATE_MASK)>>FOSSIL_BAUD_RATE_SHIFT]
                     75:                ,fossil_parity[(info.baud_rate&FOSSIL_PARITY_MASK)>>FOSSIL_PARITY_SHIFT]
                     76:                ,fossil_data_bits[(info.baud_rate&FOSSIL_DATA_BITS_MASK)>>FOSSIL_DATA_BITS_SHIFT]
                     77:                ,fossil_stop_bits[(info.baud_rate&FOSSIL_STOP_BITS_MASK)>>FOSSIL_STOP_BITS_SHIFT]
                     78:                );
                     79: 
                     80:        if(argc>1 && stricmp(argv[1],"pause")==0) {
                     81:                printf("\nHit enter to continue...");
                     82:                getchar();
                     83:        }
                     84: }      

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.