Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1007 lines
26 KiB

  1. ;===========================================================================
  2. ;
  3. ; TITLE Low Memory Stub for DOS when DOS runs in HMA
  4. ;
  5. ;
  6. ; Revision History:
  7. ;
  8. ; M003 - MS PASCAL 3.2 support. Please see under tag M003 in dossym.inc
  9. ; 7/30/90
  10. ;
  11. ; M006 - print A20 Hardware error using int 10.
  12. ;
  13. ; M020 - Fix for Rational Bug - see exepatch.asm for details
  14. ;
  15. ; M011 - check for wrap rather than do an XMS query
  16. ; A20 after int 23,24 and 28
  17. ;
  18. ; M012 - Rearranged stuff to make Share build with msdata
  19. ;
  20. ; M023 - Added variable UmbSave1 for preserving umb_head arena across
  21. ; win /3 session for win ver < 3.1
  22. ;
  23. ;
  24. ;============================================================================
  25. DOSDATA SEGMENT WORD PUBLIC 'DATA'
  26. assume cs:DOSDATA
  27. ;----------------------------------------------------------------------------
  28. ;
  29. ; P U B L I C S
  30. ;
  31. ;----------------------------------------------------------------------------
  32. PUBLIC DOSINTTABLE
  33. public ldivov
  34. public lquit
  35. public lcommand
  36. public labsdrd
  37. public labsdwrt
  38. public lStay_resident
  39. public lint2f
  40. public lcall_entry
  41. public lirett
  42. ifdef NEC_98
  43. PUBLIC lirett2
  44. endif ;NEC_98
  45. public i0patch
  46. public i20patch
  47. public i21patch
  48. public i25patch
  49. public i26patch
  50. public i27patch
  51. public i2fpatch
  52. public cpmpatch
  53. ;----------------------------------------------------------------------------
  54. ;
  55. ; D A T A
  56. ;
  57. ;----------------------------------------------------------------------------
  58. EVEN
  59. DOSINTTABLE LABEL DWORD
  60. DW OFFSET DOSCODE:DIVOV , 0
  61. DW OFFSET DOSCODE:QUIT , 0
  62. DW OFFSET DOSCODE:COMMAND , 0
  63. DW OFFSET DOSCODE:ABSDRD , 0
  64. DW OFFSET DOSCODE:ABSDWRT , 0
  65. DW OFFSET DOSCODE:Stay_resident , 0
  66. DW OFFSET DOSCODE:INT2F , 0
  67. DW OFFSET DOSCODE:CALL_ENTRY , 0
  68. DW OFFSET DOSCODE:IRETT , 0
  69. SS_Save DW ? ; save user's stack segment
  70. SP_Save DW ? ; save user's stack offset
  71. ;-------------------------------------------------------------------------
  72. ;
  73. ; LOW MEM STUB:
  74. ;
  75. ; The low mem stub contains the entry points into DOS for all interrupts
  76. ; handled by DOS. This stub is installed if the user specifies that the
  77. ; DOS load in HIMEM. Each entry point does this.
  78. ;
  79. ;
  80. ; 1. if jmp to 8 has been patched out
  81. ; 2. if A20 OFF
  82. ; 3. Enable A20
  83. ; 4. else
  84. ; 5. just go to dos entry
  85. ; 6. endif
  86. ; 7. else
  87. ; 8. just go to dos entry
  88. ; 9. endif
  89. ;
  90. ;
  91. ;--------------------------------------------------------------------------
  92. assume cs:dosdata
  93. ;--------------------------------------------------------------------------
  94. ;
  95. ; DIVIDE BY 0 handler
  96. ;
  97. ;--------------------------------------------------------------------------
  98. ldivov:
  99. ;
  100. ; The following jump, skipping the XMS calls will be patched to
  101. ; NOPS by SEG_REINIT if DOS successfully loads high. This jump is
  102. ; needed because the stub is installed even before the XMS driver
  103. ; is loaded if the user specifies dos=high in the config.sys
  104. ;
  105. i0patch:
  106. jmp short divov_cont
  107. call EnsureA20ON ; we must turn on A20 if OFF
  108. divov_cont:
  109. jmp dword ptr DOSINTTABLE ; jmp to DOS
  110. ;------------------------------------------------------------------------
  111. ;
  112. ; INT 20 Handler
  113. ;
  114. ; Here we do not have to set up the stack to return here as the abort call
  115. ; will return to the address after the int 21 ah=4b call. This would be the
  116. ; common exit point if A20 had been OFF (for TOGGLE DOS) and the A20 line
  117. ; will be restored then.
  118. ;
  119. ;-------------------------------------------------------------------------
  120. lquit:
  121. ;
  122. ; The following jump, skipping the XMS calls will be patched to
  123. ; NOPS by SEG_REINIT if DOS successfully loads high. This jump is
  124. ; needed because the stub is installed even before the XMS driver
  125. ; is loaded if the user specifies dos=high in the config.sys
  126. ;
  127. i20patch:
  128. jmp short quit_cont
  129. call EnsureA20ON ; we must turn on A20 if OFF
  130. quit_cont:
  131. jmp dword ptr DOSINTTABLE+4 ; jump to DOS
  132. ;--------------------------------------------------------------------------
  133. ;
  134. ; INT 21 Handler
  135. ;
  136. ;--------------------------------------------------------------------------
  137. lcommand:
  138. ;
  139. ; The following jump, skipping the XMS calls will be patched to
  140. ; NOPS by SEG_REINIT if DOS successfully loads high. This jump is
  141. ; needed because the stub is installed even before the XMS driver
  142. ; is loaded if the user specifies dos=high in the config.sys
  143. ;
  144. i21patch:
  145. jmp short command_cont
  146. call WEnsureA20ON ; we must turn on A20 if OFF
  147. command_cont:
  148. jmp dword ptr DOSINTTABLE+8 ; jmp to DOS
  149. ;------------------------------------------------------------------------
  150. ;
  151. ; INT 25
  152. ;
  153. ;----------------------------------------------------------------------------
  154. labsdrd:
  155. ;
  156. ; The following jump, skipping the XMS calls will be patched to
  157. ; NOPS by SEG_REINIT if DOS successfully loads high. This jump is
  158. ; needed because the stub is installed even before the XMS driver
  159. ; is loaded if the user specifies dos=high in the config.sys
  160. ;
  161. i25patch:
  162. jmp short absdrd_cont
  163. call EnsureA20ON ; we must turn on A20 if OFF
  164. absdrd_cont:
  165. jmp dword ptr DOSINTTABLE+12; jmp to DOS
  166. ;-------------------------------------------------------------------------
  167. ;
  168. ; INT 26
  169. ;
  170. ;-----------------------------------------------------------------------
  171. labsdwrt:
  172. ;
  173. ; The following jump, skipping the XMS calls will be patched to
  174. ; NOPS by SEG_REINIT if DOS successfully loads high. This jump is
  175. ; needed because the stub is installed even before the XMS driver
  176. ; is loaded if the user specifies dos=high in the config.sys
  177. ;
  178. i26patch:
  179. jmp short absdwrt_cont
  180. call EnsureA20ON ; we must turn on A20 if OFF
  181. absdwrt_cont:
  182. jmp dword ptr DOSINTTABLE+16; jmp to DOS
  183. ;------------------------------------------------------------------------
  184. ;
  185. ; INT 27
  186. ;
  187. ;-----------------------------------------------------------------------
  188. lStay_resident:
  189. ;
  190. ; The following jump, skipping the XMS calls will be patched to
  191. ; NOPS by SEG_REINIT if DOS successfully loads high. This jump is
  192. ; needed because the stub is installed even before the XMS driver
  193. ; is loaded if the user specifies dos=high in the config.sys
  194. ;
  195. i27patch:
  196. jmp short sr_cont
  197. call EnsureA20ON ; we must turn on A20 if OFF
  198. sr_cont:
  199. jmp dword ptr DOSINTTABLE+20; jmp to DOS
  200. ;-----------------------------------------------------------------------------
  201. ;
  202. ; INT 2f
  203. ;
  204. ;-------------------------------------------------------------------------
  205. lint2f:
  206. ;
  207. ; The following jump, skipping the XMS calls will be patched to
  208. ; NOPS by SEG_REINIT if DOS successfully loads high. This jump is
  209. ; needed because the stub is installed even before the XMS driver
  210. ; is loaded if the user specifies dos=high in the config.sys
  211. ;
  212. i2fpatch:
  213. jmp short int2f_cont
  214. call EnsureA20ON ; we must turn on A20 if OFF
  215. int2f_cont:
  216. jmp dword ptr DOSINTTABLE+24; jmp to DOS
  217. ;-----------------------------------------------------------------------------
  218. ;
  219. ; CPM entry
  220. ;
  221. ;------------------------------------------------------------------------
  222. lcall_entry:
  223. ;
  224. ; The following jump, skipping the XMS calls will be patched to
  225. ; NOPS by SEG_REINIT if DOS successfully loads high. This jump is
  226. ; needed because the stub is installed even before the XMS driver
  227. ; is loaded if the user specifies dos=high in the config.sys
  228. ;
  229. cpmpatch:
  230. jmp short callentry_cont
  231. call EnsureA20ON ; we must turn on A20 if OFF
  232. callentry_cont:
  233. jmp dword ptr DOSINTTABLE+28; jmp to DOS
  234. ;--------------------------------------------------------------------------
  235. lirett: jmp DOIRET
  236. ifdef NEC_98
  237. lirett2: iret
  238. endif ;NEC_98
  239. ;---------------------------------------------------------------------------
  240. ;
  241. ; LowIntXX:
  242. ;
  243. ; Interrupts from DOS that pass control to a user program must be done from
  244. ; low memory, as the user program may change the state of the A20 line or
  245. ; they may require that the A20 line be OFF. The following piece of code is
  246. ; far call'd from the following places in DOS:
  247. ;
  248. ; 1. msctrlc.asm where dos issues an int 23h (ctrlc)
  249. ; 2. msctrlc.asm where dos issues an int 24h (critical error)
  250. ; 3. msctrlc.asm where dos issues an int 28h (idle int)
  251. ;
  252. ; The int 23 and int 24 handlers may decide to do a far return instead of an
  253. ; IRET ane leave the flags on the stack. Therefore we save the return address
  254. ; before doing the ints and then do a far junp back into DOS.
  255. ;
  256. ;---------------------------------------------------------------------------
  257. public DosRetAddr23, DosRetAddr24
  258. public LowInt23, LowInt24, LowInt28
  259. DosRetAddr23 DD ?
  260. DosRetAddr24 DD ?
  261. DosRetAddr28 DD ?
  262. ;
  263. ; Execute int 23h from low memory
  264. ;
  265. LowInt23:
  266. ; save the return address that is on
  267. ; the stack
  268. pop word ptr cs:[DosRetAddr23]
  269. pop word ptr cs:[DosRetAddr23+2]
  270. int 23h ; ctrl C
  271. ; turn on A20 it has been turned OFF
  272. ; by int 28/23/24 handler.
  273. call EnsureA20ON ; M011: we must turn on A20 if OFF
  274. jmp dword ptr DosRetAddr23 ; jump back to DOS
  275. ;
  276. ; Execute int 24h from low memory
  277. ;
  278. LowInt24:
  279. ; save the return address that is on
  280. ; the stack
  281. pop word ptr cs:[DosRetAddr24]
  282. pop word ptr cs:[DosRetAddr24+2]
  283. int 24h ; crit error
  284. ; turn on A20 it has been turned OFF
  285. ; by int 28/23/24 handler.
  286. call EnsureA20ON ; M011: we must turn on A20 if OFF
  287. jmp dword ptr DosRetAddr24 ; jump back to DOS
  288. ;
  289. ; Execute int 23h from low memory
  290. ;
  291. LowInt28:
  292. int 28h ; idle int
  293. ; turn on A20 it has been turned OFF
  294. ; by int 28/23/24 handler.
  295. call EnsureA20ON ; M011: we must turn on A20 if OFF
  296. retf
  297. ;-------------------------------------------------------------------------
  298. ;
  299. ; int 21 ah=4b (exec) call will jump to the following label before xferring
  300. ; control to the exec'd program. We turn of A20 inorder to allow programs
  301. ; that have been packed by the faulty exepack utility to unpack correctly.
  302. ; This is so because exepac'd programs rely on address wrap.
  303. ;
  304. ;-------------------------------------------------------------------------
  305. public disa20_xfer
  306. disa20_xfer:
  307. call XMMDisableA20 ; disable A20
  308. ;
  309. ; Look at msproc.asm at label exec_go for understanding the following:
  310. ;
  311. ; DS:SI points to entry point
  312. ; AX:DI points to initial stack
  313. ; DX has PDB pointer
  314. ; BX has initial AX value
  315. SVC SVC_DEMENTRYDOSAPP
  316. call DOCLI
  317. mov BYTE PTR InDos,0 ; SS Override
  318. ASSUME SS:NOTHING
  319. mov SS,AX ; set up user's stack
  320. mov SP,DI ; and SP
  321. sti ; took out DOSTI as sp may be bad
  322. push DS ; fake long call to entry
  323. push SI
  324. mov ES,DX ; set up proper seg registers
  325. mov DS,DX
  326. mov AX,BX ; set up proper AX
  327. retf
  328. ;-------------------------------------------------------------------------
  329. ;
  330. ; M003:
  331. ;
  332. ; If an int 21 ah=25 call is made immediately after an exec call, DOS will
  333. ; come here, turn A20 OFF restore user stack and registers before returning
  334. ; to user. This is done in dos\msdisp.asm. This has been done to support
  335. ; programs complied with MS PASCAL 3.2. See under TAG M003 in DOSSYM.INC for
  336. ; more info.
  337. ;
  338. ; Also at this point DS is DOSDATA. So we can assume DS DOSDATA. Note that
  339. ; SS is also DOS stack. It is important that we do the XMS call on DOS's
  340. ; stack to avoid additional stack overhead for the user.
  341. ;
  342. ; -------------------------------------------------------------------------
  343. public disa20_iret
  344. disa20_iret:
  345. assume ds:DOSDATA
  346. call XMMDisableA20
  347. dec InDos
  348. mov SS,User_SS ; restore user stack
  349. mov SP,User_SP
  350. mov BP,SP
  351. mov BYTE PTR [BP.User_AX],AL
  352. mov AX,Nsp
  353. mov User_SP,AX
  354. mov AX,Nss
  355. mov User_SS,AX
  356. pop AX ; restore user regs
  357. pop BX
  358. pop CX
  359. pop DX
  360. pop SI
  361. pop DI
  362. pop BP
  363. pop DS
  364. pop ES
  365. ifdef NTVDMDBG
  366. SVC SVC_DEMDOSDISPRET
  367. endif
  368. jmp DOIRET
  369. assume ds:NOTHING
  370. ;*****************************************************************************
  371. ;*** XMMDisableA20 - switch 20th address line
  372. ;
  373. ; This routine is used to disable the 20th address line in
  374. ; the system using XMM calls.
  375. ;
  376. ; ENTRY none ;ds = _DATA
  377. ; EXIT A20 line disabled
  378. ; USES NOTHING
  379. ;
  380. ;*****************************************************************************
  381. XMMDisableA20 proc near
  382. push bx
  383. push ax
  384. mov ah, XMM_LOCAL_DISABLE_A20
  385. call cs:[XMMcontrol]
  386. pop ax
  387. pop bx
  388. ret
  389. XMMDisableA20 endp
  390. ; The entry point in the BIOS XMS driver is defined here.
  391. public XMMcontrol
  392. XMMcontrol DD ?
  393. ;---------------------------------------------------------------------------
  394. ;
  395. ;*** EnsureA20ON - Ensures that A20 is ON
  396. ;
  397. ; This routine is used to query the A20 state in
  398. ; the system using XMM calls.
  399. ;
  400. ; ENTRY: none
  401. ;
  402. ; EXIT : A20 will be ON
  403. ;
  404. ;
  405. ; USES : NONE
  406. ;
  407. ;---------------------------------------------------------------------------
  408. LowMemory label dword ; Set equal to 0000:0080
  409. dw 00080h
  410. dw 00000h
  411. HighMemory label dword
  412. dw 00090h ; Set equal to FFFF:0090
  413. dw 0FFFFh
  414. ; sudeepb 07-Dec-1992 Created WEnsureA20ON so that costly pushf/popf
  415. ; can be avoided in those entry points which dont care for flags
  416. EnsureA20ON proc near
  417. pushf
  418. call WEnsureA20ON
  419. popf
  420. ret
  421. EnsureA20ON endp
  422. WEnsureA20ON proc near
  423. push ds
  424. push es
  425. push cx
  426. push si
  427. push di
  428. lds si,cs:LowMemory ; Compare the 4 words at 0000:0080
  429. les di,cs:HighMemory ; with the 4 at FFFF:0090
  430. mov cx,4
  431. cld
  432. repe cmpsw
  433. jz EA20_OFF
  434. EA20_RET:
  435. pop di
  436. pop si
  437. pop cx
  438. pop es
  439. pop ds
  440. ret
  441. EA20_OFF:
  442. ;
  443. ; We are going to do the XMS call on the DOS's AuxStack. NOTE: ints
  444. ; are disabled at this point.
  445. ;
  446. push bx
  447. push ax
  448. mov ax, ss ; save user's stack pointer
  449. mov cs:[SS_Save],ax
  450. mov cs:[SP_Save],sp
  451. mov ax, cs
  452. mov ss, ax
  453. mov sp, OFFSET DOSDATA:AuxStack
  454. ; ss:sp -> DOSDATA:AuxStack
  455. mov ah, XMM_LOCAL_ENABLE_A20
  456. call cs:[XMMcontrol]
  457. or ax, ax
  458. jz XMMerror ; AX = 0 fatal error
  459. mov ax, cs:[SS_Save] ; restore user stack
  460. mov ss, ax
  461. mov sp, cs:[SP_Save]
  462. pop ax
  463. pop bx
  464. jmp short EA20_RET
  465. WEnsureA20ON endp
  466. ifndef NEC_98
  467. XMMerror: ; M006 - Start
  468. mov ah, 0fh ; get video mode
  469. int 10h
  470. cmp al, 7 ; Q: are we an MDA
  471. je XMMcont ; Y: do not change mode
  472. xor ah, ah ; set video mode
  473. mov al, 02h ; 80 X 25 text
  474. int 10h
  475. XMMcont:
  476. mov ah, 05h ; set display page
  477. xor al, al ; page 0
  478. int 10h
  479. mov si, offset XMMERRMSG
  480. push cs
  481. pop ds
  482. cld ; clear direction flag
  483. XMMprnt:
  484. lodsb
  485. cmp al, '$' ; indicates end of XMMERRMSG
  486. jz XMMStall ; function 0eh
  487. mov ah, 14
  488. mov bx, 7
  489. int 10h
  490. jmp short XMMprnt
  491. XMMStall:
  492. call DOSTI ; allow the user to warm boot
  493. jmp XMMStall ; M006 - End
  494. else ;NEC_98
  495. extrn XMMerr:near
  496. XMMerror:
  497. jmp XMMerr ; can't locate this code in this source
  498. ; or code will be corrupted by ORG!!!
  499. endif ;NEC_98
  500. ifdef NEC_98
  501. ;
  502. ;This has been put in for WIN386 2.XX support. The format of the instance
  503. ;table was different for this. Segments will be patched in at init time.
  504. ;
  505. public OldInstanceJunk
  506. OldInstanceJunk dw 70h ;segment of BIOS
  507. dw 0 ;indicate stacks in SYSINIT area
  508. dw 6 ;5 instance items
  509. dw 0,offset dosdata:contpos, 2
  510. dw 0,offset dosdata:bcon, 4
  511. dw 0,offset dosdata:carpos,106h
  512. dw 0,offset dosdata:charco, 1
  513. dw 0,offset dosdata:exec_init_sp, 34 ;M032
  514. dw 070h,offset BData:altah, 1 ; altah byte in bios
  515. endif ;NEC_98
  516. ; M021-
  517. ;
  518. ; DosHasHMA - This flag is set by seg_reinit when the DOS actually
  519. ; takes control of the HMA. When running, this word is a reliable
  520. ; indicator that the DOS is actually using HMA. You can't just use
  521. ; CS, because ROMDOS uses HMA with CS < F000.
  522. public DosHasHMA
  523. DosHasHMA db 0
  524. public fixexepatch, RationalPatchPtr
  525. fixexepatch dw ? ; M012
  526. RationalPatchPtr dw ? ; M012
  527. ; End M021
  528. ;
  529. ; M020 Begin
  530. ;
  531. public RatBugCode
  532. RatBugCode proc far
  533. push cx
  534. mov cx, word ptr ds:[10h]
  535. loop $
  536. pop cx
  537. ret
  538. RatBugCode endp
  539. ;
  540. ; M020 End
  541. ;
  542. public UmbSave1 ; M023
  543. UmbSave1 db 0bh dup (?) ; M023
  544. public Mark3
  545. Mark3 label byte
  546. IF2
  547. IF ((OFFSET MARK3) GT (OFFSET COUNTRY_CDPG) )
  548. .ERR
  549. %OUT !DATA CORRUPTION!MARK3 OFFSET TOO BIG. RE-ORGANIZE DATA.
  550. ENDIF
  551. ENDIF
  552. ;############################################################################
  553. ;
  554. ; ** HACK FOR DOS 4.0 REDIR **
  555. ;
  556. ; The dos 4.X redir requires that country_cdpg is at offset 0122ah. Any new
  557. ; data variable that is to be added to DOSDATA must go in between Mark3
  558. ; COUNTRY_CDPG if it can.
  559. ;
  560. ; MARK3 SHOULD NOT BE > 122AH
  561. ;
  562. ; As of 9/6/90, this area is FULL!
  563. ;
  564. ;############################################################################
  565. ORG 0122ah
  566. ; The following table is used for DOS 3.3
  567. ;DOS country and code page information is defined here for DOS 3.3.
  568. ;The initial value for ccDosCountry is 1 (USA).
  569. ;The initial value for ccDosCodepage is 850.
  570. ;
  571. ;
  572. PUBLIC UCASE_TAB,FILE_UCASE_TAB,DBCS_TAB
  573. PUBLIC FILE_CHAR_TAB,COLLATE_TAB
  574. PUBLIC COUNTRY_CDPG
  575. ;
  576. ; country and code page infomation
  577. ;
  578. COUNTRY_CDPG label byte
  579. db 0,0,0,0,0,0,0,0 ; reserved words
  580. db '\COUNTRY.SYS',0 ; path name of country.sys
  581. db 51 dup (?)
  582. ; ------------------------------------------------<MSKK01>----------------------
  583. ifdef DBCS
  584. ifdef JAPAN
  585. dw 932 ; system code page id (JAPAN)
  586. endif
  587. ifdef KOREA
  588. dw 949
  589. endif
  590. ifdef TAIWAN
  591. dw 950
  592. endif
  593. ifdef PRC
  594. dw 936
  595. endif
  596. else
  597. dw 437 ; system code page id
  598. endif
  599. ; ------------------------------------------------<MSKK01>----------------------
  600. dw 6 ; number of entries
  601. db SetUcase ; Ucase type
  602. dw OFFSET DOSDATA:UCASE_TAB ;pointer to upper case table
  603. dw 0 ; segment of poiter
  604. db SetUcaseFile ; Ucase file char type
  605. dw OFFSET DOSDATA:FILE_UCASE_TAB ;pointer to file upper case table
  606. dw 0 ; segment of poiter
  607. db SetFileList ; valid file chars type
  608. dw OFFSET DOSDATA:FILE_CHAR_TAB ;pointer to valid file char tab
  609. dw 0 ; segment of poiter
  610. db SetCollate ; collate type
  611. dw OFFSET DOSDATA:COLLATE_TAB ;pointer to collate table
  612. dw 0 ; segment of poiter
  613. db SetDBCS ;AN000; DBCS Ev 2/12/KK
  614. dw OFFSET DOSDATA:DBCS_TAB ;AN000;;pointer to DBCS Ev table 2/12/KK
  615. dw 0 ;AN000; segment of poiter 2/12/KK
  616. db SetCountryInfo ; country info type
  617. dw NEW_COUNTRY_SIZE ; extended country info size
  618. ; ------------------------------------------------<MSKK01>----------------------
  619. ifdef DBCS
  620. ifdef JAPAN
  621. dw 81 ; <MSKK01> JAPAN country id
  622. dw 932 ; <MSKK01> JAPAN system code page id
  623. dw 2 ; <MSKK01> date format (YMD)
  624. db '\',0,0,0,0 ; <MSKK01> currency symbol (YEN)
  625. db ',',0 ; thousand separator
  626. db '.',0 ; decimal separator
  627. db '-',0 ; date separator
  628. db ':',0 ; time separator
  629. db 0 ; currency format flag
  630. db 0 ; <MSKK01> # of digit in currency
  631. db 1 ; <MSKK01> time format (HR24)
  632. dw OFFSET DOSDATA:MAP_CASE ;mono case routine entry point
  633. dw 0 ; segment of entry point
  634. db ',',0 ; data list separator
  635. dw 0,0,0,0,0 ; reserved
  636. endif
  637. ifdef PRC
  638. dw 86 ; PRC country id
  639. dw 936 ; PRC system code page id
  640. dw 0 ; date format (MDY)
  641. db '\',0,0,0,0 ; currency symbol
  642. db ',',0 ; thousand separator
  643. db '.',0 ; decimal separator
  644. db '-',0 ; date separator
  645. db ':',0 ; time separator
  646. db 0 ; currency format flag
  647. db 2 ; # of digit in currency
  648. db 1 ; time format (HR24)
  649. dw OFFSET DOSDATA:MAP_CASE ;mono case routine entry point
  650. dw 0 ; segment of entry point
  651. db ',',0 ; data list separator
  652. dw 0,0,0,0,0 ; reserved
  653. endif
  654. ifdef TAIWAN
  655. dw 88 ; TAIWAN country id
  656. dw 950 ; TAIWAN system code page id
  657. dw 0 ; date format (MDY)
  658. db 'N','T','$',0,0 ; currency symbol
  659. db ',',0 ; thousand separator
  660. db '.',0 ; decimal separator
  661. db '-',0 ; date separator
  662. db ':',0 ; time separator
  663. db 0 ; currency format flag
  664. db 2 ; # of digit in currency
  665. db 1 ; time format (HR24)
  666. dw OFFSET DOSDATA:MAP_CASE ;mono case routine entry point
  667. dw 0 ; segment of entry point
  668. db ',',0 ; data list separator
  669. dw 0,0,0,0,0 ; reserved
  670. endif
  671. ifdef KOREA
  672. dw 82 ; <MSCH> KOREA country id
  673. dw 949 ; <MSCH> KOREA system code page id
  674. dw 2 ; <MSCH> date format (YMD)
  675. db '\',0,0,0,0 ; <MSCH> currency symbol (WON)
  676. db ',',0 ; thousand separator
  677. db '.',0 ; decimal separator
  678. db '-',0 ; date separator
  679. db ':',0 ; time separator
  680. db 0 ; currency format flag
  681. db 0 ; <MSCH> # of digit in currency
  682. db 1 ; <MSCH> time format (HR24)
  683. dw OFFSET DOSDATA:MAP_CASE ;mono case routine entry point
  684. dw 0 ; segment of entry point
  685. db ',',0 ; data list separator
  686. dw 0,0,0,0,0 ; reserved
  687. endif
  688. else
  689. dw 1 ; USA country id
  690. dw 437 ; USA system code page id
  691. dw 0 ; date format
  692. db '$',0,0,0,0 ; currency symbol
  693. db ',',0 ; thousand separator
  694. db '.',0 ; decimal separator
  695. db '-',0 ; date separator
  696. db ':',0 ; time separator
  697. db 0 ; currency format flag
  698. db 2 ; # of digit in currency
  699. db 0 ; time format
  700. dw OFFSET DOSDATA:MAP_CASE ;mono case routine entry point
  701. dw 0 ; segment of entry point
  702. db ',',0 ; data list separator
  703. dw 0,0,0,0,0 ; reserved
  704. endif
  705. ; ------------------------------------------------<MSKK01>----------------------
  706. ifndef NEC_98
  707. ;
  708. ;This has been put in for WIN386 2.XX support. The format of the instance
  709. ;table was different for this. Segments will be patched in at init time.
  710. ;
  711. public OldInstanceJunk
  712. OldInstanceJunk dw 70h ;segment of BIOS
  713. dw 0 ;indicate stacks in SYSINIT area
  714. dw 6 ;5 instance items
  715. dw 0,offset dosdata:contpos, 2
  716. dw 0,offset dosdata:bcon, 4
  717. dw 0,offset dosdata:carpos,106h
  718. dw 0,offset dosdata:charco, 1
  719. dw 0,offset dosdata:exec_init_sp, 24
  720. dw 070h,offset BData:altah, 1 ; altah byte in bios
  721. endif ;NEC_98
  722. include msdos.cl2 ; XMMERRMSG
  723. PUBLIC vheVDM
  724. vheVDM db (size vhe_s) dup (0)
  725. PUBLIC SCS_COMSPEC
  726. SCS_COMSPEC db 64 dup (?) ; Buffer for %COMSPEC% /z
  727. PUBLIC SCS_CMDTAIL
  728. SCS_CMDTAIL db 128 dup (?) ; Buffer for Command Tail
  729. IF 2
  730. .errnz SCS_CMDTAIL-SCS_COMSPEC-64
  731. ENDIF
  732. PUBLIC SCS_PBLOCK
  733. SCS_PBLOCK db 14 dup (?) ; Buffer for parameter block
  734. IF 2
  735. .errnz SCS_PBLOCK-SCS_CMDTAIL-128
  736. ENDIF
  737. PUBLIC SCS_ToSync ; TRUE after receiving a new command
  738. SCS_ToSync db 0 ; from scs.
  739. IF 2
  740. .errnz SCS_ToSync-SCS_PBLOCK-14
  741. ENDIF
  742. PUBLIC SCS_TSR
  743. SCS_TSR db 0
  744. PUBLIC SCS_Is_Dos_Binary
  745. SCS_Is_Dos_Binary db 0
  746. PUBLIC SCS_CMDPROMPT
  747. SCS_CMDPROMPT db 0
  748. PUBLIC SCS_DOSONLY
  749. SCS_DOSONLY db 0
  750. PUBLIC SCS_FDACCESS
  751. EVEN
  752. SCS_FDACCESS dw 0
  753. include dpb.inc
  754. PUBLIC FAKE_NTDPB
  755. FAKE_NTDPB db (size DPB) dup (0)
  756. ; This and NetCDS data structures are used by NT DOSEm for redirected drives.
  757. ifdef JAPAN
  758. I_am NetCDS,curdirLen_JPN ; CDS for redirected drives
  759. else
  760. I_am NetCDS,curdirLen ; CDS for redirected drives
  761. endif
  762. ;; williamh, moved from dostab.asm because it broke MARK3
  763. ;smr; moved from TABLE segment in exec.asm
  764. EXEC_NEWHEADER_OFFSET equ 03Ch
  765. I_am exec_init_SP,WORD
  766. I_am exec_init_SS,WORD
  767. I_am exec_init_IP,WORD
  768. I_am exec_init_CS,WORD
  769. I_am exec_signature,WORD ; must contain 4D5A (yay zibo!)
  770. I_am exec_len_mod_512,WORD ; low 9 bits of length
  771. I_am exec_pages,WORD ; number of 512b pages in file
  772. I_am exec_rle_count,WORD ; count of reloc entries
  773. I_am exec_par_dir,WORD ; number of paragraphs before image
  774. I_am exec_min_BSS,WORD ; minimum number of para of BSS
  775. I_am exec_max_BSS,WORD ; max number of para of BSS
  776. I_am exec_SS,WORD ; stack of image
  777. I_am exec_SP,WORD ; SP of image
  778. I_am exec_chksum,WORD ; checksum of file (ignored)
  779. I_am exec_IP,WORD ; IP of entry
  780. I_am exec_CS,WORD ; CS of entry
  781. I_am exec_rle_table,WORD ; byte offset of reloc table
  782. public Exec_header_len
  783. Exec_header_len EQU $-Exec_Signature ;PBUGBUG
  784. db (EXEC_NEWHEADER_OFFSET - Exec_header_len) dup(?)
  785. I_am exec_NE_offset, WORD
  786. public Exec_header_len_NE
  787. Exec_header_len_NE equ EXEC_NEWHEADER_OFFSET + 2
  788. ;smr; eom
  789. ifdef NTVDMDBG
  790. PUBLIC SCS_ISDEBUG
  791. SCS_ISDEBUG db 0
  792. endif
  793. include doswow.inc
  794. EVEN
  795. PUBLIC DosWowDataStart
  796. DosWowDataStart Label word
  797. DOSWOWDATA <OFFSET DOSDATA:CDSCOUNT,OFFSET DOSDATA:CDSADDR, \
  798. OFFSET DOSDATA:NetCDS, \
  799. OFFSET DOSDATA:CURDRV,OFFSET DOSDATA:CurrentPDB, \
  800. OFFSET DOSDATA:DrvErr,OFFSET DOSDATA:EXTERR_LOCUS, \
  801. OFFSET DOSDATA:SCS_ToSync, OFFSET DOSDATA:sfTabl, \
  802. OFFSET DOSDATA:EXTERR, OFFSET DOSDATA:EXTERR_ACTION>
  803. DOCLI:
  804. FCLI
  805. ret
  806. DOSTI:
  807. FSTI
  808. ret
  809. DOIRET:
  810. FIRET
  811. DOSDATA ends