Source code of Windows XP (NT5)
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.

220 lines
4.7 KiB

  1. DOSDATA Segment
  2. ;
  3. ; first and second DOS patches
  4. ; Non-console device read/write (system calls 3Fh and 40h)
  5. ;
  6. ; Code in disk.asm, 2 locations, one for read, one for write
  7. ; DVRDLP:
  8. ; DVWRTLP:
  9. ;
  10. ;
  11. ; 036h lds si,SS:[????] ; ThisSFT
  12. ; lds si,si+7 ; sf_devptr
  13. ; 0E8h call ???? <- "simulate" int28 event ; DSKSTATCHK
  14. ;
  15. ;
  16. DOSP1_ID db 036h,0C5h,036h
  17. DOSP1_THISSFT db 036h,005h,0C5h,074h,007h,0E8h
  18. DOSP1_ID_LEN equ $-DOSP1_ID
  19. db 90h, 90h
  20. DOSP12_ID db 036h,0C5h,036h
  21. DOSP12_THISSFT db 036h,005h,0C5h,074h,007h,0E8h
  22. DOSP12_ID_LEN equ $-DOSP1_ID
  23. ;
  24. ; Third/Fourth DOS patch - System call 3Fh (Read) from console
  25. ;
  26. ; Code in disk.asm, 1 location
  27. ; GETBUF:
  28. ;
  29. ; 051h push cx <- begin special int28 mode
  30. ; push es
  31. ; push di
  32. ; mov dx,???? ; offset dosgroup:CONBUF
  33. ; call ???? ; $STD_CON_STRING_INPUT
  34. ; pop di
  35. ; pop es
  36. ; 059h pop cx <- end special int28 mode
  37. ;
  38. DOSP3_ID db 051h,006h,057h,0BAh
  39. DOSP3_CONBUF db 029h,002h,0E8h
  40. DOSP3_ID_LEN equ $-DOSP3_ID
  41. db 09Ah,0E3h,05Fh,007h ; ???? , pop di, pop es
  42. DOSP4_ID db 059h ; pop cx
  43. DOSP4_ID_OFF equ (DOSP4_ID - DOSP3_ID)
  44. ;
  45. ; Fifth DOS patch - System call 40h (Write) to console
  46. ;
  47. ;
  48. ; Code in disk.asm, 1 location
  49. ;
  50. ; push cx
  51. ; WRCONLP: lodsb
  52. ; cmp al,1Ah
  53. ; jz ????
  54. ; call ???? <- "simulate" int28 event
  55. ; loop WRCONLP
  56. ; CONEOF: pop ax
  57. ;
  58. DOSP5_ID db 051h ; push cx
  59. db 0ACh,03Ch,01Ah,074h,005h
  60. db 0E8h ; call
  61. DOSP5_ID_LEN equ $-DOSP5_ID
  62. ;
  63. ; Seventh DOS patch - System call entry, patch USER_ID with VMid for share
  64. ;
  65. ; Code in disp.asm, 1 location
  66. ;
  67. ;
  68. ; mov [SaveDS],ds
  69. ; mov [SaveBX],bx
  70. ; mov bx,cs
  71. ; mov ds,bx
  72. ; inc [indos]
  73. ; xor ax,ax
  74. ; mov [USER_ID],AX <- Patch to set USER_ID to VMID
  75. ;
  76. ;
  77. DOSP7_ID db 02Eh,08Ch,01Eh
  78. DOSP7_SAVEDS db 07Eh,05h ; mov [SaveDS],ds
  79. db 02Eh,089h,01Eh
  80. DOSP7_SAVEBX db 07Ch,05h ; mov [SaveBX],bx
  81. db 08Ch,0CBh ; mov bx,cs
  82. db 08Eh,0DBh ; mov ds,bx
  83. db 0FEh,006h
  84. DOSP7_INDOS db 0CFh,002h ; inc [indos]
  85. db 033h,0C0h ; xor ax,ax
  86. DOSP7_ID_LEN equ $-DOSP7_ID
  87. ;
  88. ; Eighth DOS patch - OWNER check in handle calls. For share, need to NOP test
  89. ;
  90. ; Code in handle.asm, 1 location in routine CheckOwner
  91. ;
  92. ;
  93. ;
  94. ; push ax
  95. ; mov ax,ss:[USER_ID] <- patch to XOR AX,AX to set zero
  96. ; cmp ax,es:[di.sf_UID] <- NOP
  97. ; pop ax
  98. ; jz ????
  99. ;
  100. ;
  101. ;
  102. DOSP8_ID db 050h ; push ax
  103. db 036h,0A1h
  104. DOSP8_USER_ID db 0EAh,002h ; mov ax,ss:[USER_ID]
  105. db 026h,03Bh,045h ; cmp ax,es:[di+2F]
  106. DOSP8_ID_LEN equ $-DOSP8_ID
  107. db 02Fh,058h ; pop ax
  108. ;
  109. ; 10th, 11th, 12th DOS patch - System call 3Fh (Read) in raw mode
  110. ;
  111. ; Take RAW read to STDIN SFT and turn it into a polling loop doing
  112. ; a yeild when a character is not ready to be read.
  113. ;
  114. ; Code in disk.asm, 3 locations
  115. ;
  116. ; DVRDRAW:
  117. ; PUSH ES
  118. ; POP DS
  119. ; ReadRawRetry: <- Patch 10
  120. ; MOV BX,DI
  121. ; XOR AX,AX <- Reenter #2
  122. ; MOV DX,AX
  123. ; call SETREAD
  124. ; PUSH DS <- Reenter #1
  125. ; LDS SI,[THISSFT]
  126. ; call DEVIOCALL
  127. ; MOV DX,DI
  128. ; MOV AH,86H
  129. ; MOV DI,[DEVCALL.REQSTAT]
  130. ; TEST DI,STERR
  131. ; JZ CRDROK
  132. ; call CHARHARD
  133. ; MOV DI,DX
  134. ; OR AL,AL
  135. ; JZ CRDROK
  136. ; CMP AL,3
  137. ; JZ CRDFERR
  138. ; POP DS
  139. ; JMP ReadRawRetry
  140. ;
  141. ; CRDFERR:
  142. ; POP DI <- Patch 11
  143. ; DEVIOFERR:
  144. ; LES DI,[THISSFT]
  145. ; jmp SET_ACC_ERR_DS
  146. ;
  147. ; CRDROK:
  148. ; POP DI <- Patch 12
  149. ; MOV DI,DX
  150. ; ADD DI,[CALLSCNT]
  151. ; JMP SHORT ENDRDDEVJ3
  152. ;
  153. ;
  154. DOSP10_ID db 006H,01FH
  155. DOSP10_LOC_OFFSET equ $-DOSP10_ID
  156. DOSP10_LOC db 08BH,0DFH
  157. DOSP10_REENT2_OFFSET equ $-DOSP10_LOC
  158. db 033H,0C0H,08BH,0D0H,0E8H
  159. DOSP10_ID_LEN equ $-DOSP10_ID
  160. db 0DFH,00EH
  161. DOSP10_REENT1_OFFSET equ $-DOSP10_LOC
  162. db 01EH,036H,0C5H,036H,036H,005H,0E8H,0AFH,00EH
  163. db 08BH,0D7H,0B4H,086H,036H,08BH,03EH
  164. DOSP10_PACKVAL_OFFSET equ $-DOSP10_ID
  165. db 009H,003H
  166. db 0F7H,0C7H,000H,080H,074H,019H,0E8H,047H,017H
  167. db 08BH,0FAH,00AH,0C0H,074H,010H,03CH,003H,074H,003H
  168. db 01FH,0EBH,0CFH
  169. DOSP11_LOC_OFFSET equ $-DOSP10_ID
  170. db 05FH
  171. DOSP11_REENT_OFFSET equ $-DOSP10_LOC
  172. db 036H,0C4H,03EH,036H,005H,0E9H,0A1H,004H
  173. DOSP12_LOC_OFFSET equ $-DOSP10_ID
  174. db 05FH,08BH,0FAH
  175. ;
  176. ; 13th DOS patch - Actually a SYSINIT patch. Patches the stack fault code
  177. ; which prints the fatal stack fault error on DOS >= 3.20.
  178. ;
  179. ; Sets focus to current VM so user can see fatal message.
  180. ;
  181. ;
  182. ; l0: lodsb <- Setfocus here
  183. ; cmp al, '$'
  184. ; je l1
  185. ; mov bl, 7
  186. ; mov ah, 0Eh
  187. ; int 10h
  188. ; jmp l0
  189. ; l1: jmp $
  190. ;
  191. ;
  192. ;
  193. DOSP13_ID db 0ACh ; l0: lodsb
  194. db 03Ch,024h ; cmp al, '$'
  195. db 074h,008h ; je l1
  196. db 0B3h,007h ; mov bl, 7
  197. db 0B4h,00Eh ; mov ah, 0Eh
  198. db 0CDh,010h ; int 10h
  199. db 0EBh,0F3h ; jmp l0
  200. db 0EBh,0FEh ; l1: jmp $
  201. DOSP13_ID_LEN equ $-DOSP13_ID
  202. DOSDATA ends
  203.