home *** CD-ROM | disk | FTP | other *** search
- ; FIDDS.A86
- title 'FIDDS routines'
- ;pagesize 60+11
- ;********************************************************
- ;* *
- ;* CP/M FIELD INSTALLABLE DEVICE DRIVER HOOKS *
- ;* CDOS 6.0 XIOS *
- ;* DRI OS ENGR, JMB, GMS, JW *
- ;* *
- ;********************************************************
-
-
- ; Major mods:
- ; 6.0
- ; 6 APR 88 -- added extra space for Sun River terminal support
- ; 29 SEP 87 -- support multiple virtual on serial
- ; 9 SEP 87 -- return error from read_fid and write_fid
- ; 5.2
- ; 13 APR 87 -- support lots of consoles
- ; 25 MAR 86 -- add get int. vectors call
- ; 24 MAR 86 -- add TMP history buffer support
- ; 27 SEP 85 -- add sysdat_alloc call
- ; 11 JUN 85 -- update 4.1 ASM86 XIOS to RASM86
-
- ; include COPYRITE.TXT
-
- nolist
- include CDOS.EQU
- include XIOS.EQU
- list
- ; The following was include:
- ; include CDOS.EQU
- ; include XIOS.EQU
-
- CGROUP group CODE
- DGROUP group fidds_dseg
-
- public sel_fid@, read_fid@, write_fid@
- public i_dummy_fidds@, i_fidds_flag@
- public sysdat_alloc@
- public sysdat_buff_base$, sysdat_buff_length$, sysdat_buff_link$
- public check_init_reuse@
- public prog_hist_base$, comm_hist_base$, ser_hist_base$
-
-
-
- public io_get_history_buff@, io_get_vectors@
-
- extrn XIOS_END:near, INIT_START:near
- extrn ros_vectors$:byte
- dseg
- extrn ccb_list$ :word
- eject
-
- ; CCPM-86 v1.0 FIDDS has been completely disabled because it gave us some
- ; problems when pc-mode BASIC hammered the interrupt vectors.
-
- cseg
-
- sel_fid@:
- ;--------
- sub ax,ax ; null return
- ret
-
- read_fid@:
- ;---------
-
- write_fid@:
- ;----------
- mov ax,8001h ; return "Not ready" error
- ret
-
-
- ; Dummy FIDDS interrupt routine for non-disks:
-
- i_dummy_fidds@:
- ;-------------
- ; sub ax,ax ; zero for no select
- ; iret
-
-
- ; Interrupt to return the lowest numbered unused system
- ; flag to FIDDS, to be used for a flagwait to eternity.
-
- i_fidds_flag@:
- ;------------
- sub ax,ax
- iret
-
- ; Since FIDDS is not currently being supported, we'll just set the top
- ; flag to zero, and any existing CP/M FIDDS driver will think that there
- ; is no room for itself.
-
- eject
-
- sysdat_alloc@:
- ;------------
- ; Optional XIOS function to allocate buffer space in SYSDAT area to
- ; caller (device drivers, etc.):
- ; Entry: CX = bytes requested:
- ; Exit: AX != 0 --> buffer offset
- ; AX = 0 --> space not available, DX = max space left
- ; CX = preserved
-
- mov bp,cx
- call check_init_reuse@ ; first try init space
- jnc good_ret ; leave if we got it
-
- mov dx,sysdat_buff_length$ ; else look in reserved buff.
- cmp cx,dx
- ja zero_ret ; if too big
- sub dx,cx ; dx now = what's left
- mov sysdat_buff_length$,dx ; replace
- mov ax,sysdat_buff_base$
- add sysdat_buff_base$,cx ; and replace
- good_ret:
- ret
- zero_ret:
- sub ax,ax
- ret
-
- check_init_reuse@:
- ;-----------------
- ; Allocate init space:
- ; Entry: bp = bytes wanted
- ; Exit: ax = offset, or C set if no room
- mov ax,init_start
- mov bx,ax
- add bx,bp ; add amount requested
- jc no_room ;
- cmp bx,init_end
- ja no_room
- mov init_start,bx
- clc ! ret
- no_room:
- stc ! ret
-
-
- io_get_vectors@:
- ;===============
- mov ax,offset ros_vectors$
- ret
-
-
- io_get_history_buff@:
- ;====================
- ; Return the segment address of the command-line recall structure/buffer(s) for
- ; the calling console:
- ; This function called only by the TMPs.
-
- ; Entry: DL == virtual console #
- ; Exit: AX == segment of COMMAND history structure/buffer
- ; DX == segment of PROGRAM history structure/buffer
- ; AX and/or DX == 0 if command-line recall not supported
-
- ; Initial history structure/buffer:
- ;----------------------------------
- ; dw 0, BUFFER_LENGTH |
- ; db 0 |
- ; rb BUFFER_LENGTH |
- ;----------------------------------
-
- mov bl,dl
- mov dx,prog_hist_base$ ; all share same
- cmp bl,NUM_VIR_CONS
- jae ser_term
-
- ; Here if a virtual con...all 4 share one buff:
- mov ax,comm_hist_base$
- ret
-
- ; Serial console - get its logical physical console number
- ; Virtual consoles share same buffer
- ser_term:
- xor bh,bh
- shl bx,1
- mov bx,ccb_list$[bx] ; get ccb pointer for VS
- mov bl,C_PC[bx] ; get physical console number
- dec bl ; first serial is console 1
- xor bh,bh
- shl bx,1
- mov ax,ser_hist_base[bx]
- ret
-
-
-
- fidds_dseg dseg
-
- sysdat_buff_link$ dw 0000 ; space to link to next spare block
- sysdat_buff_base$ rw 1 ; done in INIT based on SETUP request
- sysdat_buff_length$ rw 1 ; ditto
-
- init_start dw INIT_START
- init_end dw XIOS_END
-
- prog_hist_base$ rw 1 ; allocated in INIT.
- comm_hist_base$ rw 1
-
- ser_hist_base$ rw 24 ; support lots of consoles
- ; one buffer per physical
- end
-
-
- ; END OF FIDDS.A86
-
-