Digital Research
This commit is contained in:
2020-11-06 18:50:37 +01:00
parent 621ed8ccaf
commit 31738079c4
8481 changed files with 1888323 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
Herein lie all sources to following CCP/M-86 2.0 modules:
BDOS.CON
WARNING! There are several .DEF files in this group with the same name
as the .DEF files compiled with the Kernel. THESE FILES ARE NOT NECESSARILY
THE SAME, AND SHOULD BE KEPT SEPARATE!!!!
This module is assembled using ASM86 running under CP/M or CP/M-86.

View File

@@ -0,0 +1,546 @@
;*****************************************************
;*
;* bdos interface
;*
;*****************************************************
BMPM equ true
BCPM equ false
cseg
org 0
jmp init ;bdos initialization
jmp entry ;inter module entry pt.
sysdat dw 0 ;seg address of sysdat
supervisor rw 2 ;supervisor offset and segment
dev_ver rw 1 ;set by sysdat.bdo, chk'd by GENSYS
db 'COPYRIGHT(C)1983,'
db 'DIGITAL RESEARCH(04/06/83)'
db 'XXXX-0000-654321'
;====
init: ; initialize bdos/xios modules
;====
; entry: DS = system data area
; code segment values setup by gensys
; mov sysdat,ds
; mov ax,supmod
; mov cs:supervisor,ax
; mov ax,supmod+2
; mov cs:supervisor+2,ax
retf
;*****************************************************
;*
;* bdos function table
;*
;*****************************************************
; structure of entry in functab
btab_addr equ word ptr 0
btab_flag equ byte ptr (btab_addr + word)
bf_getmx equ 00001b ;get mxdisk queue
bf_cshell equ 00010b ;conditional shell function
bf_fcb33 equ 00100b ;33 byte fcb flag
bf_fcb36 equ 01000b ;36 byte fcb flag
bf_resel equ 10000b ;disk reselect flag
; bdos function table
functab dw func13 ! db 00001b ; fxi13 equ 00h ;disk reset
dw func14 ! db 00001b ; fxi14 equ 01h ;select disk
dw func15 ! db 10101b ! fxi15 equ 02h ;open file
dw func16 ! db 10101b ! fxi16 equ 03h ;close file
dw func17 ! db 00101b ! fxi17 equ 04h ;search first
dw func18 ! db 00001b ! fxi18 equ 05h ;search next
dw func19 ! db 10101b ! fxi19 equ 06h ;delete file
dw func20 ! db 10111b ! fxi20 equ 07h ;read sequential
dw func21 ! db 10111b ! fxi21 equ 08h ;write sequential
dw func22 ! db 00101b ! fxi22 equ 09h ;make file
dw func23 ! db 10101b ! fxi23 equ 0Ah ;rename file
dw func24 ! db 00000b ; fxi24 equ 0Bh ;return login vector
dw func25 ! db 00000b ; fxi25 equ 0Ch ;return current disk
dw func26 ! db 00000b ; fxi26 equ 0Dh ;set dma address
dw func27 ! db 00001b ! fxi27 equ 0Eh ;get alloc addr
dw func28 ! db 00001b ; fxi28 equ 0Fh ;write protect disk
dw func29 ! db 00000b ; fxi29 equ 10h ;get r/o vector
dw func30 ! db 00101b ! fxi30 equ 11h ;set file attributes
dw func31 ! db 00001b ! fxi31 equ 12h ;get disk parm addr
dw func32 ! db 00000b ; fxi32 equ 13h ;set/get user code
dw func33 ! db 11011b ! fxi33 equ 14h ;read random
dw func34 ! db 11011b ! fxi34 equ 15h ;write random
dw func35 ! db 11001b ! fxi35 equ 16h ;compute file size
dw func36 ! db 01001b ; fxi36 equ 17h ;set random record
dw func37 ! db 00001b ; fxi37 equ 18h ;reset drive
dw func38 ! db 00001b ; fxi38 equ 19h ;access drive
dw func39 ! db 00001b ! fxi39 equ 1Ah ;free drive
dw func40 ! db 11011b ! fxi40 equ 1Bh ;write random w/zero fill
dw func42 ! db 11001b ; fxi42 equ 1Ch ;lock record
dw func43 ! db 11001b ; fxi43 equ 1Dh ;unlock record
dw func44 ! db 00000b ; fxi44 equ 1Eh ;set multi-sector count
dw func45 ! db 00000b ; fxi45 equ 1Fh ;set bdos error mode
dw func46 ! db 00001b ; fxi46 equ 20h ;get disk free space
dw func48 ! db 00001b ! fxi48 equ 21h ;flush buffers
dw func51 ! db 00000b ; fxi51 equ 22h ;set dma base
dw func52 ! db 00000b ; fxi52 equ 23h ;get dma base
dw func98 ! db 00001b ! fxi98 equ 24h ;reset alloc vector
dw func99 ! db 01001b ! fxi99 equ 25h ;truncate file
dw func100 ! db 00101b ! fxi100 equ 26h ;set directory label
dw func101 ! db 00001b ; fxi101 equ 27h ;return directory label data
dw func102 ! db 00101b ! fxi102 equ 28h ;read file xfcb
dw func103 ! db 00101b ! fxi103 equ 29h ;write or update file xfcb
dw func104 ! db 00000b ; fxi104 equ 2Ah ;set current date and time
dw func105 ! db 00000b ; fxi105 equ 2Bh ;get current date and time
dw func106 ! db 00001b ; fxi106 equ 2Ch ;set default password
dw pr_term ! db 00001b ! fxi143 equ 2Dh ;terminate process
;=====
entry: ; bdos module entry point
;=====
; entry: CL = internal bdos function number
; DX = argument
; DS = system data area
; ES = user data area
; exit: AX = BX = return code
xor ch,ch! mov si,cx
shl si,1! add si,cx ; multiply by 3
add si,offset functab
test cs:btab_flag[si],bf_getmx
jz nomx
call getdiskmx
jmps exit
nomx:
xor bx,bx ;initialize return parameter
call cs:btab_addr[si]
exit:
mov ax,bx
retf
getdiskmx:
;---------
; entry: SI = offset of bdos functab entry
; CX = internal bdos function number
; DX = argument
mov bx,rlr
mov ax,p_flag[bx] ! and ax,pf_tempkeep
push ax ;save tempkeep flag
or p_flag[bx],pf_tempkeep ;do not allow ctrl c while in bdos
push si! push dx! push cx
mov cx,f_qread ! mov dx,offset mxdiskqpb
call mpmif ;get mxdisk queue
pop cx! pop dx! pop si
or ax,ax! jz $+5 ;was MXQ read successful?
jmp retmonx1 ;no
mov fx_intrn,cl ;save internal bdos func #
mov bx,rlr
test p_flag[bx],pf_ctlc
jz not_ctlc
xor al,al ;AL = no error message to print
mov bx,0ffffh
jmp retmonxa
not_ctlc:
pushf ! pop ax ! cli ;switch to internal bdos stack
mov ss_save,ss
mov sp_save,sp
mov ss,sysdat
mov sp,offset bdosstack
push ax ! popf
mov pdaddr,bx ;BX = rlr
mov ax,word ptr p_dsk[bx]
mov word ptr seldsk,ax ;set default disk and user code
mov ax,u_wrkseg ;initialize bdos data area for user
mov parametersegment,ax
mov ax,u_retseg
mov returnseg,ax
push es
mov uda_save,es ;save uda segment
push si
mov ax,ds! mov bx,es ;copy uda bdos vars to local area
mov ds,bx! mov es,ax
mov si,offset u_dma_ofst
mov di,offset dma_ofst
mov cx,uda_ovl_len
rep movsb
mov ds,ax
mov ax,dma_ofst
mov cl,4! shr ax,cl
add dma_seg,ax
and dma_ofst,000fh
mov cx,zerolength ! xor al,al ;zero local variables
mov di,offset fcbdsk
rep stosb
test pdcnt,1! jz pdcnt_ok ;reset pdcnt if low order bit set
call inc_pdcnt
pdcnt_ok:
mov info,dx ;info=dx
mov linfo,dl ;linfo = low(info) - don't equ
pop si! push si
mov ah,cs:btab_flag[si]
test ah,bf_fcb33! jz notfcb33 ;if 33 byte fcb
call parsave33! jmps notfcb36 ; copy 33 bytes to local FCB
notfcb33:
test ah,bf_fcb36! jz notfcb36 ;else if 36 byte fcb
call parsave36! call save_rr ; copy 36 bytes to local FCB
notfcb36: ; and save random record bytes
pop si
cmp mult_cnt,1 ! je noshell ;if mult_cnt <> 1 and
test cs:btab_flag[si],bf_cshell ; func uses mult_cnt then
jz noshell
call shell ; use bdos multi sector shell
jmps retmon
noshell:
call call_bdos
retmon:
mov cl,parlg
or cl,cl! jz retmon6
xor ch,ch ;copy local FCB back to user segment?
mov si,offset info_fcb
mov di,info
mov es,parametersegment
rep movsb
retmon6:
pop es ;restore uda segment
mov si,offset dma_ofst+4 ! mov di,offset u_dma_ofst+4
mov cx,uda_ovl_len-4
rep movsb
mov ax,returnseg ;setup return registers
mov u_retseg,ax
mov bx,aret
pushf ! pop ax ! cli ;switch back to user's stack
mov ss,ss_save
mov sp,sp_save
push ax ! popf
mov al,err_type
retmonxa:
push bx ;save return code
test al,true
jz retmonx
js denied_typ
push parametersegment ;fcb segment
mov bx,0ffffh ;0ffffh => no fcb to print in message
test resel,true
jz no_fcb
mov bx,info ;fcb offset
no_fcb:
push bx
jmps comn_dat
denied_typ:
push err_pd_addr ;denied error pd address
comn_dat:
mov ah,err_drv
retmonx:
push ax ;AL = error message type to print
mov cx,f_qwrite ! mov dx,offset mxdiskqpb
call mpmif ;release mxdisk queue
pop ax
test al,0ffh
jnz $+5! jmp retmonx1a
push ax
mov bx,offset msg_spb
mov cx,f_sync
call mpmif
cmp word ptr err_intercept+2,0 ;check if error interception
je ret_err0 ; no
callf dword ptr err_intercept ;call intercept routine
jmp free_spb
ret_err0:
pop ax
add ah,'A'
test al,0ffh
jns $+5! jmp denied_err
push ax
mov dskerr,ah ;set D: field
mov dx,offset dskmsg
call xprint ;print "CP/M Error On D:"
pop ax
mov bl,al
xor bh,bh
shl bx,1
mov dx,xerr_list[bx] ;compute extended error message offset
call xprint ;print error message
mov al,u_func ;convert func# to character
mov ch,30h
mov bx,offset pr_fx1
cmp al,100! jb ret_err1
mov b[bx],31h
inc bx
sub al,100
ret_err1:
sub al,10! jb ret_err2
inc ch
jmps ret_err1
ret_err2:
mov [bx],ch
inc bx
add al,3ah
mov [bx],al
inc bx
mov b[bx],20h
mov bx,offset pr_fcb ;0 = message delimiter
mov b[bx],0
pop si! pop dx ;DX,SI = offset of fcb
inc si ;was reselect called?
jz ret_err3 ;no - don't print fcb
mov b[bx],20h ;remove delimiter
mov di,offset pr_fcb1
mov ax,ds! mov bx,es
mov es,ax ;ES = DS
mov ds,dx ;DS = parametersegment
mov cx,4 ;move file name to message
rep movsw
mov es:b[di],'.' ;move '.' to message
inc di
mov cl,3 ;move file type to message
rep movsb
mov ds,ax! mov es,bx ;restore DS,ES
ret_err3:
mov dx,offset pr_fx ;print "bdos function = ### "
call xprint ; + "file = ffffffff.ttt"
jmps free_spb
denied_err:
mov denieddrv,ah
pop si
mov al,p_cns[si]
add al,'0'
mov deniedcns,al
add si,p_name
mov di,offset deniedprc
push es! push ds! pop es ;ES = DS
mov cx,4 ;copy process name to message
rep movsw
pop es ;restore ES
mov dx,offset deniedmsg
call xprint
free_spb:
mov dx,offset crlf_str
call xprint
mov bx,offset msg_spb
mov cx,f_unsync
call mpmif
retmonx1a:
pop bx ;restore retcode
retmonx1:
mov si,rlr
pop ax ;restore tempkeep flag
or ax,not pf_tempkeep
and p_flag[si],ax
test p_flag[si],pf_ctlc ;see if control C occured
jz mxdiskexit
mov cx,f_terminate! xor dx,dx
push bx! call mpmif! pop bx
mxdiskexit:
ret
call_bdos:
;---------
; entry: DX = argument
; SI = offset of bdos functab entry
mov save_sp,sp
test cs:btab_flag[si],bf_resel
jz cbdos1
push si
call reselect
pop si
cbdos1:
call cs:btab_addr[si]
bdos_return:
cmp resel,0
je retmon5
cmp comp_fcb_cks,true! jne retmon1
call set_chksum_fcb
retmon1:
mov al,xfcb_read_only
mov bx,offset info_fcb
or f7[bx],al
mov al,high_ext
cmp al,60h! jne retmon3
or byte ptr f8[bx],80h
jmps retmon4
retmon3:
or extnum[bx],al
retmon4:
mov al,actual_rc
or reccnt[bx],al
mov al,fcbdsk
mov drv[bx],al
retmon5:
ret
shell:
;-----
; entry: SI = offset of functab entry
mov shell_si,si
mov ah,cs:btab_flag[si]
mov al,mult_cnt
mult_io1:
MOV MULT_NUM,AL
push ax
mov si,shell_si
mov dx,info
call call_bdos
mov bl,byte ptr aret
or bl,bl
pop ax
jz no_shell_err
cmp bl,0ffh! je shell04
mov bh,mult_cnt
sub bh,al ;BH = # of successfull records
jmps shell03
no_shell_err:
test ah,bf_fcb36! jz mult_io2 ;AH = entry functab flags
call incr_rr
mult_io2:
add dma_ofst,80h
dec al
jnz mult_io1
xor bx,bx
shell03:
mov aret,bx
shell04:
test ah,bf_fcb36! jz parret
;jmps reset_rr
reset_rr:
;--------
call save_rr2! jmps save_rr1
save_rr:
;-------
call save_rr2! xchg bx,dx
save_rr1:
mov cl,3! jmp move
save_rr2:
mov bx,offset info_fcb+ranrec
mov dx,offset shell_rr
ret
parsave33: ;copy 33 byte length FCB
;---------
mov cl,33
jmps parsave
parsave36: ;copy 36 byte length FCB
;---------
mov cl,36
parsave: ;copy FCB from user segment to bdos segment
;-------
; entry: CL = length of FCB to save
mov parlg,cl
xor ch,ch
mov si,info
mov di,offset info_fcb
push ds
mov ds,parametersegment
rep movsb
pop ds
parret:
ret
incr_rr:
;-------
; exit: AX = preserved
mov bx,offset info_fcb+ranrec
inc w[bx]! jnz incr_rr_ret
inc byte ptr 2[bx]
incr_rr_ret:
ret
xprint: ;print message at DX
;------
; entry: DX = offset of message to print
push dx
mov cx,f_cconattch ;make sure we own console before
call mpmif ; attempting to print message
pop dx
or al,al! jnz parret
mov cx,f_conprint
;jmps mpmif
;these functions added for mpm interface
;=====
mpmif: ;call mpm function
;=====
mov si,rlr
push es! mov es,p_uda[si]
callf cs:dword ptr supervisor
pop es
ret
;*****************************************************
;*
;* bdos - xios interface
;*
;*****************************************************
;====== ========================
xiosif: ; xios interface routine
;====== ========================
; entry: AL = function number
; CX = argument 1
; DX = argument 2
; exit: AX = BX = output
push es! mov es,uda_save
callf dword ptr xiosmod
cld! pop es
ret
;======== ================================
rwxiosif: ; disk read/write xios interface
;======== ================================
; entry: AL = function number
; exit: AX = BX = output
mov dx,arecord
mov ch,byte ptr arecord+2
mov bl,curdsk
mov bh,1
xchg bh,mult_sec ;BH = multi sector count
; stack on entry to the xios
push bx ; +C | DRV | MCNT |
push track ; +A | TRACK |
push sector ; +8 | SECTOR |
push cur_dma_seg ; +6 | DMA_SEG |
push cur_dma ; +4 | DMA_OFF |
; +2 | RET_SEG |
; SP+0 | RET_OFF |
mov es,uda_save
callf dword ptr xiosmod
add sp,10 ;remove parameters from stack
cld! push ds! pop es
ret


View File

@@ -0,0 +1,469 @@
;*****************************************************
;*
;* bdos data area
;*
;*****************************************************
CCPMOFF equ true
if BCPM
;
; 8086 variables that must reside in code segment
;
cseg $
;
axsave dw 0 ; register saves
ss_save dw 0
sp_save dw 0
stack_begin dw endstack
;
; variables in data segment:
;
dseg cpmsegment
org bdosoffset+bdoscodesize
header rs 128
rs 72
pag0 dw 0 ;address of user's page zero
ip0 db 0 ;initial page value for ip register
;
; memory control block
;
umembase dw 0 ;user'sbase for memory request
umemlg dw 0 ;length of memory req
contf db 0 ;flag indicates added memory is avail
;
;
hold_info dw 0 ;save info
hold_spsave dw 0 ;save user sp during program load
hold_sssave dw 0 ;save user ss during program load
mod8080 db 0
;
; byte i/o variables:
;
compcol db 0 ;true if computing column position
strtcol db 0 ;starting column position after read
column db 0 ;column position
listcp db 0 ;listing toggle
kbchar db 0 ;initial key char = 00
endif
dseg
if BMPM
org 0c00h ;org for MP/M system
endif
if BMPM and CCPMOFF
org 0800h ;org for CCP/M system
endif
if BMPM
rlog dw 0 ;removeable logged-in disks
tlog dw 0 ;removeable disk test login vector
ntlog dw 0 ;new tlog vector
endif
rodsk dw 0 ;read only disk vector
dlog dw 0 ;logged-in disks
open_fnd db 0 ;open file found in srch_olist
;the following variables are set to zero upon entry to file system
fcbdsk db 0 ;disk named in fcb
parlg db 0 ;length of parameter block copied
aret dw 0 ;adr value to return
lret equ byte ptr aret ;low(aret)
resel db 0 ;reselection flag
rd_dir_flag db 0 ;must read/locate directory record
comp_fcb_cks db 0 ;compute fcb checksum flag
search_user0 db 0 ;search user 0 for file (open)
make_xfcb db 0 ;make & search xfcb flag
find_xfcb db 0 ;search find xfcb flag
xdcnt dw 0 ;empty directory dcnt
DIR_CNT DB 0 ;DIRECT I/O COUNT
MULT_NUM DB 0 ;MULTI-SECTOR COUNT used in bdos
olap_type db 0 ;record lock overlap type
ff_flag db 0 ;0ffh xios error return flag
err_type db 0 ;type of error to print if not zero
rb 4 ;reserved bytes
zerolength equ (offset $)-(offset fcbdsk)
mult_sec db 1 ;multi sector count passed to xios
RELOG DB 0 ;AUTOMATIC RELOG SWITCH
BLK_OFF DB 0 ;RECORD OFFSET WITHIN BLOCK
blk_num dw 0 ;block number
;
ua_lroot dw offset ua0 ;unallocated block list root
;
ua0 dw offset ua1,0
db 0ffh,0
ua1 dw offset ua2,0
db 0ffh,0
ua2 dw offset ua3,0
db 0ffh,0
ua3 dw offset ua4,0
db 0ffh,0
ua4 dw offset ua5,0
db 0ffh,0
ua5 dw 0,0
db 0ffh,0
HASH RB 4 ;HASH CODE WORK AREA
HASHL DB 0 ;HASH SEARCH LENGTH
LOG_FXS db 11 ;number of log_fxs entrys
; fxi15,fxi17,fxi19,fxi22,fxi23
db 02h ,04h ,06h ,09h ,0ah
; fxi30,fxi35,fxi99,fxi100,fxi102,fxi103
db 11h ,16h ,25h ,26h ,28h ,29h
db 0,0,0,0 ;reserved
rw_fxs db 7 ;number of rw_fxs entrys
; fxi20,fxi21,fxi33,fxi34,fxi40,fxi42,fxi43
db 07h ,08h ,14h ,15h ,1bh ,1ch ,1dh
db 0,0 ;reserved
sc_fxs db 2 ;number of sc_fxs entrys
; fxi16,fxi18
db 03h ,05h
db 0,0 ;reserved
DEBLOCK_FX DB 0 ;DEBLOCK FUNCTION #
PHY_OFF DB 0 ;RECORD OFFSET WITHIN PHYSICAL RECORD
CUR_BCBA DW 0 ;CURRENT BCB OFFSET
ROOT_BCBA DW 0 ;ROOT BCB OFFSET
EMPTY_BCBA DW 0 ;EMPTY BCB OFFSET
if BMPM
P_LAST_BCBA DW 0 ;PROCESS'S LAST BCB OFFSET
P_BCB_CNT DB 0 ;PROCESS BCB COUNT IN BCB LIST
endif
fx_intrn db 0 ;internal BDOS function number
TRACK DW 0 ;BCB RECORD'S TRACK
SECTOR DW 0 ;BCB RECORD'S SECTOR
; seldsk,usrcode are initialized as a pair
seldsk db 0 ;selected disk num
usrcode db 0 ;curr user num
info dw 0 ;info adr
searcha dw 0 ;search adr
;the following variable order is critical
;variables copied from uda for mp/m x
;variables included in fcb checksum for mp/m and cp/m x
;variables used to access system lock list for mp/m x
dma_ofst dw 0 ;dma offset 1
dma_seg dw 0 ;dma segment 2
func db 0 ;bdos function # 3
searchl db 0 ;search len 4
if BMPM
searchaofst dw 0 ;search adr ofst 5
searchabase dw 0 ;search adr base 6
endif
dcnt dw 0 ;directory counter 7
dblk dw 0 ;directory block 8 ?? - not used - ??
error_mode db 0 ;bdos error mode 9
mult_cnt db 0 ;bdos multi-sector cnt 10
df_password rb 8 ;process default pw 11
if BMPM
pd_cnt db 0 ;bdos process cnt 12 1
endif
high_ext db 0 ;fcb high extent bits 2
xfcb_read_only db 0 ;xfcb read only flag 3
curdsk db 0ffh ;current disk 4 1
if BMPM
packed_dcnt db 0 ;packed dblk+dcnt 2
db 0
db 0
pdaddr dw 0 ;process descriptor addr 3
endif
org ((offset $) + 1) and 0fffeh
; curtrka - alloca are set upon disk select
; (data must be adjacent)
cdrmaxa dw 0 ;ptr to cur dir max val
drvlbla dw 0 ;drive label data byte addr
buffa dw 0 ;ptr to dir dma addr
dpbaddr dw 0 ;curr disk param block addr
checka dw 0 ;curr checksum vector addr
alloca dw 0 ;curr alloc vector addr
DIR_BCBA DW 0 ;DIRECTORY BUFFER CONTROL BLOCK ADDR
DAT_BCBA dw 0 ;DATA BUFFER CONTROL BLOCK ADDR
HASH_SEG dw 0 ;HASH TABLE SEGMENT
addlist equ 12 ;"$-buffa" = addr list size
; sectpt - offset obtained from disk parm block at dpbaddr
; (data must be adjacent)
sectpt dw 0 ;sectors per track
blkshf db 0 ;block shift factor
blkmsk db 0 ;block mask
extmsk db 0 ;extent mask
maxall dw 0 ;max alloc num
dirmax dw 0 ;max dir num
dirblk dw 0 ;reserved alloc bits for dir
chksiz dw 0 ;size of checksum vector
offsetv dw 0 ;offset tracks at beginning
PHYSHF DB 0 ;PHYSICAL RECORD SHIFT FACTOR
PHYMSK DB 0 ;PHYSICAL RECORD MASK
endlist rs 0 ;end of list
dpblist equ (offset endlist)-(offset sectpt)
;size
; local variables
common_dma rb 16 ;copy of user's dma 1st 16 bytes
make_flag db 0 ;make function flag
actual_rc db 0 ;directory ext record count
save_xfcb db 0 ;search xfcb save flag
save_mod db 0 ;open_reel module save field
pw_mode db 0 ;password mode
attributes db 0 ;fcb interface attributes hold byte
if BMPM
; number of lock list items required for lock operation
required_table db 1,0,2,2,1,1,2,2,1,1,2,2,1,1,2,2
chk_olist_flag db 0 ;check | test olist flag
lock_sp dw 0 ;lock stack ptr
lock_shell db 0 ;lock shell flag
check_fcb_ret db 0 ;check_fcb return switch
lock_unlock db 0 ;lock | unlock function flag
incr_pdcnt db 0 ;increment process_cnt flag ??
free_mode db 0 ;free lock list entries flag ??
;1=free entries for curdsk
;0=free all entries
cur_pos dw 0 ;current position in lock list
prv_pos dw 0 ;previous position in lock list
dont_close db 0 ;inhibit actual close flag
open_cnt db 0 ;process open file count
lock_cnt db 0 ;process locked record count
file_id dw 0 ;address of file' lock list entry
set_ro_flag db 0 ;set drive r/o flag
check_disk db 0 ;disk reset open file check flag
flushed db 0 ;lock list open file flush flag
;free_root, lock_max, open_max initialized by sysgen
dw offset free_root
open_root dw 0 ;lock list open file list root
lock_root dw 0 ;lock list locked record list root
endif
sdcnt dw 0 ;saved dcnt of file's 1st fcb
sdcnt0 dw 0 ;saved dcnt (user 0 pass)
if BCPM
chain_flag db 0 ;chain flag ??
tod db 0ffh,0ffh,0ffh,0ffh ??
endif
rmf db 0 ;read mode flag for open$reel
wflag db 0 ;xios/bios write flag
dirloc db 0 ;directory flag in rename, etc.
linfo db 0 ;low(info)
dminx db 0 ;local for diskwrite
single db 0 ;set true if single byte
;alloc map
rcount db 0 ;record count in curr fcb
extval db 0 ;extent num and extmsk
vrecord db 0 ;curr virtual record
ADRIVE DB 0 ;CURRENT DISK - must preceed arecord
arecord dw 0 ;curr actual record
db 0 ;curr actual record high byte
ARECORD1 dw 0 ;curr actual block# * blkmsk
drec dw 0 ;curr actual directory record
CUR_dma_seg DW 0
CUR_DMA DW 0
; local variables for directory access
dptr db 0 ;directory pointer 0,1,2,3
ldcnt equ byte ptr dcnt ;low(dcnt)
user_zero_pass db 0 ;search user zero flag
; shell variables
shell_si dw 0 ;bdos command offset
shell_rr db 0,0,0 ;r0,r1,r2 save area
; special 8086 variables:
uda_save dw 0 ;user data area saved value
parametersegment dw 0 ;user parameter segment
returnseg dw 0 ;user return segment
; error messages
err_drv db 0
err_pd_addr dw 0
dskmsg db 13,10,'CP/M Error On '
dskerr db ' : ',0
xerr_list dw 0,permsg,rodmsg,rofmsg,selmsg
dw xe5,xe6,xe7,xe8,xe9,xe10,xe11,xe3
permsg db 'Disk I/O',0
rodmsg db 'Read/Only Disk',0
rofmsg db 'Read/Only File',0
selmsg db 'Invalid Drive',0
xe3 db 'File Opened in Read/Only Mode',0
xe5 db 'File Currently Open',0
xe6 db 'Close Checksum Error',0
xe7 db 'Password Error',0
xe8 db 'File Already Exists',0
xe9 db 'Illegal ? in FCB',0
xe10 db 'Open File Limit Exceeded',0
xe11 db 'No Room in System Lock List',0
crlf_str db 13,10,0
pr_fx db 13,10,'Bdos Function = '
pr_fx1 db ' '
pr_fcb db ' File = '
pr_fcb1 rs 12
db 0
deniedmsg db 13,10,'Disk reset denied, Drive '
denieddrv db 0,':'
db ' Console '
deniedcns db 0
db ' Program '
deniedprc db '12345678',0
if BMPM
; bdos stack switch variables and stack
; used for all bdos disk functions
org ((offset $) + 1) and 0fffeh
; 69 word bdos stack
dw 0cccch,0cccch,0cccch
dw 0cccch,0cccch,0cccch
dw 0cccch,0cccch,0cccch
dw 0cccch,0cccch,0cccch
dw 0cccch,0cccch,0cccch
dw 0cccch,0cccch,0cccch
dw 0cccch,0cccch,0cccch
dw 0cccch,0cccch,0cccch
dw 0cccch,0cccch,0cccch
dw 0cccch,0cccch,0cccch
dw 0cccch,0cccch,0cccch
dw 0cccch,0cccch,0cccch
dw 0cccch,0cccch,0cccch
dw 0cccch,0cccch,0cccch
dw 0cccch,0cccch,0cccch
dw 0cccch,0cccch,0cccch
dw 0cccch,0cccch,0cccch
dw 0cccch,0cccch,0cccch
dw 0cccch,0cccch,0cccch
dw 0cccch,0cccch,0cccch
dw 0cccch,0cccch,0cccch
dw 0cccch,0cccch,0cccch
dw 0cccch,0cccch,0cccch
bdosstack rw 0
save_sp rw 1
ss_save rw 1
sp_save rw 1
; local buffer area:
info_fcb rb 40 ;local user FCB
save_fcb rb 16 ;fcb save area for xfcb search
mxdiskqd dw 0 ;link
db 0,0 ;net,org
dw qf_keep+qf_mx ;flags (MX queue)
db 'MXdisk '
dw 0,1 ;msglen,nmsgs
dw 0,0 ;nq,dq
dw 1,0 ;msgcnt,out
dw 0 ;buffer ptr
mxdiskqpb db 0 ;flgs
db 0 ;net
dw mxdiskqd ;qaddr
dw 1 ;nmsgs
dw 0 ;buffer
db 'MXdisk '
; Error Message sync param block for mutual exclusion
msg_spb dw 0 ;link Error Message sync parameter block
dw 0 ;owner
dw 0 ;wait
dw 0 ;next
endif
if BCPM
;
; special 8086 variables:
;
ioloc db 0 ;iobyte
user_parm_seg dw 0 ;holds user parameter seg during load
nallocmem db 0 ;no. of allocated memory segments
ncrmem db 0 ;no. of available memory segments
crmem dw 0,0 ;memory table (16 elements)
dw 0,0,0,0,0,0
dw 0,0,0,0,0,0,0,0
dw 0,0,0,0,0,0,0,0
dw 0,0,0,0,0,0,0,0
;
mem_stack_length equ 40
memstack rs mem_stack_length
;8 possible allocations
stbase equ word ptr 0
stlen equ word ptr 2
ccpflag equ byte ptr 4
nccpalloc db 0 ;number of current ccp allocations
mem_stk_ptr dw 0 ;current memory stack location
stackarea rw ssize ;stack size
endstack rb 0 ;top of stack
;
endif
org 0fffh
if CCPMOFF
org 0bffh
endif
db 0


File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
couldn't establish operator's mode

View File

@@ -0,0 +1,41 @@
;*****************************************************
;*
;* PATCH AREA -- 128 bytes long
;*
;*****************************************************
patch:
nop ! nop ! nop ! nop ! nop ! nop ;00-0f
nop ! nop ! nop ! nop ! nop ! nop
nop ! nop ! nop ! nop
nop ! nop ! nop ! nop ! nop ! nop ;10-1f
nop ! nop ! nop ! nop ! nop ! nop
nop ! nop ! nop ! nop
nop ! nop ! nop ! nop ! nop ! nop ;20-2f
nop ! nop ! nop ! nop ! nop ! nop
nop ! nop ! nop ! nop
nop ! nop ! nop ! nop ! nop ! nop ;30-3f
nop ! nop ! nop ! nop ! nop ! nop
nop ! nop ! nop ! nop
nop ! nop ! nop ! nop ! nop ! nop ;40-4f
nop ! nop ! nop ! nop ! nop ! nop
nop ! nop ! nop ! nop
nop ! nop ! nop ! nop ! nop ! nop ;50-5f
nop ! nop ! nop ! nop ! nop ! nop
nop ! nop ! nop ! nop
nop ! nop ! nop ! nop ! nop ! nop ;60-6f
nop ! nop ! nop ! nop ! nop ! nop
nop ! nop ! nop ! nop
nop ! nop ! nop ! nop ! nop ! nop ;70-7f
nop ! nop ! nop ! nop ! nop ! nop
nop ! nop ! nop ! nop


View File

@@ -0,0 +1,44 @@
;*****************************************************
;*
;* bdos data area
;*
;*****************************************************
CSEG
org 000Ch
dw 6 ;development version #
; SYTEM DATA EQUATES
DSEG
ORG 0
SUPMOD RW 4
ORG 28H
XIOSMOD RW 4
ORG 52H
FREE_ROOT RW 1
ORG 68H
RLR RW 1
ORG 7EH
TOD RB 0
org 88h
open_vector rw 1
ORG 8AH
LOCK_MAX RB 1
OPEN_MAX RB 1
org 92h
err_intercept rw 2
org 0c0eh
media_flag rb 1


View File

@@ -0,0 +1,109 @@
;*****************************************************
;*
;* User Data Area - The User Data Area is an
;* extension of the process descriptor but it
;* travels with the user. It contains info
;* that is needed only while in context.
;*
;* While in the operating system, The Extra
;* Segment register points to the beginning
;* of the User Data Area.
;*
;*****************************************************
eseg
org 0
RW 1
;u_dparam rw 1 ; arg to dispatch
; this area overlays part of BDOS
u_dma_ofst rw 1 ; BDOS dma offset
u_dma_seg rw 1 ; BDOS dma segment
u_func rb 1 ; actual function number
RB 1
;u_searchl rb 1 ; BDOS search length
RW 1
;u_searcha rw 1 ; BDOS search FCB offset
RW 1
;u_searchabase rw 1 ; BDOS search user's segment
RW 1
;u_dcnt rw 1 ; BDOS directory count
RW 1
;u_dblk rw 1 ; BDOS directory block #
u_error_mode rb 1 ; BDOS error mode
u_mult_cnt rb 1 ; BDOS multi-sector count
RB 8
;u_df_password rb 8 ; BDOS default password
u_pd_cnt rb 1 ; BDOS process count
uda_ovl_len equ (offset $)-(offset u_dma_ofst)
; end of overlay area
RB 1
;u_in_int rb 1
RW 1
;u_sp rw 1 ; save register area
RW 1
;u_ss rw 1
RW 1
;u_ax rw 1
RW 1
;u_bx rw 1
RW 1
;u_cx rw 1
RW 1
;u_dx rw 1
RW 1
;u_di rw 1
RW 1
;u_si rw 1
RW 1
;u_bp rw 1
u_wrkseg rw 1 ; curr seg addr of buf
u_retseg rw 1 ; usr ES return
RW 1
;u_ds_sav rw 1 ;\
RW 1
;u_stack_sp rw 1 ; usr stack segment
RW 1
;u_stack_ss rw 1 ; usr stack pointer
RW 10
;u_ivectors rw 10 ; save int 0-4
RW 1
;u_es_sav rw 1 ; > Used during interrupts
RW 1
;u_flag_sav rw 1 ;/
RW 1
;u_initcs rw 1
RW 1
;u_initds rw 1
RW 1
;u_inites rw 1
RW 1
;u_initss rw 1
RW 1
;u_mpm_ip rw 1 ; MPM vec save
RW 1
;u_mpm_cs rw 1
RW 1
;u_debug_ip rw 1 ; RTS,Debug Vector Save
RW 1
;u_debug_cs rw 1
RB 1
;u_insys rb 1 ; # times through user_entry
RB 1
;u_stat_sav rb 1
u_conccb rw 1
RW 1
;u_lstccb rw 1