home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / CDOSDSK4.ZIP / CDOSDSK4.TD0 / XIOS / CDOS.EQU < prev    next >
Encoding:
Text File  |  1989-01-26  |  18.1 KB  |  551 lines

  1. ; CDOS.EQU
  2.  
  3. TRUE        equ    0ffffh
  4. FALSE        equ    0
  5.  
  6. ; machine id's for various IBM PC compatibles
  7.  
  8. IS_PC        equ    0    ; plain vanilla
  9. IS_AT        equ    1    ; real time clock, hi density drives
  10. IS_COMPAQ    equ    2    ; no sync with color video controler req'd
  11. IS_M24        equ    3    ; real time clock
  12. IS_AMSTRAD    equ    4    ; Real Time Clock, No Sync Required, Mouse
  13.                 ; and Extra Keys supported
  14.  
  15.  
  16. ;************************************************
  17. ;*                        *
  18. ;*       CDOS-86 5.1 SYSTEM DATA AREA FORMAT    *
  19. ;*                        *
  20. ;************************************************
  21.  
  22. supmod$        equ    dword ptr .00h
  23. pcmode$        equ    dword ptr .14h
  24. tick_addr$    equ    dword ptr .20h
  25. dispatch_addr$    equ    dword ptr .24h
  26. dispatcher$    equ    dword ptr .38h
  27. mpmseg$        equ    word ptr .40h
  28. rspseg$        equ    word ptr .42h
  29. endseg$        equ    word ptr .44h
  30. n_flags$    equ    byte ptr .4Ah    ;total number of system flags
  31. sys_disk$    equ    byte ptr .4Bh    ;system disk number patched at init
  32. nvcons$        equ    byte ptr .47h    ;number of virtual consoles
  33. mmp$        equ    word ptr .4Ch    ;maximum memory per process
  34. temp_disk$    equ    byte ptr .50h    ;temporary disk number patched at init
  35. mdul$        equ    word ptr .58h    ;root of unused memory descriptors
  36. mfl$        equ    word ptr .5Ah    ;root of memory free list
  37. qmau$        equ    word ptr .60h    ;queue memory allocation unit
  38. rlr$        equ    word ptr .68h
  39. thrdrt$        equ    word ptr .72h
  40. qlr$        equ    word ptr .74h
  41. version$    equ    word ptr .78h
  42. vernum$        equ    word ptr .7Ah
  43. mpmvernum$    equ    word ptr .7Ch
  44. tod_day$    equ    word ptr .7Eh    ; binary days since january 1 1978
  45. tod_hour$    equ    byte ptr .80h    ; bcd
  46. tod_min$    equ    byte ptr .81h    ; bcd
  47. tod_sec$    equ    byte ptr .82h    ; bcd
  48. ncondev$    equ    byte ptr .83h    ; # of virtual consoles
  49. open_vec$    equ    word ptr .88h    ; 16 bit vector of drives with open
  50.                     ; files - used by status line routine
  51. owner_8087$    equ    word ptr .8Ch    ; process descriptor of 8087 owner
  52. mwdr$        equ    word ptr .98h    ; memory window descriptor root (paging)
  53. bcb_root$    equ    word ptr .9Ah    ; buffer control block root (6.0)
  54. dsrchdisk$    equ    byte ptr .9Dh    ; Default Disk Drive
  55. npcons$        equ    byte ptr .9Fh    ; number of physical consoles
  56. ndp_int_off$    equ    word ptr .0A0h    ; offset of 8087 interrupt vector
  57. ndp_int_seg$    equ    word ptr .0A2h    ; segment of same
  58. ndp_vec_off$    equ    word ptr .0A4h    ; offset of 8087 interrupt entry
  59. ndp_vec_seg$    equ    word ptr .0A6h    ; segment of same
  60. phase1_root$    equ    word ptr .0AEh    ; 1st phase equivalent to rspseg
  61. hashroot$    equ    word ptr .0B0h    ; dos hashing structures root
  62. indma$        equ    word ptr .0B2h    ; process is dma-ing
  63. tod_ticks$    equ    byte ptr .0B5h    ; tick counter
  64. sysdat_mem$    equ    word ptr .0B6h    ; sysdat memory allocation
  65. v386_ptr$    equ    word ptr .0C8h    ; pointer to V386 specific table
  66. tick_cnt$    equ    word ptr .0D0h    ; # of ticks since reset
  67. disp_vector$    equ    dword ptr .0D4h    ; dispatcher intercept vector
  68. nbuffers$    equ    word ptr .0D8h    ; # of disk buffers
  69. sec_size$    equ    word ptr .0DAh    ; sector size
  70. xios_mfl    equ    word ptr .0E2h    ; high memory free list
  71. eject
  72.  
  73. ;********************************************************
  74. ;*                            *
  75. ;*        CDOS 5.2/6.0 SYSTEM CALL EQUATES         *
  76. ;*                            *
  77. ;********************************************************
  78.  
  79. S_REAL        equ    0ffh        ; system call to reset 386
  80.                     ; back into real mode.
  81.                     ; V386 XIOS use only.
  82.  
  83.                     ; device control functions:
  84. DEV_POLL    equ    131        ; poll device
  85. DEV_FLAGWAIT    equ    132        ; flag wait
  86. DEV_FLAGSET    equ    133        ; flag set
  87.  FLAG_SET_IGNORED equ    2Ah        ; only error to cause retry
  88. DEV_FLAGALLOC    equ    87        ; allocate flag
  89. DEV_FLAGFREE    equ    88        ; de-allocate flag
  90.  
  91.                     ; process control functions:
  92. P_DELAY        equ    141        ; delay specified number of ticks
  93. P_DISPATCH    equ    142        ; let other another process run
  94. P_PRIORITY    equ    145        ; set priority
  95. P_PDADR        equ    156        ; dbl word ptr of process descriptor
  96. P_TERM        equ    143        ; terminate process
  97.  
  98. Q_MAKE        equ    86h
  99. Q_OPEN        equ    87h
  100. Q_READ        equ    89h
  101. Q_WRITE        equ    8Bh
  102.                     ; Time function:
  103. T_SECONDS    equ    155        ; get date,hours,minutes,seconds
  104.  
  105. ;********************************************************
  106. ;*                            *
  107. ;*    FLAG NUMBERS RESERVED FOR KERNEL        *
  108. ;*                            *
  109. ;********************************************************
  110.  
  111.                     ; 0 - is reserved
  112. TICK_FLAG    equ    1        ; tick flag number
  113. SEC_FLAG    equ    2        ; seconds flag number
  114. MIN_FLAG    equ    3        ; minutes flag number
  115.  
  116.  
  117. ;********************************************************
  118. ;*                            *
  119. ;*    SYSTEM EQUATES FOR PRNT_SCRN FUNCTION        *
  120. ;*                            *
  121. ;********************************************************
  122.  
  123. LCB_SIZE    equ    10        ; bytes per lcb
  124. LCB_ATTACH    equ    word ptr 0    ; list owner
  125. LCB_QUEUE    equ    word ptr 2    ; next in line
  126. PRSC_PD        equ    1234h        ; phony process desc
  127. UNAVAILABLE    equ    0FFFEh        ; phony PD used to mark LCB for TMP
  128. F_WAKEUP    equ    213h        ; internal system call
  129. eject
  130.  
  131. ;********************************************************
  132. ;*                            *
  133. ;*    DISK STRUCTURES                    *
  134. ;*                            *
  135. ;********************************************************
  136.  
  137. ; Some equates used by floppy and hard disk hash allocation:
  138.  
  139. DPH_SIZE    equ    20        ; size of DPH
  140. PC_HD_DPH_SIZE    equ    24h        ; size of DPH + partition save area
  141.  
  142. DPH_MF        equ    byte ptr 5
  143. DPH_DPB        equ    word ptr 8
  144. DPH_CSV        equ    word ptr 10
  145. DPH_ALV        equ    word ptr 12
  146. DPH_DIRBCB    equ    word ptr 14
  147. DPH_DATBCB    equ    word ptr 16
  148. DPH_HSTBL    equ    word ptr 18
  149.  
  150. DPH_OWNER    equ    word ptr 16    ; 6.0: owner of drive lock
  151.  
  152. DPB_DSM        equ    word ptr 5
  153. DPB_DRM        equ    word ptr 7
  154. PERM        equ    8000h        ; "permanent media"
  155.  
  156. ;********************************************************
  157. ;*                            *
  158. ;*        UDA (USER DATA AREA)            *
  159. ;*                            *
  160. ;********************************************************
  161.  
  162. U_USIZE        equ    word ptr .0000h    ; UDA stack top
  163. U_STACK_SP    equ    word ptr .0034h    ; usr stack segment
  164. U_STACK_SS    equ    word ptr .0036h    ; usr stack pointer
  165. U_INSYS        equ    byte ptr .0060h    ; # times through user_entry
  166.  
  167. UDA_ERR_MODE    equ    byte ptr .10h    
  168.  ERR_MODE_CODE    equ    0FEh        ;or FFh for quick return
  169. eject
  170.  
  171. ;********************************************************
  172. ;*                            *
  173. ;*        PROCESS DESCRIPTOR            *
  174. ;*                            *
  175. ;********************************************************
  176.  
  177. ;    The Process Descriptor (PD) along with the
  178. ;    associated User Data Area (UDA), describe
  179. ;    the current state of a Process under CCP/M-86.
  180. ;    The process descriptor is always within the System
  181. ;    Data Segment.
  182.  
  183. ;    Process Descriptor:
  184.  
  185. ;   +-----+-----+-----+-----+-----+-----+-----+-----+
  186. ; 00|   link    |  thread   |stat |prior|   flag    |
  187. ;   +-----+-----+-----+-----+-----+-----+-----+-----+
  188. ; 08|                     name                      |
  189. ;   +-----+-----+-----+-----+-----+-----+-----+-----+
  190. ; 10|    uda    |disk | user| ldsk|luser|    mem    |
  191. ;   +-----+-----+-----+-----+-----+-----+-----+-----+
  192. ; 18| cmod|tkcnt|    wait   | org | net |  parent   |
  193. ;   +-----+-----+-----+-----+-----+-----+-----+-----+
  194. ; 20|cons | aux |  conmode  |list |brst |   sflag   |
  195. ;   +-----+-----+-----+-----+-----+-----+-----+-----+
  196. ; 28|       userdisp        |    pret   |    cat    |
  197. ;   +-----+-----+-----+-----+-----+-----+-----+-----+
  198. ; 30|  redir_in | redir_out |    mpar   |    res    |
  199. ;   +-----------+-----------+-----------+-----------+
  200. ; 38|    res    |    res    |    res    |    res    |
  201. ;   +-----------+-----------+-----------+-----------+
  202.  
  203. ;    link    - used for placement into System Lists
  204. ;    thread    - link field for Thread List
  205. ;    stat    - current process activity
  206. ;    prior    - priority
  207. ;    flag    - process state flags
  208. ;    name    - name of process
  209. ;    uda    - segment address of user data area
  210. ;    disk    - current default disk
  211. ;    user    - current default user number
  212. ;    ldsk    - disk program loaded from
  213. ;    luser    - user number loaded from
  214. ;    mem    - pointer to MD list of memory owned
  215. ;          by this process
  216. ;    cmod    - compatibility mode bits
  217. ;    tkcnt    - temp keep count
  218. ;    wait    - parameter field while on system lists
  219. ;    org    - network node originating this process
  220. ;    net    - ntework node running this process
  221. ;    parent    - process that created this process
  222. ;    cons    - default console device (doesn't imply ownership)
  223. ;    aux    - default aux device (ditto)
  224. ;    conmode - console mode (BDOS C_MODE f. 109)
  225. ;    list    - default list device (doesn't imply ownership)
  226. ;    brst    - number of ticks left in burst count
  227. ;    sflag    - more state flags
  228. ;    userdisp - user dispatch swap
  229. ;    pret    - return code at termination
  230. ;    cat    - current allocation table
  231. ;    redir_in  - input redirection table segment
  232. ;    redir_out - output redirection table segment
  233.  
  234. P_LINK        equ    word ptr 0
  235. P_THREAD    equ    word ptr P_LINK + word
  236. P_STAT        equ    byte ptr P_THREAD + word
  237. P_PRIOR        equ    byte ptr P_STAT + byte
  238. P_FLAG        equ    word ptr P_PRIOR + byte
  239. P_NAME        equ    byte ptr P_FLAG + word    
  240. P_UDA        equ    word ptr P_NAME + 8
  241. P_DISK        equ    byte ptr P_UDA + word
  242. P_USER        equ    byte ptr P_DISK + byte
  243. P_LDSK        equ    byte ptr P_USER + byte
  244. P_LUSER        equ    byte ptr P_LDSK + byte
  245. P_MEM        equ    word ptr P_LUSER + byte
  246. P_CMOD        equ    byte ptr P_MEM + word
  247. P_TKCNT        equ    byte ptr P_CMOD + byte
  248. P_WAIT        equ    word ptr P_TKCNT + byte
  249. P_ORG        equ    byte ptr P_WAIT + word
  250. P_NET        equ    byte ptr P_ORG + byte
  251. P_PARENT    equ    word ptr P_NET + byte
  252. P_CONS        equ    byte ptr P_PARENT + word
  253. P_AUX        equ    byte ptr P_CONS + byte
  254. P_CONMODE    equ    word ptr P_AUX + byte
  255. P_LIST        equ    byte ptr P_CONMODE + word
  256. P_BRST        equ    byte ptr P_LIST + byte
  257. P_SFLAG        equ    word ptr P_BRST + byte
  258. P_USERDISP    equ    dword ptr P_SFLAG + word
  259. P_PRET        equ    word ptr P_USERDISP + dword
  260. P_CAT        equ    word ptr P_PRET + word
  261. P_REDIR_IN    equ    word ptr P_CAT + word
  262. P_REDIR_OUT    equ    word ptr P_REDIR_IN + word
  263. P_MPAR        equ    word ptr P_REDIR_OUT + word
  264.  
  265. PD_LEN        equ    40H
  266.  
  267. ;    Values of Process descriptor p_status field:
  268.  
  269. PS_RUN        equ    0    ;in ready list root
  270. PS_POLL        equ    1    ;in poll list
  271. PS_DELAY    equ    2    ;in delay list
  272. PS_SWAP        equ    3    ;in swap list
  273. PS_TERM        equ    4    ;terminating
  274. PS_SLEEP    equ    5    ;sleep processing
  275. PS_DQ        equ    6    ;in dq list
  276. PS_NQ        equ    7    ;in nq list
  277. PS_FLAGWAIT    equ    8    ;in flag table
  278. PS_CIOWAIT    equ    9    ;waiting for character
  279.  
  280. ;    Bit flags in Process descriptor p_flag field:
  281.  
  282. PF_SYS        equ    0001h    ;system process
  283. PF_KEEP        equ    0002h    ;do not terminate
  284. PF_KERNAL    equ    0004h    ;resident in kernal
  285. PF_PURE        equ    0008h    ;pure memory descibed
  286. PF_TABLE    equ    0010h    ;from pd table
  287. PF_RESOURCE    equ    0020h    ;waiting for resource
  288. PF_RAW        equ    0040h    ;raw console i/o
  289. PF_CTLC        equ    0080h    ;abort pending
  290. PF_ACTIVE    equ    0100h    ;active tty
  291. PF_TEMPKEEP    equ    0200h    ;don't terminate yet...
  292. PF_CTLD        equ    0400h    ;explicit detach occured
  293. PF_CHILDABORT    equ    0800h    ;child terminated abnormally
  294. PF_NOCTLS    equ    1000h    ;control S not allowed
  295. PF_DSKLD    equ    2000h    ;process was loaded from disk
  296.  
  297. PSF_SUSPEND    equ    0001h    ; suspend if in background
  298. PSF_PCMODE    equ    0800h    ; PC Mode Process
  299. PSF_LIM        equ    8000h    ; Process Using LIM memory
  300. eject
  301.  
  302. ;************************************************
  303. ;*
  304. ;*    Virtual Console Control Block Definition
  305. ;*
  306. ;*    +---------+---------+---------+---------+
  307. ;*  00    |      owner        |      reserved    |
  308. ;*    +---------+---------+---------+---------+
  309. ;*  04    |                reserved               |
  310. ;*    +---------+---------+---------+---------+
  311. ;*  08    |  mimic  | reserved|    PC   |   VC    |
  312. ;*    +---------+---------+---------+---------+
  313. ;*  0C    | reserved|  ATTR   |       state       |
  314. ;*    +---------+---------+---------+---------+
  315. ;*  10  |     maxbufsiz     |     reserved      |
  316. ;*    +---------+---------+---------+---------+
  317. ;*  14  |               reserved                |
  318. ;*      +---------+---------+---------+---------+
  319. ;*  18  |               reserved                |
  320. ;*      +---------+---------+---------+---------+
  321. ;*  1C  |               reserved                |
  322. ;*      +---------+---------+---------+---------+
  323. ;*  20  |               reserved                |
  324. ;*      +---------+---------+---------+---------+
  325. ;*  24  |               reserved                |
  326. ;*      +---------+---------+---------+---------+
  327. ;*  28  |        link       |     reserved      |
  328. ;*      +---------+---------+---------+---------+
  329. ;*
  330. ;*
  331. ;*    owner    - current owner of device
  332. ;*          if 0, no owner
  333. ;*    mimic    - list dev that mimics us.
  334. ;*          0ffh means no mimic device
  335. ;*    PC    - physical console number
  336. ;*    VC    - vitual console number
  337. ;*    state    - current state of virtual console
  338. ;*    maxbufsiz - maximum file size for buffered mode
  339.  
  340. C_OWNER        equ    word ptr 00h
  341. C_MIMIC        equ    byte ptr 08h
  342. C_PC        equ    byte ptr 0Ah
  343. C_VC        equ    byte ptr 0Bh
  344. C_ATTR        equ    byte ptr 0Dh
  345. C_STATE        equ    word ptr 0Eh
  346. C_MAXBUFSIZ    equ    word ptr 10h
  347. C_LINK        equ    word ptr 28h
  348.  
  349. CCBLEN        equ    2ch
  350.  
  351. ;CCB state flags
  352. CSM_FOREGROUND    equ    00000h
  353. CSM_BUFFERED    equ    00001h
  354. CSM_BACKGROUND    equ    00002h
  355. CSM_PURGING    equ    00004h
  356. CSM_NOSWITCH    equ    00008h
  357. CSM_SUSPEND    equ    00010h
  358. CSM_ABORT    equ    00020h
  359. CSM_FILEFULL    equ    00040h
  360. CSM_CTRLS    equ    00080h
  361. CSM_CTRLO    equ    00100h
  362. CSM_CTRLP    equ    00200h
  363. CSM_IDLE    equ    08000h
  364. eject
  365.  
  366. ;*****************************************************************
  367. ;
  368. ;    I/O PARAMETER BLOCK FORMAT:
  369.  
  370. ;    Equates for parameter passing for read and write from BDOS.
  371.  
  372. ;    At the disk read and write function entries,
  373. ;    all disk I/O parameters are on the stack.
  374. ;    The stack at these entries appears as follows:
  375.  
  376. ;           al      ah
  377. ;           +-------+-------+
  378. ;    [  +16 |  GAP  | FILL  |    Values used by io_new_format only  ]
  379. ;           +-------+-------+
  380. ;       +14 |  DRV  | MCNT  |   Drive and Multi sector count
  381. ;           +-------+-------+
  382. ;       +12 |     TRACK     |   Track number
  383. ;           +-------+-------+
  384. ;       +10 |    SECTOR     |   Physical sector number
  385. ;           +-------+-------+
  386. ;        +8 |    DMA_SEG    |   DMA segment 
  387. ;           +-------+-------+
  388. ;        +6 |    DMA_OFF    |   DMA offset
  389. ;           +-------+-------+
  390. ;        +4 |    RET_SEG    |   BDOS return segment
  391. ;           +-------+-------+
  392. ;        +2 |    RET_OFF    |   BDOS return offset
  393. ;           +-------+-------+
  394. ;      SP+0 |    RET_ADR    |   Return address to XIOS ENTRY routine
  395. ;           +-------+-------+
  396. ;
  397. ;    These parameters may be indexed and modifided
  398. ;    directly on the stack by the XIOS read and write rotines
  399. ;    They will be removed by the BDOS when the XIOS completes
  400. ;    the read/write function and returns to the BDOS.
  401.  
  402. DRIVE    equ    byte ptr 14[bp]
  403. MCNT    equ    byte ptr 15[bp]
  404. TRACK    equ    word ptr 12[bp]
  405. SECTOR    equ    word ptr 10[bp]
  406. DMA_SEG    equ    word ptr 8[bp]
  407. DMA_OFF    equ    word ptr 6[bp]
  408.  
  409. GP_FL    equ    word ptr 16[bp]        ; gap and fill used by format
  410. eject
  411.  
  412. ;***********************************************************
  413. ;    Some equates in the Disk Parameter Header (DPH)
  414. ;    and the Disk Parameter Block.
  415.  
  416. XLT    equ    0    ;translation table offset in DPH
  417. DPB    equ    8    ;disk parameter block offset in DPH
  418. SPT    equ    0    ;sectors per track offset in DPB
  419. PSH    equ    15    ;physical shift factor offset in DPB
  420.  
  421. ;    PCDOS Extended Disk Parameter Block:
  422.  
  423. PCDPB_EXTFLAG    equ    word ptr 0
  424. PCDPB_NFAT    equ    word ptr 2
  425. PCDPB_FATREC    equ    word ptr 4
  426. PCDPB_NCLSTRS    equ    word ptr 6
  427. PCDPB_CLSIZE    equ    word ptr 8
  428. PCDPB_FATADD    equ    word ptr 10
  429. PCDPB_SPT    equ    word ptr 12
  430. PCDPB_BSH    equ    byte ptr 14
  431. PCDPB_BLM    equ    byte ptr 15
  432. PCDPB_EXM    equ    byte ptr 16
  433. PCDPB_DSM    equ    word ptr 17
  434. PCDPB_DIRSIZ    equ    word ptr 19
  435. PCDPB_CKSIZ    equ    word ptr 23
  436. PCDPB_OFF    equ    word ptr 25
  437. PCDPB_PSH    equ    byte ptr 27
  438. PCDPB_PRM    equ    byte ptr 28
  439.  
  440. PC_HD_DPB_SIZE    equ    1dh
  441.  
  442. ;    DATA buffer control block equates:
  443.  
  444. DBCB_DRV    equ    byte ptr 0
  445. DBCB_SEG    equ    word ptr 10
  446. DBCB_LINK    equ    word ptr 12
  447. eject
  448.  
  449. ;    Miscellaneous:
  450.  
  451. ; Memory Descriptor Format for Init memory trimming
  452.  
  453. MD_LINK        equ    word ptr 0
  454. MD_START    equ    word ptr MD_LINK + word
  455. MD_LENGTH    equ    word ptr MD_START + word
  456. MD_SIZE        equ    10
  457.  
  458. ; Paged Memory Equates:
  459.  
  460. ; Format of static Memory Window Descriptors:
  461.  
  462. MWD_LINK    equ    word ptr 0
  463. MWD_START    equ    word ptr MWD_LINK + word
  464. MWD_LENGTH    equ    word ptr MWD_START + word
  465. MWD_FLAGS    equ    word ptr MWD_LENGTH + word
  466. MWD_COUNT    equ    word ptr MWD_FLAGS + word
  467. MWD_LEN        equ    MWD_COUNT + word
  468.  
  469. ; MWD_FLAGS definition:
  470.  
  471. MWDF_USED    equ    0001h        ; Memory window unavailable
  472.  
  473.  
  474. ; Format of dynamic Memory Page Allocation Descriptors:
  475.  
  476. MPAD_LINK    equ    word ptr 0
  477. MPAD_START    equ    word ptr MPAD_LINK + word
  478. MPAD_LENGTH    equ    word ptr MPAD_START + word
  479. MPAD_FLAGS    equ    word ptr MPAD_LENGTH + word
  480. MPAD_XIOS    equ    word ptr MPAD_FLAGS + word
  481. MPAD_LEN    equ    MPAD_XIOS + word
  482.  
  483. MPADF_NOBANK    equ    0004h        ; non-banking MPADs
  484. MPADF_LIM    equ    0008h        ; LIM MPADs
  485. MPADF_ALIGNED    equ    0010h        ; allocation was aligned
  486.  
  487.  
  488. EMM_INT        equ    67h        ; extended memory manager entry
  489.  
  490.  
  491. ;********************* CDOS 386 TABLE ********************
  492. ;*
  493. ;*                +---------+----------+
  494. ;*    SYSDAT + 0C8h        | V386 TABLE POINTER |
  495. ;*                +---------+----------+
  496. ;*
  497. ;*      V386 TABLE
  498. ;*
  499. ;*    +---------+---------+---------+---------+
  500. ;*   0  |   IDT SEGMENT     |     IDT LIMIT     |
  501. ;*      +---------+---------+---------+---------+
  502. ;*  +4  |    TSS SEGMENT    |     TSS LIMIT     |
  503. ;*      +---------+---------+---------+---------+
  504. ;*  +8  |     MP TABLE      |       NPAGES    |
  505. ;*      +---------+---------+---------+---------+
  506. ;*  +12 |    PTBL SEGMENT   |   V386  |      LIM    |
  507. ;*      +---------+---------+---------+---------+
  508. ;*  +16 |     LIM BASE      |    LIM MAXSIZE    |
  509. ;*      +---------+---------+---------+---------+
  510. ;*  +20 |  EXCEP OFFSET     |    EXCEP SEGMENT    |
  511. ;*      +---------+---------+---------+---------+
  512. ;*  +24 | PAGE FAULT OFFSET |     PAGE FAULT SEG    |
  513. ;*    +---------+---------+---------+---------+
  514. ;*  +28 |    HI MFL ROOT    |  R/O MEMORY ROOT    |
  515. ;*    +---------+---------+---------+---------+
  516.  
  517.  
  518.  
  519.  
  520. ;; V386 TABLE DEFINITIONS
  521.  
  522.  
  523. idt_seg        equ    word ptr 0[bx]    ; IDT segment
  524. idt_limit    equ    word ptr 2[bx]    ; and Limit
  525. tss_seg        equ    word ptr 4[bx]    ; task state segment
  526. tss_limit    equ    word ptr 6[bx]    ; and limit
  527. mp_table    equ    word ptr 8[bx]    ; free space map seg
  528. npages        equ    word ptr 10[bx]    ; number of 16k pages
  529. ptbl_seg    equ    word ptr 12[bx]    ; master page table
  530. v386_flag    equ    byte ptr 14[bx] ; this is CDOS 386 
  531. lim_flag    equ    byte ptr 15[bx] ; Lim emulation enable flag
  532. lim_pfba    equ    word ptr 16[bx] ; LIM page frame base address
  533. lim_maxpag    equ    word ptr 18[bx] ; LIM max mem pages allowed
  534. excep_off    equ    word ptr 20[bx]    ; exception handler offset
  535. excep_seg    equ    word ptr 22[bx]    ; exception handler segment
  536. ;;;if V60
  537. pfault_off    equ    word ptr 24[bx]    ; page fault handler offset
  538. pfault_seg    equ    word ptr 26[bx]    ; page fault handler segment
  539. hi_mfl_root    equ    word ptr 28[bx] ; high memory free list root
  540. ro_mem_root    equ    word ptr 30[bx] ; read only memory list root
  541. ;;;endif
  542.  
  543. ; v386_flag equates
  544.  
  545. VXF_PROTECT    equ    01h        ; system runs in protected mode
  546. VXF_ALIGN    equ    40h        ; aligned allocation required
  547. VXF_SYSDAT    equ    80h        ; SYSDAT can be moved
  548.  
  549.  
  550. ; END OF CDOS.EQU
  551.