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.

423 lines
15 KiB

  1. page ,132
  2. ; SCCSID = @(#)uinit.asm 4.5 85/12/04
  3. ; SCCSID = @(#)uinit.asm 4.5 85/12/04
  4. TITLE COMMAND Initialization messages
  5. ;/*
  6. ; * Microsoft Confidential
  7. ; * Copyright (C) Microsoft Corporation 1991
  8. ; * All Rights Reserved.
  9. ; */
  10. ;
  11. ; Revision History
  12. ; ================
  13. ; M003 SR 07/16/90 Added Lh_OffUnlink to the offset
  14. ; patch table (Reloc_Table) for UMB
  15. ; support
  16. ;
  17. .XCREF
  18. .XLIST
  19. include comsw.asm
  20. include comseg.asm
  21. include ifequ.asm
  22. .LIST
  23. .CREF
  24. addr macro sym,name
  25. public name
  26. ifidn <name>,<>
  27. dw offset resgroup:sym
  28. else
  29. name dw offset resgroup:sym
  30. endif
  31. endm
  32. CODERES segment
  33. extrn ContC :near
  34. extrn DskErr :near
  35. extrn Int_2e :near
  36. extrn MsgInt2fHandler :near
  37. extrn Exec_Ret :near
  38. extrn TRemCheck :far
  39. extrn TrnLodCom1 :near
  40. extrn MsgRetriever :near
  41. extrn LodCom :near
  42. extrn THeadFix :far
  43. extrn Lh_OffUnlink :far ; M003
  44. CODERES ends
  45. ;;ENVIRONMENT SEGMENT PUBLIC PARA ;AC000;
  46. ;; EXTRN ECOMSPEC:BYTE
  47. ;;ENVIRONMENT ENDS
  48. TRANCODE SEGMENT PUBLIC BYTE ;AC000;
  49. extrn Printf_init:FAR
  50. extrn Triage_Init:FAR
  51. extrn append_parse:FAR ;AN054;
  52. TranCode ENDS
  53. INIT SEGMENT PUBLIC PARA ;AC000;
  54. public icondev
  55. public BADCSPFL
  56. public COMSPECT
  57. ; NTVDM not used public AUTOBAT
  58. public space
  59. public PRDATTM
  60. public INITADD
  61. public print_add
  62. public CHUCKENV
  63. public scswitch
  64. public skswitch
  65. public ucasea
  66. ;; public ECOMLOC
  67. public equalsign
  68. public lcasea
  69. public lcasez
  70. public comspstring
  71. public EnvSiz
  72. public EnvMax
  73. public initend
  74. public trnsize
  75. public resetenv ;AC000;
  76. public ext_msg ;AC000;
  77. public num_positionals
  78. public internat_info
  79. public parsemes_ptr
  80. PUBLIC triage_add
  81. PUBLIC oldenv
  82. PUBLIC usedenv
  83. ; NTVDM not used PUBLIC KAUTOBAT ;AN000; 3/3/KK
  84. public eswitch ;AN018;
  85. public dswitch ;AN018;
  86. public init_parse ;AN054;
  87. public old_parse_ptr ;AN057;
  88. PUBLIC pars_msg_off ;AN060;
  89. PUBLIC pars_msg_seg ;AN060;
  90. public PathString
  91. public Reloc_Table
  92. public ResJmpTable
  93. public FirstCom
  94. public DevFlag
  95. public PathFlag
  96. include resmsg.equ ;AC000;
  97. ICONDEV LABEL BYTE
  98. DB "/DEV/"
  99. DB "CON",0,0,0,0,0,0 ; Room for 8 char device
  100. BADCSPFL DB 0
  101. COMSPECT DB "\COMMAND.COM",0,0
  102. ;NTVDM not used AUTOBAT DB 0,":\AUTOEXEC.BAT",0,0DH ;AC027;
  103. ;NTVDM not used KAUTOBAT DB 0,":\KAUTOEXE.BAT",0,0DH ;AC027; 3/3/KK
  104. PRDATTM DB -1 ;Init not to prompt for date time
  105. INITADD DD ?
  106. print_add LABEL DWORD
  107. DW OFFSET TranGroup:Printf_INIT
  108. DW 0
  109. triage_add LABEL DWORD
  110. DW OFFSET TranGroup:Triage_Init
  111. DW 0
  112. CHUCKENV DB 0
  113. ;eg ECOMLOC DW OFFSET ENVIRONMENT:ECOMSPEC-10H
  114. ;;ECOMLOC DW OFFSET ENVIRONMENT:ECOMSPEC ;eg
  115. PathString db "PATH=",0
  116. ComspString db "COMSPEC=\COMMAND.COM",0
  117. ;;COMSPSTRING DB "COMSPEC="
  118. equalsign db "="
  119. lcasea db "a"
  120. lcasez db "z"
  121. space db " "
  122. scswitch db "C" ; Single command
  123. skswitch db "K" ; Single command
  124. ucasea db "A"
  125. EnvSiz DW 0 ; size user wants to allocate
  126. EnvMax DW 0 ; maximum size allowed.
  127. oldenv DW 0 ; envirseg at initialization
  128. usedenv DW 0 ; amount of envirseg used
  129. PARS_MSG_OFF DW 0 ;AN060; SAVED PARSE ERROR MESSAGE OFFSET
  130. PARS_MSG_SEG DW 0 ;AN060; SAVED PARSE ERROR MESSAGE SEGMENT
  131. ;Do not separate the following two words. Used to call transient PARSE routine
  132. init_parse label dword ;AN054;
  133. init_p DW TRANGROUP:APPEND_PARSE ;AN054;
  134. initend DW 0 ;eg segment address of end of init
  135. ;End of data that shouldn't be separated.
  136. trnsize DW 0 ;eg size of transient in paragraphs
  137. resetenv DB 0 ;eg set if we need to setblck env at endinit
  138. ext_msg DB 0 ;AN000; set if /MSG switch entered
  139. eswitch db 0 ;AN018; set if /e was entered
  140. dswitch db 0 ;AN018; set if /d was entered
  141. parsemes_ptr dw 0 ;AN000; word to store parse error number
  142. ;
  143. ; PARSE BLOCK FOR COMMAND
  144. ;
  145. PUBLIC PARSE_COMMAND ;AN000;
  146. PUBLIC COMND1_OUTPUT ;AN000;
  147. PUBLIC COMND1_TYPE ;AN000;
  148. PUBLIC COMND1_CODE ;AN000;
  149. PUBLIC COMND1_SYN ;AN000;
  150. PUBLIC COMND1_ADDR ;AN000;
  151. PUBLIC COMMAND_F_SYN ;AN000;
  152. PUBLIC COMMAND_P_SYN ;AN000;
  153. PUBLIC COMMAND_C_SYN ;AN000;
  154. PUBLIC COMMAND_D_SYN ;AN000;
  155. PUBLIC COMMAND_E_SYN ;AN000;
  156. PUBLIC COMMAND_K_SYN ;AN000;
  157. PUBLIC COMMAND_L2_SYN
  158. PUBLIC COMMAND_L_SYN
  159. PUBLIC COMMAND_M_SYN ;AN000;
  160. PUBLIC COMMAND_U_SYN
  161. PUBLIC COMMAND_?_SYN
  162. PUBLIC COMMAND_Y_SYN
  163. PUBLIC COMMAND_Z_SYN
  164. ;
  165. ; The following parse control block is used for COMMAND. This block is
  166. ; used for parsing during initialization. The sytax for COMMAND is:
  167. ; COMMAND [/?] [d:][path][/P][/F][/D][/E:xxxxx][/MSG][/C executable][/K executable]
  168. ;
  169. ; Anything on the command line after the /C or /K switch will be passed to the
  170. ; executable command, so if /C or /K is used, it must be specified last. The
  171. ; /MSG switch can only be specified if the /P switch is specified.
  172. ;
  173. ; The /? switch causes help text to be displayed. Any other options
  174. ; on the command line are ignored. Command.com will not load if /?
  175. ; is specified.
  176. ;
  177. ENVBIG EQU 32768 ;AN000; maximum environment size
  178. ENVSML EQU 160 ;AN000; minimum environment size
  179. INTERNAT_INFO LABEL BYTE ;AN000; used for country info after parsing is completed
  180. PARSE_COMMAND LABEL BYTE ;AN000;
  181. DW RESGROUP:COMMAND_PARMS ;AN000;
  182. DB 0 ;AN000; no extra delimiter
  183. COMMAND_PARMS LABEL BYTE ;AN000;
  184. DB 0,2 ;AN000; 1 positional parm
  185. DW RESGROUP:COMMAND_FILE ;AN000;
  186. dw RESGROUP:Command_File
  187. DB 13 ;AN000; 13 switches
  188. DW RESGROUP:COMMAND_SWITCH1 ;AN000;
  189. DW RESGROUP:COMMAND_SWITCH2 ;AN000;
  190. DW RESGROUP:COMMAND_SWITCH3 ;AN000;
  191. DW RESGROUP:COMMAND_SWITCH4 ;AN000;
  192. DW RESGROUP:COMMAND_SWITCH5 ;AN000;
  193. DW RESGROUP:COMMAND_SWITCH6 ;AN000;
  194. DW RESGROUP:COMMAND_SWITCH7
  195. DW RESGROUP:COMMAND_SWITCH8
  196. DW RESGROUP:COMMAND_SWITCH9
  197. DW RESGROUP:COMMAND_SWITCH10
  198. DW RESGROUP:COMMAND_SWITCH11
  199. DW RESGROUP:COMMAND_SWITCH12
  200. DW RESGROUP:COMMAND_SWITCH13
  201. DB 0 ;AN000; no keywords
  202. COMMAND_FILE LABEL BYTE ;AN000;
  203. DW 0201H ;AN000; filespec - optional
  204. DW 1 ;AN000; capitalize - file table
  205. DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
  206. DW RESGROUP:NO_VAL ;AN000;
  207. DB 0 ;AN000; no keywords
  208. COMMAND_SWITCH1 LABEL BYTE ;AN000;
  209. DW 0 ;AN000; no match flags
  210. DW 2 ;AN000; capitalize by char table
  211. DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
  212. DW RESGROUP:NO_VAL ;AN000;
  213. DB 1 ;AN000; 1 keyword
  214. COMMAND_P_SYN DB "/P",0 ;AN000; /P switch
  215. COMMAND_SWITCH2 LABEL BYTE ;AN000;
  216. DW 0 ;AN000; no match flags
  217. DW 2 ;AN000; capitalize by char table
  218. DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
  219. DW RESGROUP:NO_VAL ;AN000;
  220. DB 1 ;AN000; 1 keyword
  221. COMMAND_F_SYN DB "/F",0 ;AN000; /F switch
  222. COMMAND_SWITCH3 LABEL BYTE ;AN000;
  223. DW 0 ;AN000; no match flags
  224. DW 2 ;AN000; capitalize by char table
  225. DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
  226. DW RESGROUP:NO_VAL ;AN000;
  227. DB 1 ;AN000; 1 keyword
  228. COMMAND_D_SYN DB "/D",0 ;AN000; /D switch
  229. COMMAND_SWITCH4 LABEL BYTE ;AN000;
  230. DW 8000H ;AN000; numeric value - required
  231. DW 0 ;AN000; no function flags
  232. DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
  233. DW RESGROUP:COMMAND_E_VAL ;AN000; pointer to value list
  234. DB 1 ;AN000; 1 keyword
  235. COMMAND_E_SYN DB "/E",0 ;AN000; /E switch
  236. COMMAND_E_VAL LABEL BYTE ;AN000;
  237. DB 1 ;AN000;
  238. DB 1 ;AN000; 1 range
  239. DB 1 ;AN000; returned if result
  240. DD ENVSML,ENVBIG ;AN000; minimum & maximum value
  241. DB 0 ;AN000; no numeric values
  242. DB 0 ;AN000; no string values
  243. COMMAND_SWITCH5 LABEL BYTE ;AN000;
  244. DW 0 ;AN000; no match flags
  245. DW 2 ;AN000; capitalize by char table
  246. DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
  247. DW RESGROUP:NO_VAL ;AN000;
  248. DB 1 ;AN000; 1 keyword
  249. COMMAND_C_SYN DB "/C",0 ;AN000; /C switch
  250. COMMAND_SWITCH6 LABEL BYTE ;AN000;
  251. DW 0 ;AN000; no match flags
  252. DW 2 ;AN000; capitalize by char table
  253. DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
  254. DW RESGROUP:NO_VAL ;AN000;
  255. DB 1 ;AN000; 1 keyword
  256. COMMAND_M_SYN DB "/MSG",0 ;AN000; /MSG switch
  257. COMMAND_SWITCH7 LABEL BYTE ;AN000;
  258. DW 0 ;AN000; no match flags
  259. DW 2 ;AN000; capitalize by char table
  260. DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
  261. DW RESGROUP:NO_VAL ;AN000;
  262. DB 1 ;AN000; 1 keyword
  263. COMMAND_?_SYN DB "/?",0 ;AN000; /? switch
  264. COMMAND_SWITCH8 LABEL BYTE ;AN000;
  265. DW 0 ;AN000; no match flags
  266. DW 2 ;AN000; capitalize by char table
  267. DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
  268. DW RESGROUP:NO_VAL ;AN000;
  269. DB 1 ;AN000; 1 keyword
  270. COMMAND_Z_SYN DB "/Z",0 ;AN000; /Z switch
  271. COMMAND_SWITCH9 LABEL BYTE ;AN000;
  272. DW 0 ;AN000; no match flags
  273. DW 2 ;AN000; capitalize by char table
  274. DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
  275. DW RESGROUP:NO_VAL ;AN000;
  276. DB 1 ;AN000; 1 keyword
  277. COMMAND_K_SYN DB "/K",0 ;AN000; /K switch
  278. COMMAND_SWITCH10 LABEL BYTE ;AN000;
  279. DW 0 ;AN000; no match flags
  280. DW 2 ;AN000; capitalize by char table
  281. DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
  282. DW RESGROUP:NO_VAL ;AN000;
  283. DB 1 ;AN000; 1 keyword
  284. COMMAND_Y_SYN DB "/Y",0 ;AN000; /Y switch
  285. COMMAND_SWITCH11 LABEL BYTE ;AN000;
  286. DW 0 ;AN000; no match flags
  287. DW 2 ;AN000; capitalize by char table
  288. DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
  289. DW RESGROUP:NO_VAL ;AN000;
  290. DB 1 ;AN000; 1 keyword
  291. COMMAND_L_SYN DB "/LOW",0 ;AN000; /LOW switch
  292. COMMAND_SWITCH12 LABEL BYTE ;AN000;
  293. DW 8000H ;AN000; numeric value - required
  294. DW 0 ;AN000; no function flags
  295. DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
  296. DW RESGROUP:COMMAND_L2_VAL ;AN000; pointer to value list
  297. DB 1 ;AN000; 1 keyword
  298. COMMAND_L2_SYN DB "/L",0 ;AN000; /L switch
  299. COMMAND_L2_VAL LABEL BYTE ;AN000;
  300. DB 1 ;AN000;
  301. DB 1 ;AN000; 1 range
  302. DB 1 ;AN000; returned if result
  303. DD 0,ENVBIG ;AN000; minimum & maximum value
  304. DB 0 ;AN000; no numeric values
  305. DB 0 ;AN000; no string values
  306. COMMAND_SWITCH13 LABEL BYTE ;AN000;
  307. DW 8000H ;AN000; numeric value - required
  308. DW 0 ;AN000; no function flags
  309. DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
  310. DW RESGROUP:COMMAND_U_VAL ;AN000; pointer to value list
  311. DB 1 ;AN000; 1 keyword
  312. COMMAND_U_SYN DB "/U",0 ;AN000; /U switch
  313. COMMAND_U_VAL LABEL BYTE ;AN000;
  314. DB 1 ;AN000;
  315. DB 1 ;AN000; 1 range
  316. DB 1 ;AN000; returned if result
  317. DD 0,ENVBIG ;AN000; minimum & maximum value
  318. DB 0 ;AN000; no numeric values
  319. DB 0 ;AN000; no string values
  320. COMND1_OUTPUT LABEL BYTE ;AN000;
  321. COMND1_TYPE DB 0 ;AN000; type
  322. COMND1_CODE DB 0 ;AN000; return value
  323. COMND1_SYN DW 0 ;AN000; synonym pointer
  324. COMND1_ADDR DD 0 ;AN000; numeric value / address
  325. ; of string value
  326. NO_VAL DB 0 ;AN000; no values
  327. num_positionals DW 0 ;AN000; counter for positionals
  328. old_parse_ptr DW 0 ;AN057; SI position before calling parser
  329. ;*** INITIALIZATION MESSAGES
  330. include comimsg.inc ;M00
  331. ;SR;
  332. ; This table of offsets is used by the init code to calculate the new offsets
  333. ;for these labels after the resident code has been relocated
  334. ;
  335. Reloc_Table dw offset CODERES:MsgInt2fHandler
  336. dw offset CODERES:Int_2e
  337. dw offset CODERES:ContC
  338. dw offset CODERES:DskErr
  339. dw offset CODERES:Exec_Ret
  340. dw offset CODERES:TRemCheck
  341. dw offset CODERES:TrnLodCom1
  342. dw offset CODERES:LodCom
  343. dw offset CODERES:MsgRetriever
  344. dw offset CODERES:THeadFix
  345. dw offset CODERES:Lh_OffUnlink ; M003
  346. NUM_RELOC_ENTRIES equ ($ - Reloc_Table) / 2
  347. public NUM_RELOC_ENTRIES
  348. ResJmpTable dd ? ;stores prev stub jump table addr
  349. FirstCom db 0 ;flag set if first command.com
  350. DevFlag db 0
  351. PathFlag db 0
  352. INIT ends
  353. end
  354.