home *** CD-ROM | disk | FTP | other *** search
- ; CDOS.EQU
-
- TRUE equ 0ffffh
- FALSE equ 0
-
- ; machine id's for various IBM PC compatibles
-
- IS_PC equ 0 ; plain vanilla
- IS_AT equ 1 ; real time clock, hi density drives
- IS_COMPAQ equ 2 ; no sync with color video controler req'd
- IS_M24 equ 3 ; real time clock
- IS_AMSTRAD equ 4 ; Real Time Clock, No Sync Required, Mouse
- ; and Extra Keys supported
-
-
- ;************************************************
- ;* *
- ;* CDOS-86 5.1 SYSTEM DATA AREA FORMAT *
- ;* *
- ;************************************************
-
- supmod$ equ dword ptr .00h
- pcmode$ equ dword ptr .14h
- tick_addr$ equ dword ptr .20h
- dispatch_addr$ equ dword ptr .24h
- dispatcher$ equ dword ptr .38h
- mpmseg$ equ word ptr .40h
- rspseg$ equ word ptr .42h
- endseg$ equ word ptr .44h
- n_flags$ equ byte ptr .4Ah ;total number of system flags
- sys_disk$ equ byte ptr .4Bh ;system disk number patched at init
- nvcons$ equ byte ptr .47h ;number of virtual consoles
- mmp$ equ word ptr .4Ch ;maximum memory per process
- temp_disk$ equ byte ptr .50h ;temporary disk number patched at init
- mdul$ equ word ptr .58h ;root of unused memory descriptors
- mfl$ equ word ptr .5Ah ;root of memory free list
- qmau$ equ word ptr .60h ;queue memory allocation unit
- rlr$ equ word ptr .68h
- thrdrt$ equ word ptr .72h
- qlr$ equ word ptr .74h
- version$ equ word ptr .78h
- vernum$ equ word ptr .7Ah
- mpmvernum$ equ word ptr .7Ch
- tod_day$ equ word ptr .7Eh ; binary days since january 1 1978
- tod_hour$ equ byte ptr .80h ; bcd
- tod_min$ equ byte ptr .81h ; bcd
- tod_sec$ equ byte ptr .82h ; bcd
- ncondev$ equ byte ptr .83h ; # of virtual consoles
- open_vec$ equ word ptr .88h ; 16 bit vector of drives with open
- ; files - used by status line routine
- owner_8087$ equ word ptr .8Ch ; process descriptor of 8087 owner
- mwdr$ equ word ptr .98h ; memory window descriptor root (paging)
- bcb_root$ equ word ptr .9Ah ; buffer control block root (6.0)
- dsrchdisk$ equ byte ptr .9Dh ; Default Disk Drive
- npcons$ equ byte ptr .9Fh ; number of physical consoles
- ndp_int_off$ equ word ptr .0A0h ; offset of 8087 interrupt vector
- ndp_int_seg$ equ word ptr .0A2h ; segment of same
- ndp_vec_off$ equ word ptr .0A4h ; offset of 8087 interrupt entry
- ndp_vec_seg$ equ word ptr .0A6h ; segment of same
- phase1_root$ equ word ptr .0AEh ; 1st phase equivalent to rspseg
- hashroot$ equ word ptr .0B0h ; dos hashing structures root
- indma$ equ word ptr .0B2h ; process is dma-ing
- tod_ticks$ equ byte ptr .0B5h ; tick counter
- sysdat_mem$ equ word ptr .0B6h ; sysdat memory allocation
- v386_ptr$ equ word ptr .0C8h ; pointer to V386 specific table
- tick_cnt$ equ word ptr .0D0h ; # of ticks since reset
- disp_vector$ equ dword ptr .0D4h ; dispatcher intercept vector
- nbuffers$ equ word ptr .0D8h ; # of disk buffers
- sec_size$ equ word ptr .0DAh ; sector size
- xios_mfl equ word ptr .0E2h ; high memory free list
- eject
-
- ;********************************************************
- ;* *
- ;* CDOS 5.2/6.0 SYSTEM CALL EQUATES *
- ;* *
- ;********************************************************
-
- S_REAL equ 0ffh ; system call to reset 386
- ; back into real mode.
- ; V386 XIOS use only.
-
- ; device control functions:
- DEV_POLL equ 131 ; poll device
- DEV_FLAGWAIT equ 132 ; flag wait
- DEV_FLAGSET equ 133 ; flag set
- FLAG_SET_IGNORED equ 2Ah ; only error to cause retry
- DEV_FLAGALLOC equ 87 ; allocate flag
- DEV_FLAGFREE equ 88 ; de-allocate flag
-
- ; process control functions:
- P_DELAY equ 141 ; delay specified number of ticks
- P_DISPATCH equ 142 ; let other another process run
- P_PRIORITY equ 145 ; set priority
- P_PDADR equ 156 ; dbl word ptr of process descriptor
- P_TERM equ 143 ; terminate process
-
- Q_MAKE equ 86h
- Q_OPEN equ 87h
- Q_READ equ 89h
- Q_WRITE equ 8Bh
- ; Time function:
- T_SECONDS equ 155 ; get date,hours,minutes,seconds
-
- ;********************************************************
- ;* *
- ;* FLAG NUMBERS RESERVED FOR KERNEL *
- ;* *
- ;********************************************************
-
- ; 0 - is reserved
- TICK_FLAG equ 1 ; tick flag number
- SEC_FLAG equ 2 ; seconds flag number
- MIN_FLAG equ 3 ; minutes flag number
-
-
- ;********************************************************
- ;* *
- ;* SYSTEM EQUATES FOR PRNT_SCRN FUNCTION *
- ;* *
- ;********************************************************
-
- LCB_SIZE equ 10 ; bytes per lcb
- LCB_ATTACH equ word ptr 0 ; list owner
- LCB_QUEUE equ word ptr 2 ; next in line
- PRSC_PD equ 1234h ; phony process desc
- UNAVAILABLE equ 0FFFEh ; phony PD used to mark LCB for TMP
- F_WAKEUP equ 213h ; internal system call
- eject
-
- ;********************************************************
- ;* *
- ;* DISK STRUCTURES *
- ;* *
- ;********************************************************
-
- ; Some equates used by floppy and hard disk hash allocation:
-
- DPH_SIZE equ 20 ; size of DPH
- PC_HD_DPH_SIZE equ 24h ; size of DPH + partition save area
-
- DPH_MF equ byte ptr 5
- DPH_DPB equ word ptr 8
- DPH_CSV equ word ptr 10
- DPH_ALV equ word ptr 12
- DPH_DIRBCB equ word ptr 14
- DPH_DATBCB equ word ptr 16
- DPH_HSTBL equ word ptr 18
-
- DPH_OWNER equ word ptr 16 ; 6.0: owner of drive lock
-
- DPB_DSM equ word ptr 5
- DPB_DRM equ word ptr 7
- PERM equ 8000h ; "permanent media"
-
- ;********************************************************
- ;* *
- ;* UDA (USER DATA AREA) *
- ;* *
- ;********************************************************
-
- U_USIZE equ word ptr .0000h ; UDA stack top
- U_STACK_SP equ word ptr .0034h ; usr stack segment
- U_STACK_SS equ word ptr .0036h ; usr stack pointer
- U_INSYS equ byte ptr .0060h ; # times through user_entry
-
- UDA_ERR_MODE equ byte ptr .10h
- ERR_MODE_CODE equ 0FEh ;or FFh for quick return
- eject
-
- ;********************************************************
- ;* *
- ;* PROCESS DESCRIPTOR *
- ;* *
- ;********************************************************
-
- ; The Process Descriptor (PD) along with the
- ; associated User Data Area (UDA), describe
- ; the current state of a Process under CCP/M-86.
- ; The process descriptor is always within the System
- ; Data Segment.
-
- ; Process Descriptor:
-
- ; +-----+-----+-----+-----+-----+-----+-----+-----+
- ; 00| link | thread |stat |prior| flag |
- ; +-----+-----+-----+-----+-----+-----+-----+-----+
- ; 08| name |
- ; +-----+-----+-----+-----+-----+-----+-----+-----+
- ; 10| uda |disk | user| ldsk|luser| mem |
- ; +-----+-----+-----+-----+-----+-----+-----+-----+
- ; 18| cmod|tkcnt| wait | org | net | parent |
- ; +-----+-----+-----+-----+-----+-----+-----+-----+
- ; 20|cons | aux | conmode |list |brst | sflag |
- ; +-----+-----+-----+-----+-----+-----+-----+-----+
- ; 28| userdisp | pret | cat |
- ; +-----+-----+-----+-----+-----+-----+-----+-----+
- ; 30| redir_in | redir_out | mpar | res |
- ; +-----------+-----------+-----------+-----------+
- ; 38| res | res | res | res |
- ; +-----------+-----------+-----------+-----------+
-
- ; link - used for placement into System Lists
- ; thread - link field for Thread List
- ; stat - current process activity
- ; prior - priority
- ; flag - process state flags
- ; name - name of process
- ; uda - segment address of user data area
- ; disk - current default disk
- ; user - current default user number
- ; ldsk - disk program loaded from
- ; luser - user number loaded from
- ; mem - pointer to MD list of memory owned
- ; by this process
- ; cmod - compatibility mode bits
- ; tkcnt - temp keep count
- ; wait - parameter field while on system lists
- ; org - network node originating this process
- ; net - ntework node running this process
- ; parent - process that created this process
- ; cons - default console device (doesn't imply ownership)
- ; aux - default aux device (ditto)
- ; conmode - console mode (BDOS C_MODE f. 109)
- ; list - default list device (doesn't imply ownership)
- ; brst - number of ticks left in burst count
- ; sflag - more state flags
- ; userdisp - user dispatch swap
- ; pret - return code at termination
- ; cat - current allocation table
- ; redir_in - input redirection table segment
- ; redir_out - output redirection table segment
-
- P_LINK equ word ptr 0
- P_THREAD equ word ptr P_LINK + word
- P_STAT equ byte ptr P_THREAD + word
- P_PRIOR equ byte ptr P_STAT + byte
- P_FLAG equ word ptr P_PRIOR + byte
- P_NAME equ byte ptr P_FLAG + word
- P_UDA equ word ptr P_NAME + 8
- P_DISK equ byte ptr P_UDA + word
- P_USER equ byte ptr P_DISK + byte
- P_LDSK equ byte ptr P_USER + byte
- P_LUSER equ byte ptr P_LDSK + byte
- P_MEM equ word ptr P_LUSER + byte
- P_CMOD equ byte ptr P_MEM + word
- P_TKCNT equ byte ptr P_CMOD + byte
- P_WAIT equ word ptr P_TKCNT + byte
- P_ORG equ byte ptr P_WAIT + word
- P_NET equ byte ptr P_ORG + byte
- P_PARENT equ word ptr P_NET + byte
- P_CONS equ byte ptr P_PARENT + word
- P_AUX equ byte ptr P_CONS + byte
- P_CONMODE equ word ptr P_AUX + byte
- P_LIST equ byte ptr P_CONMODE + word
- P_BRST equ byte ptr P_LIST + byte
- P_SFLAG equ word ptr P_BRST + byte
- P_USERDISP equ dword ptr P_SFLAG + word
- P_PRET equ word ptr P_USERDISP + dword
- P_CAT equ word ptr P_PRET + word
- P_REDIR_IN equ word ptr P_CAT + word
- P_REDIR_OUT equ word ptr P_REDIR_IN + word
- P_MPAR equ word ptr P_REDIR_OUT + word
-
- PD_LEN equ 40H
-
- ; Values of Process descriptor p_status field:
-
- PS_RUN equ 0 ;in ready list root
- PS_POLL equ 1 ;in poll list
- PS_DELAY equ 2 ;in delay list
- PS_SWAP equ 3 ;in swap list
- PS_TERM equ 4 ;terminating
- PS_SLEEP equ 5 ;sleep processing
- PS_DQ equ 6 ;in dq list
- PS_NQ equ 7 ;in nq list
- PS_FLAGWAIT equ 8 ;in flag table
- PS_CIOWAIT equ 9 ;waiting for character
-
- ; Bit flags in Process descriptor p_flag field:
-
- PF_SYS equ 0001h ;system process
- PF_KEEP equ 0002h ;do not terminate
- PF_KERNAL equ 0004h ;resident in kernal
- PF_PURE equ 0008h ;pure memory descibed
- PF_TABLE equ 0010h ;from pd table
- PF_RESOURCE equ 0020h ;waiting for resource
- PF_RAW equ 0040h ;raw console i/o
- PF_CTLC equ 0080h ;abort pending
- PF_ACTIVE equ 0100h ;active tty
- PF_TEMPKEEP equ 0200h ;don't terminate yet...
- PF_CTLD equ 0400h ;explicit detach occured
- PF_CHILDABORT equ 0800h ;child terminated abnormally
- PF_NOCTLS equ 1000h ;control S not allowed
- PF_DSKLD equ 2000h ;process was loaded from disk
-
- PSF_SUSPEND equ 0001h ; suspend if in background
- PSF_PCMODE equ 0800h ; PC Mode Process
- PSF_LIM equ 8000h ; Process Using LIM memory
- eject
-
- ;************************************************
- ;*
- ;* Virtual Console Control Block Definition
- ;*
- ;* +---------+---------+---------+---------+
- ;* 00 | owner | reserved |
- ;* +---------+---------+---------+---------+
- ;* 04 | reserved |
- ;* +---------+---------+---------+---------+
- ;* 08 | mimic | reserved| PC | VC |
- ;* +---------+---------+---------+---------+
- ;* 0C | reserved| ATTR | state |
- ;* +---------+---------+---------+---------+
- ;* 10 | maxbufsiz | reserved |
- ;* +---------+---------+---------+---------+
- ;* 14 | reserved |
- ;* +---------+---------+---------+---------+
- ;* 18 | reserved |
- ;* +---------+---------+---------+---------+
- ;* 1C | reserved |
- ;* +---------+---------+---------+---------+
- ;* 20 | reserved |
- ;* +---------+---------+---------+---------+
- ;* 24 | reserved |
- ;* +---------+---------+---------+---------+
- ;* 28 | link | reserved |
- ;* +---------+---------+---------+---------+
- ;*
- ;*
- ;* owner - current owner of device
- ;* if 0, no owner
- ;* mimic - list dev that mimics us.
- ;* 0ffh means no mimic device
- ;* PC - physical console number
- ;* VC - vitual console number
- ;* state - current state of virtual console
- ;* maxbufsiz - maximum file size for buffered mode
-
- C_OWNER equ word ptr 00h
- C_MIMIC equ byte ptr 08h
- C_PC equ byte ptr 0Ah
- C_VC equ byte ptr 0Bh
- C_ATTR equ byte ptr 0Dh
- C_STATE equ word ptr 0Eh
- C_MAXBUFSIZ equ word ptr 10h
- C_LINK equ word ptr 28h
-
- CCBLEN equ 2ch
-
- ;CCB state flags
- CSM_FOREGROUND equ 00000h
- CSM_BUFFERED equ 00001h
- CSM_BACKGROUND equ 00002h
- CSM_PURGING equ 00004h
- CSM_NOSWITCH equ 00008h
- CSM_SUSPEND equ 00010h
- CSM_ABORT equ 00020h
- CSM_FILEFULL equ 00040h
- CSM_CTRLS equ 00080h
- CSM_CTRLO equ 00100h
- CSM_CTRLP equ 00200h
- CSM_IDLE equ 08000h
- eject
-
- ;*****************************************************************
- ;
- ; I/O PARAMETER BLOCK FORMAT:
-
- ; Equates for parameter passing for read and write from BDOS.
-
- ; At the disk read and write function entries,
- ; all disk I/O parameters are on the stack.
- ; The stack at these entries appears as follows:
-
- ; al ah
- ; +-------+-------+
- ; [ +16 | GAP | FILL | Values used by io_new_format only ]
- ; +-------+-------+
- ; +14 | DRV | MCNT | Drive and Multi sector count
- ; +-------+-------+
- ; +12 | TRACK | Track number
- ; +-------+-------+
- ; +10 | SECTOR | Physical sector number
- ; +-------+-------+
- ; +8 | DMA_SEG | DMA segment
- ; +-------+-------+
- ; +6 | DMA_OFF | DMA offset
- ; +-------+-------+
- ; +4 | RET_SEG | BDOS return segment
- ; +-------+-------+
- ; +2 | RET_OFF | BDOS return offset
- ; +-------+-------+
- ; SP+0 | RET_ADR | Return address to XIOS ENTRY routine
- ; +-------+-------+
- ;
- ; These parameters may be indexed and modifided
- ; directly on the stack by the XIOS read and write rotines
- ; They will be removed by the BDOS when the XIOS completes
- ; the read/write function and returns to the BDOS.
-
- DRIVE equ byte ptr 14[bp]
- MCNT equ byte ptr 15[bp]
- TRACK equ word ptr 12[bp]
- SECTOR equ word ptr 10[bp]
- DMA_SEG equ word ptr 8[bp]
- DMA_OFF equ word ptr 6[bp]
-
- GP_FL equ word ptr 16[bp] ; gap and fill used by format
- eject
-
- ;***********************************************************
- ; Some equates in the Disk Parameter Header (DPH)
- ; and the Disk Parameter Block.
-
- XLT equ 0 ;translation table offset in DPH
- DPB equ 8 ;disk parameter block offset in DPH
- SPT equ 0 ;sectors per track offset in DPB
- PSH equ 15 ;physical shift factor offset in DPB
-
- ; PCDOS Extended Disk Parameter Block:
-
- PCDPB_EXTFLAG equ word ptr 0
- PCDPB_NFAT equ word ptr 2
- PCDPB_FATREC equ word ptr 4
- PCDPB_NCLSTRS equ word ptr 6
- PCDPB_CLSIZE equ word ptr 8
- PCDPB_FATADD equ word ptr 10
- PCDPB_SPT equ word ptr 12
- PCDPB_BSH equ byte ptr 14
- PCDPB_BLM equ byte ptr 15
- PCDPB_EXM equ byte ptr 16
- PCDPB_DSM equ word ptr 17
- PCDPB_DIRSIZ equ word ptr 19
- PCDPB_CKSIZ equ word ptr 23
- PCDPB_OFF equ word ptr 25
- PCDPB_PSH equ byte ptr 27
- PCDPB_PRM equ byte ptr 28
-
- PC_HD_DPB_SIZE equ 1dh
-
- ; DATA buffer control block equates:
-
- DBCB_DRV equ byte ptr 0
- DBCB_SEG equ word ptr 10
- DBCB_LINK equ word ptr 12
- eject
-
- ; Miscellaneous:
-
- ; Memory Descriptor Format for Init memory trimming
-
- MD_LINK equ word ptr 0
- MD_START equ word ptr MD_LINK + word
- MD_LENGTH equ word ptr MD_START + word
- MD_SIZE equ 10
-
- ; Paged Memory Equates:
-
- ; Format of static Memory Window Descriptors:
-
- MWD_LINK equ word ptr 0
- MWD_START equ word ptr MWD_LINK + word
- MWD_LENGTH equ word ptr MWD_START + word
- MWD_FLAGS equ word ptr MWD_LENGTH + word
- MWD_COUNT equ word ptr MWD_FLAGS + word
- MWD_LEN equ MWD_COUNT + word
-
- ; MWD_FLAGS definition:
-
- MWDF_USED equ 0001h ; Memory window unavailable
-
-
- ; Format of dynamic Memory Page Allocation Descriptors:
-
- MPAD_LINK equ word ptr 0
- MPAD_START equ word ptr MPAD_LINK + word
- MPAD_LENGTH equ word ptr MPAD_START + word
- MPAD_FLAGS equ word ptr MPAD_LENGTH + word
- MPAD_XIOS equ word ptr MPAD_FLAGS + word
- MPAD_LEN equ MPAD_XIOS + word
-
- MPADF_NOBANK equ 0004h ; non-banking MPADs
- MPADF_LIM equ 0008h ; LIM MPADs
- MPADF_ALIGNED equ 0010h ; allocation was aligned
-
-
- EMM_INT equ 67h ; extended memory manager entry
-
-
- ;********************* CDOS 386 TABLE ********************
- ;*
- ;* +---------+----------+
- ;* SYSDAT + 0C8h | V386 TABLE POINTER |
- ;* +---------+----------+
- ;*
- ;* V386 TABLE
- ;*
- ;* +---------+---------+---------+---------+
- ;* 0 | IDT SEGMENT | IDT LIMIT |
- ;* +---------+---------+---------+---------+
- ;* +4 | TSS SEGMENT | TSS LIMIT |
- ;* +---------+---------+---------+---------+
- ;* +8 | MP TABLE | NPAGES |
- ;* +---------+---------+---------+---------+
- ;* +12 | PTBL SEGMENT | V386 | LIM |
- ;* +---------+---------+---------+---------+
- ;* +16 | LIM BASE | LIM MAXSIZE |
- ;* +---------+---------+---------+---------+
- ;* +20 | EXCEP OFFSET | EXCEP SEGMENT |
- ;* +---------+---------+---------+---------+
- ;* +24 | PAGE FAULT OFFSET | PAGE FAULT SEG |
- ;* +---------+---------+---------+---------+
- ;* +28 | HI MFL ROOT | R/O MEMORY ROOT |
- ;* +---------+---------+---------+---------+
-
-
-
-
- ;; V386 TABLE DEFINITIONS
-
-
- idt_seg equ word ptr 0[bx] ; IDT segment
- idt_limit equ word ptr 2[bx] ; and Limit
- tss_seg equ word ptr 4[bx] ; task state segment
- tss_limit equ word ptr 6[bx] ; and limit
- mp_table equ word ptr 8[bx] ; free space map seg
- npages equ word ptr 10[bx] ; number of 16k pages
- ptbl_seg equ word ptr 12[bx] ; master page table
- v386_flag equ byte ptr 14[bx] ; this is CDOS 386
- lim_flag equ byte ptr 15[bx] ; Lim emulation enable flag
- lim_pfba equ word ptr 16[bx] ; LIM page frame base address
- lim_maxpag equ word ptr 18[bx] ; LIM max mem pages allowed
- excep_off equ word ptr 20[bx] ; exception handler offset
- excep_seg equ word ptr 22[bx] ; exception handler segment
- ;;;if V60
- pfault_off equ word ptr 24[bx] ; page fault handler offset
- pfault_seg equ word ptr 26[bx] ; page fault handler segment
- hi_mfl_root equ word ptr 28[bx] ; high memory free list root
- ro_mem_root equ word ptr 30[bx] ; read only memory list root
- ;;;endif
-
- ; v386_flag equates
-
- VXF_PROTECT equ 01h ; system runs in protected mode
- VXF_ALIGN equ 40h ; aligned allocation required
- VXF_SYSDAT equ 80h ; SYSDAT can be moved
-
-
- ; END OF CDOS.EQU
-