DOS 3.30 source code leak
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.

1276 lines
34 KiB

5 years ago
  1. TITLE BIOS SYSTEM INITIALIZATION
  2. TRUE EQU 0FFFFh
  3. FALSE EQU 0
  4. ;IBMVER EQU TRUE
  5. ;IBM EQU IBMVER
  6. STACKSW EQU TRUE ;Include Switchable Hardware Stks ;3.30
  7. ;IBMJAPVER EQU FALSE ;If TRUE set KANJI true also
  8. ;MSVER EQU FALSE
  9. ;ALTVECT EQU FALSE ;Switch to build ALTVECT version
  10. ;KANJI EQU FALSE
  11. include version.inc
  12. IF IBMJAPVER
  13. NOEXEC EQU TRUE
  14. ELSE
  15. NOEXEC EQU FALSE
  16. ENDIF
  17. DOSSIZE EQU 0A000H
  18. .xlist
  19. include smdossym.inc ; Reduced version of DOSSYM.INC ;3.30
  20. INCLUDE devsym.inc
  21. include ioctl.inc
  22. .list
  23. IF NOT IBM
  24. IF NOT IBMJAPVER
  25. EXTRN RE_INIT:FAR
  26. ENDIF
  27. ENDIF
  28. SYSINITSEG SEGMENT PUBLIC 'SYSTEM_INIT' BYTE
  29. ASSUME CS:SYSINITSEG,DS:NOTHING,ES:NOTHING,SS:NOTHING
  30. EXTRN BADOPM:BYTE,CRLFM:BYTE,BADCOM:BYTE,BADMEM:BYTE,BADBLOCK:BYTE
  31. EXTRN BADSIZ_PRE:BYTE,BADLD_PRE:BYTE
  32. EXTRN BADSIZ_POST:BYTE,BADLD_POST:BYTE
  33. EXTRN SYSSIZE:BYTE,BADCOUNTRY:BYTE
  34. EXTRN dosinfo:dword,entry_point:dword,
  35. EXTRN MEMORY_SIZE:WORD,fcbs:byte,keep:byte
  36. EXTRN DEFAULT_DRIVE:BYTE,confbot:word,alloclim:word
  37. EXTRN BUFFERS:WORD,zero:byte,sepchr:byte
  38. EXTRN FILES:BYTE,stall:near
  39. EXTRN count:word,chrptr:word
  40. EXTRN bufptr:byte,memlo:word,prmblk:byte,memhi:word
  41. EXTRN ldoff:word,area:word,PACKET:BYTE,UNITCOUNT:BYTE,
  42. EXTRN BREAK_ADDR:DWORD,BPB_ADDR:DWORD,drivenumber:byte
  43. PUBLIC Int24,Open_Dev,Organize,Mem_Err,Newline,CallDev,Badload
  44. PUBLIC PrnDev,AuxDev,Config,Commnd,Condev,GetNum,BadFil,PrnErr
  45. PUBLIC Round,Delim,Print,Set_Break
  46. PUBLIC SetParms, ParseLine, DiddleBack
  47. PUBLIC Skip_delim,SetDOSCountryInfo,Set_Country_Path,Move_Asciiz ;3.30
  48. PUBLIC Cntry_Drv,Cntry_Root,Cntry_Path ;3.30
  49. PUBLIC Delim ;3.30
  50. ASSUME DS:SYSINITSEG
  51. ;
  52. ; The following set of routines is used to parse the DRIVPARM = command in
  53. ; the CONFIG.SYS file to change the default drive parameters.
  54. ;
  55. SetParms:
  56. push ds
  57. push ax
  58. push bx
  59. push cx
  60. push dx
  61. xor bx,bx
  62. mov bl,byte ptr drive
  63. inc bl ; get it correct for IOCTL call (1=A,2=B...)
  64. push cs
  65. pop ds
  66. mov dx,offset DeviceParameters
  67. mov ah, IOCTL
  68. mov al, GENERIC_IOCTL
  69. mov ch, RAWIO
  70. mov cl, SET_DEVICE_PARAMETERS
  71. int 21H
  72. pop dx
  73. pop cx
  74. pop bx
  75. pop ax
  76. pop ds
  77. ret
  78. ;
  79. ; Replace default values for further DRIVPARM commands
  80. ;
  81. DiddleBack:
  82. mov word ptr DeviceParameters.DP_Cylinders,80
  83. mov byte ptr DeviceParameters.DP_DeviceType, DEV_3INCH720KB
  84. mov word ptr DeviceParameters.DP_DeviceAttributes,0
  85. mov word ptr switches,0 ; zero all switches
  86. ret
  87. ;
  88. ; Entry point is ParseLine. AL contains the first character in command line.
  89. ;
  90. ParseLine: ; don't get character first time
  91. push ds
  92. push cs
  93. pop ds
  94. NextSwtch:
  95. cmp al,13 ; carriage return?
  96. jz done_line
  97. cmp al,10 ; linefeed?
  98. jz put_back ; put it back and done
  99. ; Anything less or equal to a space is ignored.
  100. cmp al,' ' ; space?
  101. jbe get_next ; skip over space
  102. cmp al,'/'
  103. jz getparm
  104. stc ; mark error invalid-character-in-input
  105. jmp short exitpl
  106. getparm:
  107. call Check_Switch
  108. mov word ptr Switches,BX ; save switches read so far
  109. jc swterr
  110. get_next:
  111. invoke getchr
  112. jc done_line
  113. jmp NextSwtch
  114. swterr:
  115. jmp exitpl ; exit if error
  116. done_line:
  117. test word ptr Switches,flagdrive ; see if drive specified
  118. jnz okay
  119. stc ; mark error no-drive-specified
  120. jmp short exitpl
  121. okay:
  122. mov ax,word ptr switches
  123. and ax,0003H ; get flag bits for changeline and non-rem
  124. mov word ptr DeviceParameters.DP_DeviceAttributes,ax
  125. mov word ptr DeviceParameters.DP_TrackTableEntries, 0
  126. clc ; everything is fine
  127. call SetDeviceParameters
  128. exitpl:
  129. pop ds
  130. ret
  131. put_back:
  132. inc count ; one more char to scan
  133. dec chrptr ; back up over linefeed
  134. jmp short done_line
  135. ;
  136. ; Processes a switch in the input. It ensures that the switch is valid, and
  137. ; gets the number, if any required, following the switch. The switch and the
  138. ; number *must* be separated by a colon. Carry is set if there is any kind of
  139. ; error.
  140. ;
  141. Check_Switch:
  142. invoke getchr
  143. jc err_check
  144. and al,0DFH ; convert it to upper case
  145. cmp al,'A'
  146. jb err_check
  147. cmp al,'Z'
  148. ja err_check
  149. push es
  150. push cs
  151. pop es
  152. mov cl,byte ptr switchlist ; get number of valid switches
  153. mov ch,0
  154. mov di,1+offset switchlist ; point to string of valid switches
  155. repne scasb
  156. pop es
  157. jnz err_check
  158. mov ax,1
  159. shl ax,cl ; set bit to indicate switch
  160. mov bx,word ptr switches ; get switches so far
  161. or bx,ax ; save this with other switches
  162. mov cx,ax
  163. test ax,7cH ; test against switches that require number to follow
  164. jz done_swtch
  165. invoke getchr
  166. jc err_Swtch
  167. cmp al,':'
  168. jnz err_swtch
  169. invoke getchr
  170. push bx ; preserve switches
  171. mov byte ptr cs:sepchr,' ' ; allow space separators
  172. call GetNum
  173. mov byte ptr cs:sepchr,0
  174. pop bx ; restore switches
  175. ; Because GetNum does not consider carriage-return or line-feed as OK, we do
  176. ; not check for carry set here. If there is an error, it will be detected
  177. ; further on (hopefully).
  178. call Process_Num
  179. done_swtch:
  180. clc
  181. ret
  182. err_swtch:
  183. xor bx,cx ; remove this switch from the records
  184. err_check:
  185. stc
  186. ret
  187. ;
  188. ; This routine takes the switch just input, and the number following (if any),
  189. ; and sets the value in the appropriate variable. If the number input is zero
  190. ; then it does nothing - it assumes the default value that is present in the
  191. ; variable at the beginning. Zero is OK for form factor and drive, however.
  192. ;
  193. Process_Num:
  194. test word ptr Switches,cx ; if this switch has been done before,
  195. jnz done_ret ; ignore this one.
  196. test cx,flagdrive
  197. jz try_f
  198. mov byte ptr drive,al
  199. jmp short done_ret
  200. try_f:
  201. test cx,flagff
  202. jz try_t
  203. ; Ensure that we do not get bogus form factors that are not supported
  204. ;cmp al,Max_Dev_Type
  205. ;ja done_ret
  206. mov byte ptr DeviceParameters.DP_DeviceType,al
  207. jmp short done_ret
  208. try_t:
  209. or ax,ax
  210. jz done_ret ; if number entered was 0, assume default value
  211. test cx,flagcyln
  212. jz try_s
  213. mov word ptr DeviceParameters.DP_Cylinders,ax
  214. jmp short done_ret
  215. try_s:
  216. test cx,flagseclim
  217. jz try_h
  218. mov word ptr slim,ax
  219. jmp short done_ret
  220. ;
  221. ; Must be for number of heads
  222. try_h:
  223. mov word ptr hlim,ax
  224. done_ret:
  225. clc
  226. ret
  227. ;
  228. ; SetDeviceParameters sets up the recommended BPB in each BDS in the
  229. ; system based on the form factor. It is assumed that the BPBs for the
  230. ; various form factors are present in the BPBTable. For hard files,
  231. ; the Recommended BPB is the same as the BPB on the drive.
  232. ; No attempt is made to preserve registers since we are going to jump to
  233. ; SYSINIT straight after this routine.
  234. ;
  235. SetDeviceParameters:
  236. push es
  237. push cs
  238. pop es
  239. ASSUME ES:SYSINITSEG
  240. xor bx,bx
  241. mov bl,byte ptr DeviceParameters.DP_DeviceType
  242. cmp bl,DEV_5INCH
  243. jnz Got_80
  244. mov cx,40 ; 48tpi has 40 cylinders
  245. mov word ptr DeviceParameters.DP_Cylinders,cx
  246. Got_80:
  247. shl bx,1 ; get index into BPB table
  248. mov si,offset BPBTable
  249. mov si,word ptr [si+bx] ; get address of BPB
  250. Set_RecBPB:
  251. mov di,offset DeviceParameters.DP_BPB ; es:di -> BPB
  252. mov cx,size a_BPB
  253. cld
  254. repe movsb
  255. pop es
  256. ASSUME ES:NOTHING
  257. test word ptr switches,flagseclim
  258. jz see_heads
  259. mov ax,word ptr slim
  260. mov word ptr DeviceParameters.DP_BPB.BPB_SectorsPerTrack,ax
  261. see_heads:
  262. test word ptr switches,flagheads
  263. jz Set_All_Done
  264. mov ax,word ptr hlim
  265. mov word ptr DeviceParameters.DP_BPB.BPB_Heads,ax
  266. ;
  267. ; We need to set the media byte and the total number of sectors to reflect the
  268. ; number of heads. We do this by multiplying the number of heads by the number
  269. ; of 'sectors per head'. This is not a fool-proof scheme!!
  270. ;
  271. mov cx,ax ; cx has number of heads
  272. dec cl ; get it 0-based
  273. mov ax,DeviceParameters.DP_BPB.BPB_TotalSectors ; this is OK for two heads
  274. sar ax,1 ; ax contains # of sectors/head
  275. sal ax,cl
  276. jc Set_All_Done ; We have too many sectors - overflow!!
  277. mov DeviceParameters.DP_BPB.BPB_TotalSectors,ax
  278. ; Set up correct Media Descriptor Byte
  279. cmp cl,1
  280. mov bl,0F0H
  281. mov al,2 ; AL contains sectors/cluster
  282. ja Got_Correct_Mediad
  283. mov bl,byte ptr DeviceParameters.DP_BPB.BPB_MediaDescriptor
  284. je Got_Correct_Mediad
  285. ; We have one head - OK for 48tpi medium
  286. mov al,1 ; AL contains sectors/cluster
  287. mov ch,DeviceParameters.DP_DeviceType
  288. cmp ch,DEV_5INCH
  289. jz Dec_Mediad
  290. mov bl,0F0H
  291. jmp short Got_Correct_Mediad
  292. Dec_Mediad:
  293. dec bl ; adjust for one head
  294. Got_Correct_Mediad:
  295. mov byte ptr DeviceParameters.DP_BPB.BPB_MediaDescriptor,bl
  296. mov byte ptr DeviceParameters.DP_BPB.BPB_SectorsPerCluster,al
  297. clc
  298. Set_All_Done:
  299. RET
  300. ASSUME DS:NOTHING, ES:NOTHING
  301. NOCHAR1: STC
  302. return
  303. ORGANIZE:
  304. MOV CX,[COUNT]
  305. JCXZ NOCHAR1
  306. CALL MAPCASE
  307. XOR SI,SI
  308. MOV DI,SI
  309. ORG1: CALL GET ;SKIP LEADING CONTROL CHARACTERS
  310. CMP AL,' '
  311. JB ORG1
  312. PUSH CX
  313. PUSH SI
  314. PUSH DI
  315. MOV BP,SI
  316. DEC BP
  317. MOV SI,OFFSET COMTAB ;Prepare to search command table
  318. MOV CH,0
  319. FINDCOM:
  320. MOV DI,BP
  321. MOV CL,[SI]
  322. INC SI
  323. JCXZ NOCOM
  324. REPE CMPSB
  325. LAHF
  326. ADD SI,CX ;Bump to next position without affecting flags
  327. SAHF
  328. LODSB ;Get indicator letter
  329. JNZ FINDCOM
  330. POP DI
  331. POP SI
  332. POP CX
  333. JMP SHORT GOTCOM
  334. NOCOM:
  335. POP DI
  336. POP SI
  337. POP CX
  338. MOV AL,'Z'
  339. GOTCOM: STOSB ;SAVE INDICATOR CHAR IN BUFFER
  340. ORG2: CALL GET2 ;SKIP NAME UNTIL DELIMITER
  341. CALL DELIM ;
  342. JNZ ORG2
  343. ;--------------------------------------------------------------bug330a03
  344. ; - isp
  345. ;* the following two lines in the parsing caused the drivparm line to break
  346. ;* we cannot let the "/" character be counted as a delimiter here.
  347. ; CALL GET ;GET CHARS TO RIGHT OF EQUALS SIGN
  348. ; STOSB
  349. ;--------------------------------------------------------------bug330a03
  350. ;--------------------------------------------------------------bug330a03
  351. ; - isp
  352. ;* the following lines replaced the lines taken out
  353. ORG3: CALL GET2
  354. call delim1
  355. jz ORG3
  356. cmp al,'/'
  357. jz ORG_EXT
  358. stosb
  359. ;--------------------------------------------------------------bug330a03
  360. ORG4: CALL GET2
  361. call delim ; 5/30/86. "device=filename/p..." ;3.30
  362. jz ORG_EXT ; 5/30/86 ;3.30
  363. STOSB
  364. CMP AL,' '
  365. JA ORG4
  366. CMP AL,10
  367. JZ ORG1
  368. MOV BYTE PTR ES:[DI-1],0
  369. ORG5: CALL GET2
  370. STOSB
  371. CMP AL,10
  372. JNZ ORG5
  373. JMP ORG1
  374. ORG_EXT: ;3.30
  375. mov byte ptr es:[di], 0 ;put 0 at DI to make it an ASCIIZ ;3.30
  376. inc DI ; ;3.30
  377. stosb ;and copy the delimeter char. ;3.30
  378. jmp short ORG5 ;and continue as usual. ;3.30
  379. GET2:
  380. JCXZ NOGET
  381. MOV AL,ES:[SI]
  382. INC SI
  383. DEC CX
  384. return
  385. GET: JCXZ NOGET
  386. MOV AL,ES:[SI]
  387. INC SI
  388. DEC CX
  389. CALL DELIM
  390. JZ GET
  391. return
  392. ;--------------------------------------------------------------bug330a03
  393. ; isp - small changes here, new entry point into routine
  394. DELIM:
  395. CMP AL,'/' ; 5/30/86. IBM will assume "/" delim ;3.30
  396. retz ;3.30
  397. DELIM1:
  398. CMP AL,' '
  399. retz
  400. CMP AL,9
  401. retz
  402. CMP AL,'='
  403. retz
  404. CMP AL,','
  405. retz
  406. CMP AL,';'
  407. retz ; 5/23/86 ;3.30
  408. cmp al, 0 ; 5/23/86 Special case for sysinit!!! ;3.30
  409. return
  410. ;--------------------------------------------------------------bug330a03
  411. NOGET: POP CX
  412. MOV COUNT,DI
  413. XOR SI,SI
  414. MOV CHRPTR,SI
  415. return
  416. ;
  417. ; NEWLINE RETURNS WITH FIRST CHARACTER OF NEXT LINE
  418. ;
  419. NEWLINE:invoke GETCHR ;SKIP NON-CONTROL CHARACTERS
  420. retc
  421. CMP AL,10 ;LOOK FOR LINE FEED
  422. JNZ NEWLINE
  423. invoke GETCHR
  424. return
  425. MAPCASE:
  426. PUSH CX
  427. PUSH SI
  428. PUSH DS
  429. PUSH ES
  430. POP DS
  431. XOR SI,SI
  432. CONVLOOP:
  433. LODSB
  434. IF KANJI
  435. CALL TESTKANJ
  436. JZ NORMCONV
  437. INC SI ;Skip next char
  438. DEC CX
  439. JCXZ CONVDONE ;Just ignore 1/2 kanji error
  440. ;Fall through, know AL is not in 'a'-'z' range
  441. NORMCONV:
  442. ENDIF
  443. CMP AL,'a'
  444. JB NOCONV
  445. CMP AL,'z'
  446. JA NOCONV
  447. SUB AL,20H
  448. MOV [SI-1],AL
  449. NOCONV:
  450. LOOP CONVLOOP
  451. CONVDONE:
  452. POP DS
  453. POP SI
  454. POP CX
  455. return
  456. IF KANJI
  457. TESTKANJ:
  458. CMP AL,81H
  459. JB NOTLEAD
  460. CMP AL,9FH
  461. JBE ISLEAD
  462. CMP AL,0E0H
  463. JB NOTLEAD
  464. CMP AL,0FCH
  465. JBE ISLEAD
  466. NOTLEAD:
  467. PUSH AX
  468. XOR AX,AX ;Set zero
  469. POP AX
  470. return
  471. ISLEAD:
  472. PUSH AX
  473. XOR AX,AX ;Set zero
  474. INC AX ;Reset zero
  475. POP AX
  476. return
  477. ENDIF
  478. ASSUME DS:NOTHING
  479. Yes_Break_Failed: ;dev drv Init failed and aborted. ;3.30
  480. stc ;3.30
  481. pop ax ;3.30
  482. return ;3.30
  483. SET_BREAK:
  484. ; 8/14/86 For DOS 3.3, this routine is modified to take care of the ;3.30
  485. ;Device driver's initialization error and abort. ;3.30
  486. ;If [break_addr+2] == [memhi] && [break_addr] = 0 then assume ;3.30
  487. ;that the device driver's initialization has an error and wanted to ;3.30
  488. ;abort the device driver. In this case, this routine will set carry ;3.30
  489. ;and return to the caller. ;3.30
  490. ; ;3.30
  491. PUSH AX
  492. MOV AX,WORD PTR [BREAK_ADDR+2] ;REMOVE THE INIT CODE
  493. cmp ax, [MEMHI] ;3.30
  494. jne Set_Break_Continue ;if not same, then O.K. ;3.30
  495. ;3.30
  496. cmp word ptr [BREAK_ADDR],0 ;3.30
  497. je Yes_Break_failed ;[Break_addr+2]=[MEMHI] & [Break_addr]=0 ;3.30
  498. ;3.30
  499. Set_Break_Continue: ;3.30
  500. MOV [MEMHI],AX
  501. MOV AX,WORD PTR [BREAK_ADDR]
  502. MOV [MEMLO],AX
  503. POP AX ; NOTE FALL THROUGH
  504. ;
  505. ; Round the values in MEMLO and MEMHI to paragraph boundary.
  506. ; Perform bounds check.
  507. ;
  508. ROUND:
  509. PUSH AX
  510. MOV AX,[MEMLO]
  511. invoke ParaRound ; para round up
  512. ADD [MEMHI],AX
  513. MOV [MEMLO],0
  514. mov ax,memhi ; ax = new memhi
  515. CMP AX,[ALLOCLIM] ; if new memhi >= alloclim, error
  516. JAE MEM_ERR
  517. POP AX
  518. clc ;clear carry ;3.30
  519. return
  520. MEM_ERR:
  521. MOV DX,OFFSET BADMEM
  522. PUSH CS
  523. POP DS
  524. CALL PRINT
  525. JMP STALL
  526. CALLDEV:MOV DS,WORD PTR CS:[ENTRY_POINT+2]
  527. ADD BX,WORD PTR CS:[ENTRY_POINT] ;Do a little relocation
  528. MOV AX,DS:[BX]
  529. PUSH WORD PTR CS:[ENTRY_POINT]
  530. MOV WORD PTR CS:[ENTRY_POINT],AX
  531. MOV BX,OFFSET PACKET
  532. CALL [ENTRY_POINT]
  533. POP WORD PTR CS:[ENTRY_POINT]
  534. return
  535. BADNUM:
  536. MOV sepchr,0
  537. XOR AX,AX ; Set Zero flag, and AX = 0
  538. pop bx ; ;3.30
  539. stc ; AND carry set
  540. return
  541. ToDigit:
  542. SUB AL,'0'
  543. JB NotDig
  544. CMP AL,9
  545. JA NotDig
  546. CLC
  547. return
  548. NotDig: STC
  549. return
  550. ; GetNum parses a decimal number.
  551. ; Returns it in AX, sets zero flag if AX = 0 (MAY BE considered an
  552. ; error), if number is BAD carry is set, zero is set, AX=0.
  553. GETNUM: push bx ; ;3.30
  554. XOR BX,BX ; running count is zero
  555. B2: CALL ToDigit ; do we have a digit
  556. JC BadNum ; no, bomb
  557. XCHG AX,BX ; put total in AX
  558. PUSH BX ; save digit
  559. MOV BX,10 ; base of arithmetic
  560. MUL BX ; shift by one decimal di...
  561. POP BX ; get back digit
  562. ADD AL,BL ; get total
  563. ADC AH,0 ; make that 16 bits
  564. JC BADNUM ; too big a number
  565. XCHG AX,BX ; stash total
  566. invoke GETCHR ;GET NEXT DIGIT
  567. JC B1 ; no more characters
  568. cmp al, ' ' ; 5/23/86 space? ;3.30
  569. jz B15 ; 5/23/86 then end of digits ;3.30
  570. cmp al, ',' ; 5/23/86 ',' is a seperator! ;3.30
  571. jz B15 ; 5/23/86 then end of digits. ;3.30
  572. cmp al, 9 ; 5/23/86 TAB ;3.30
  573. jz B15 ; ;3.30
  574. CMP AL,SepChr ; allow , separators
  575. JZ b15
  576. cmp al,SWTCHR ; See if another switch follows
  577. JZ b15
  578. cmp al,10 ; Line-feed?
  579. jz b15
  580. cmp al,13 ; Carriage return?
  581. jz b15
  582. OR AL,AL ; end of line separator?
  583. JNZ B2 ; no, try as a valid char...
  584. b15: INC COUNT ; one more character to s...
  585. DEC CHRPTR ; back up over separator
  586. B1: MOV AX,BX ; get proper count
  587. OR AX,AX ; Clears carry, sets Zero accordingly
  588. pop bx ;3.30
  589. return
  590. SKIP_DELIM proc near ; ;3.30
  591. ;Skip the delimeters pointed by CHRPTR. AL will contain the first non delimete;3.30r
  592. ;character encountered and CHRPTR will point to the next character. ;3.30
  593. ;This rouitne will assume the second "," found as a non delimiter character. So;3.30
  594. ;in case if the string is " , , ", this routine will stop at the second ",". At;3.30
  595. ;this time, Zero flag is set. ;3.30
  596. ;If COUNT is exhausted, then carry will be set. ;3.30
  597. Skip_delim_char: ;3.30
  598. call getchr ;3.30
  599. jc Skip_delim_exit ;3.30
  600. cmp al, ',' ;the first comma? ;3.30
  601. je Skip_delim_next ;3.30
  602. call delim ;check the charater in AL. ;3.30
  603. jz Skip_delim_char ;3.30
  604. jmp short Skip_delim_exit ;found a non delim char ;3.30
  605. Skip_delim_next: ;3.30
  606. call getchr ;3.30
  607. jc Skip_delim_exit ;3.30
  608. cmp al, ',' ;the second comma? ;3.30
  609. je Skip_delim_exit ;done ;3.30
  610. call delim ;3.30
  611. jz Skip_delim_next ;3.30
  612. Skip_delim_exit: ;3.30
  613. return ;3.30
  614. SKIP_DELIM endp ;3.30
  615. ;3.30
  616. ; 5/26/86 *****************************************************************;3.30
  617. SetDOSCountryInfo proc near ;3.30
  618. ;Input: ES:DI -> pointer to DOS_COUNTRY_CDPG_INFO ;3.30
  619. ; DS:0 -> buffer. ;3.30
  620. ; SI = 0 ;3.30
  621. ; AX = country id ;3.30
  622. ; DX = code page id. (If 0, then use ccSysCodePage as a default.) ;3.30
  623. ; BX = file handle ;3.30
  624. ; This routine can handle maxium 72 COUNTRY_DATA entries. ;3.30
  625. ;Output: DOS_country_cdpg_info set. ;3.30
  626. ; Carry set if any file read failure or wrong information in the file. ;3.30
  627. ; Carry set and CX = -1 if cannot find the matching COUNTRY_id, CODEPAGE;3.30
  628. ; _id in the file. ;3.30
  629. ;3.30
  630. push di ;3.30
  631. push ax ;3.30
  632. push dx ;3.30
  633. ;3.30
  634. xor cx,cx ;3.30
  635. xor dx,dx ;3.30
  636. mov ax, 512 ;read 512 bytes ;3.30
  637. call ReadInControlBuffer ;Read the file header ;3.30
  638. jc SetDOSData_fail ;3.30
  639. push es ;3.30
  640. push si ;3.30
  641. push cs ;3.30
  642. pop es ;3.30
  643. mov di, offset COUNTRY_FILE_SIGNATURE ;3.30
  644. mov cx, 8 ;length of the signature ;3.30
  645. repz cmpsb ;3.30
  646. pop si ;3.30
  647. pop es ;3.30
  648. jnz SetDOSData_fail ;signature mismatch ;3.30
  649. ;3.30
  650. add si, 18 ;SI -> county info type ;3.30
  651. cmp byte ptr ds:[si], 1 ;Only accept type 1 (Currently only 1 h;3.30eader type)
  652. jne SetDOSData_fail ;cannot proceed. error return ;3.30
  653. inc si ;SI -> file offset ;3.30
  654. mov dx, word ptr ds:[si] ;Get the INFO file offset. ;3.30
  655. mov cx, word ptr ds:[si+2] ;3.30
  656. mov ax, 1024 ;read 1024 bytes. ;3.30
  657. call ReadInControlBuffer ;Read INFO ;3.30
  658. jc SetDOSData_fail ;3.30
  659. mov cx, word ptr ds:[si] ;get the # of country, codepage combina;3.30tion entries
  660. cmp cx, 72 ;cannot handle more than 72 entries. ;3.30
  661. ja SetDOSData_fail ;3.30
  662. inc si ;3.30
  663. inc si ;SI -> entry information packet ;3.30
  664. pop dx ;restore code page id ;3.30
  665. pop ax ;restore country id ;3.30
  666. pop di ;3.30
  667. ;3.30
  668. SetDOSCntry_find: ;Search for desired country_id,codepage;3.30_id.
  669. cmp ax, word ptr ds:[si+2] ;compare country_id ;3.30
  670. jne SetDOSCntry_next ;3.30
  671. cmp dx, 0 ;No user specified code page ? ;3.30
  672. je SetDOSCntry_any_codepage;then no need to match code page id. ;3.30
  673. cmp dx, word ptr ds:[si+4] ;compare code page id ;3.30
  674. je SetDOSCntry_got_it ;3.30
  675. SetDOSCntry_next: ;3.30
  676. add si, word ptr ds:[si] ;next entry ;3.30
  677. inc si ;3.30
  678. inc si ;take a word for size of entry itself ;3.30
  679. loop SetDOSCntry_find ;3.30
  680. mov cx, -1 ;signals that bad country id entered. ;3.30
  681. SetDOSCntry_fail: ;3.30
  682. stc ;3.30
  683. ret ;3.30
  684. ;3.30
  685. SetDOSData_fail: ;3.30
  686. pop si ;3.30
  687. pop cx ;3.30
  688. pop di ;3.30
  689. jmp short SetDOSCntry_fail ;3.30
  690. ;3.30
  691. SetDOSCntry_any_CodePage: ;use the code_page_id of the country_id;3.30 found.
  692. mov dx, word ptr ds:[si+4] ;3.30
  693. SetDOSCntry_got_it: ;found the matching entry ;3.30
  694. mov cs:CntryCodePage_Id, dx ;save code page ID for this country. ;3.30
  695. mov dx, word ptr ds:[si+10] ;get the file offset of country data ;3.30
  696. mov cx, word ptr ds:[si+12] ;3.30
  697. mov ax, 512 ;read 512 bytes ;3.30
  698. call ReadInControlBuffer ;3.30
  699. jc SetDOSCntry_fail ;3.30
  700. mov cx, word ptr ds:[si] ;get the number of entries to handle. ;3.30
  701. inc si ;3.30
  702. inc si ;SI -> first entry ;3.30
  703. ;3.30
  704. SetDOSCntry_data: ;3.30
  705. push di ;ES:DI -> DOS_COUNTRY_CDPG_INFO ;3.30
  706. push cx ;save # of entry left ;3.30
  707. push si ;si -> current entry in Control buffer ;3.30
  708. ;3.30
  709. mov al, byte ptr ds:[si+2] ;get data entry id ;3.30
  710. call GetCountryDestination ;get the address of destination in ES:D;3.30I
  711. jc SetDOSCntry_data_next ;No matching data entry id in DOS ;3.30
  712. ;3.30
  713. ;3.30
  714. mov dx, word ptr ds:[si+4] ;get offset of data ;3.30
  715. mov cx, word ptr ds:[si+6] ;3.30
  716. mov ax, 4200h ;3.30
  717. stc ;3.30
  718. int 21h ;move pointer ;3.30
  719. jc SetDOSData_fail ;3.30
  720. mov dx, 512 ;start of data buffer ;3.30
  721. mov cx, word ptr es:[di] ;length of the corresponding data in DO;3.30S.
  722. add cx, 10 ;Signature + A word for the length itse;3.30lf
  723. mov ah, 3fh ;3.30
  724. stc ;3.30
  725. int 21h ;read the country.sys data ;3.30
  726. jc SetDOSData_fail ;read failure ;3.30
  727. cmp ax, cx ;3.30
  728. jne SetDOSData_fail ;3.30
  729. ;3.30
  730. mov al, byte ptr ds:[si+2] ;save Data id for future use. ;3.30
  731. mov si, (512+8) ;SI-> data buffer + id tag field ;3.30
  732. mov cx, word ptr ds:[si] ;get the length of the file ;3.30
  733. inc cx ;Take care of a word for lenght of tab ;3.30
  734. inc cx ;itself. ;3.30
  735. cmp cx, (2048 - 512 - 8) ;Fit into the buffer? ;3.30
  736. ja SetDOSData_fail ;3.30
  737. cmp al, SetCountryInfo ;is the data for SetCountryInfo table? ;3.30
  738. jne SetDOSCntry_Mov ;no, don't worry ;3.30
  739. push word ptr es:[di+24] ;Cannot destroy ccMono_ptr address. Sav;3.30e them.
  740. push word ptr es:[di+26] ;3.30
  741. push di ;save DI ;3.30
  742. ;3.30
  743. push ax ;3.30
  744. mov ax,cs:CntryCodePage_Id ;Do not use the Code Page info in Count;3.30ry_Info
  745. mov ds:[si+4], ax ;Use the saved one for this !!!! ;3.30
  746. pop ax ;3.30
  747. ;3.30
  748. SetDOSCntry_Mov: ;3.30
  749. rep movsb ;copy the table into DOS ;3.30
  750. cmp al, SetCountryInfo ;was the ccMono_ptr saved? ;3.30
  751. jne SetDOSCntry_data_next ;3.30
  752. pop di ;restore DI ;3.30
  753. pop word ptr es:[di+26] ;restore ccMono_ptr in DOS. ;3.30
  754. pop word ptr es:[di+24] ;3.30
  755. ;3.30
  756. SetDOSCntry_data_next: ;3.30
  757. pop si ;restore control buffer pointer ;3.30
  758. pop cx ;restore # of entries left ;3.30
  759. pop di ;restore pointer to DSO_COUNTRY_CDPG ;3.30
  760. add si, word ptr ds:[si] ;try to get the next entry ;3.30
  761. inc si ;3.30
  762. inc si ;take a word of entry length itself ;3.30
  763. loop SetDOSCntry_data ;3.30
  764. ret ;3.30
  765. SetDOSCountryInfo endp ;3.30
  766. ; ;3.30
  767. ;3.30
  768. GetCountryDestination proc near ;3.30
  769. ;Get the destination address in the DOS country info table. ;3.30
  770. ;Input: AL - Data ID ;3.30
  771. ; ES:DI -> DOS_COUNTRY_CDPG_INFO ;3.30
  772. ;On return: ;3.30
  773. ; ES:DI -> Destination address of the matching data id ;3.30
  774. ; carry set if no matching data id found in DOS. ;3.30
  775. ;3.30
  776. push cx ;3.30
  777. add di, ccNumber_of_entries ;skip the reserved area, syscodepage et;3.30c.
  778. mov cx, word ptr es:[di] ;get the number of entries ;3.30
  779. inc di ;3.30
  780. inc di ;SI -> the first start entry id ;3.30
  781. GetCntryDest: ;3.30
  782. cmp byte ptr es:[di], al ;3.30
  783. je GetCntryDest_OK ;3.30
  784. cmp byte ptr es:[di], SetCountryInfo ;was it SetCountryInfo entry? ;3.30
  785. je GetCntryDest_1 ;3.30
  786. add di, 5 ;next data id ;3.30
  787. jmp short GetCntryDest_loop ;3.30
  788. GetCntryDest_1: ;3.30
  789. add di, NEW_COUNTRY_SIZE + 3 ;next data id ;3.30
  790. GetCntryDest_loop: ;3.30
  791. loop GetCntryDest ;3.30
  792. stc ;3.30
  793. jmp short GetCntryDest_exit ;3.30
  794. GetCntryDest_OK: ;3.30
  795. cmp al, SetCountryInfo ;select country info? ;3.30
  796. jne GetCntryDest_OK1 ;3.30
  797. inc di ;now DI -> ccCountryInfoLen ;3.30
  798. jmp short GetCntryDest_exit ;3.30
  799. GetCntryDest_OK1: ;3.30
  800. les di, dword ptr es:[di+1] ;get the destination in ES:DI ;3.30
  801. GetCntryDest_Exit: ;3.30
  802. pop cx ;3.30
  803. ret ;3.30
  804. GetCountryDestination endp ;3.30
  805. ;3.30
  806. ; ;3.30
  807. ReadInControlBuffer proc near ;3.30
  808. ;Move file pointer to CX:DX ;3.30
  809. ;Read AX bytes into the control buffer. (Should be less than 2 Kb) ;3.30
  810. ;SI will be set to 0 hence DS:SI points to the control buffer. ;3.30
  811. ;Entry: CX,DX offset from the start of the file where the read/write pointer ;3.30
  812. ; be moved. ;3.30
  813. ; AX - # of bytes to read ;3.30
  814. ; BX - file handle ;3.30
  815. ; DS - buffer seg. ;3.30
  816. ;Return: The control data information is read into DS:0 - DS:0200. ;3.30
  817. ; CX,DX value destroyed. ;3.30
  818. ; Carry set if error in Reading file. ;3.30
  819. ; ;3.30
  820. push ax ;# of bytes to read ;3.30
  821. mov ax, 4200h ;3.30
  822. stc ;3.30
  823. int 21h ;move pointer ;3.30
  824. pop cx ;# of bytes to read ;3.30
  825. jc RICB_exit ;3.30
  826. xor dx,dx ;ds:dx -> control buffer ;3.30
  827. xor si,si ;3.30
  828. mov ah,3fh ;read into the buffer ;3.30
  829. stc ;3.30
  830. int 21h ;should be less than 1024 bytes. ;3.30
  831. RICB_exit: ;3.30
  832. ret ;3.30
  833. ReadInControlBuffer endp ;3.30
  834. ;3.30
  835. ; ;3.30
  836. SET_COUNTRY_PATH proc near ;3.30
  837. ;In: DS - SYSINITSEG, ES - CONFBOT, SI -> start of the asciiz path string ;3.30
  838. ; DOSINFO_EXT, CNTRY_DRV, CNTRY_ROOT, CNTRY_PATH ;3.30
  839. ; Assumes current directory is the ROOT directory. ;3.30
  840. ;Out: DS:DI -> full path (CNTRY_DRV). ;3.30
  841. ; Set the CNTRY_DRV string from the COUNTRY=,,path command. ;3.30
  842. ; DS, ES, SI value saved. ;3.30
  843. ;3.30
  844. push si ;3.30
  845. push ds ;switch ds, es ;3.30
  846. push es ;3.30
  847. pop ds ;3.30
  848. pop es ;now DS -> CONFBOT, ES -> SYSINITSEG ;3.30
  849. ;3.30
  850. call chk_drive_letter ;current DS:[SI] is a drive letter? ;3.30
  851. jc SCP_Default_drv ;no, use current default drive. ;3.30
  852. mov al, byte ptr DS:[SI] ;3.30
  853. inc si ;3.30
  854. inc si ;SI -> next char after ":" ;3.30
  855. jmp short SCP_SetDrv ;3.30
  856. SCP_Default_drv: ;3.30
  857. mov ah, 19h ;3.30
  858. int 21h ;3.30
  859. add al, "A" ;convert it to a character. ;3.30
  860. SCP_SetDrv: ;3.30
  861. mov cs:CNTRY_DRV, al ;set the drive letter. ;3.30
  862. mov di, offset CNTRY_PATH ;3.30
  863. mov al, byte ptr DS:[SI] ;3.30
  864. cmp al, "\" ;3.30
  865. je SCP_Root_Dir ;3.30
  866. cmp al, cs:SWTCHR ;let's accept "/" as an directory delim;3.30
  867. je SCP_Root_Dir ;3.30
  868. jmp short SCP_Path ;3.30
  869. SCP_Root_Dir: ;3.30
  870. dec di ;DI -> CNTRY_ROOT ;3.30
  871. SCP_Path: ;3.30
  872. call MOVE_ASCIIZ ;copy it ;3.30
  873. mov di, offset CNTRY_DRV ;3.30
  874. SCPath_Exit: ;3.30
  875. push ds ;switch ds, es ;3.30
  876. push es ;3.30
  877. pop ds ;3.30
  878. pop es ;DS, ES value restored ;3.30
  879. pop si ;3.30
  880. RET ;3.30
  881. SET_COUNTRY_PATH endp ;3.30
  882. ;3.30
  883. ; ;3.30
  884. CHK_DRIVE_LETTER proc near ;3.30
  885. ;Check if DS:[SI] is a drive letter followed by ":". ;3.30
  886. ;Assume that every alpha charater is already converted to UPPER CASE. ;3.30
  887. ;Carry set if not. ;3.30
  888. ; ;3.30
  889. push ax ;3.30
  890. cmp byte ptr ds:[si], "A" ;3.30
  891. jb CDLetter_NO ;3.30
  892. cmp byte ptr ds:[si], "Z" ;3.30
  893. ja CDLetter_NO ;3.30
  894. cmp byte ptr ds:[si+1], ":" ;3.30
  895. jne CDLetter_NO ;3.30
  896. jmp short CDLetter_exit ;3.30
  897. CDLetter_NO: ;3.30
  898. stc ;3.30
  899. CDLetter_exit: ;3.30
  900. pop ax ;3.30
  901. ret ;3.30
  902. CHK_DRIVE_LETTER endp ;3.30
  903. ;3.30
  904. ; ;3.30
  905. MOVE_ASCIIZ proc near ;3.30
  906. ;In: DS:SI -> source ES:DI -> target ;3.30
  907. ;Out: copy the string until 0. ;3.30
  908. ;Assumes there exists a 0. ;3.30
  909. MASCIIZ_loop: ;3.30
  910. movsb ;3.30
  911. cmp byte ptr DS:[SI-1], 0 ;Was it 0? ;3.30
  912. jne MASCIIZ_loop ;3.30
  913. ret ;3.30
  914. MOVE_ASCIIZ endp ;3.30
  915. ;
  916. ; DS:DX POINTS TO STRING TO OUTPUT (ASCIZ)
  917. ;
  918. ; PRINTS <BADLD_PRE> <STRING> <BADLD_POST>
  919. ;
  920. ;
  921. ;
  922. BADFIL:
  923. PUSH CS
  924. POP ES
  925. MOV SI,DX
  926. BADLOAD:
  927. MOV DX,OFFSET BADLD_PRE ;WANT TO PRINT CONFIG ERROR
  928. MOV BX,OFFSET BADLD_POST
  929. PRNERR:
  930. PUSH CS
  931. POP DS
  932. MOV AH,STD_CON_STRING_OUTPUT
  933. INT 21H
  934. PRN1: MOV DL,ES:[SI]
  935. OR DL,DL
  936. JZ PRN2
  937. MOV AH,STD_CON_OUTPUT
  938. INT 21H
  939. INC SI
  940. JMP PRN1
  941. PRN2: MOV DX,BX
  942. PRINT: MOV AH,STD_CON_STRING_OUTPUT
  943. INT 21H
  944. return
  945. IF NOEXEC
  946. ;
  947. ; LOAD NON EXE FILE CALLED [DS:DX] AT MEMORY LOCATION ES:BX
  948. ;
  949. LDFIL:
  950. PUSH AX
  951. PUSH BX
  952. PUSH CX
  953. PUSH DX
  954. PUSH SI
  955. PUSH DS
  956. PUSH BX
  957. XOR AX,AX ;OPEN THE FILE
  958. MOV AH,OPEN
  959. STC ;IN CASE OF INT 24
  960. INT 21H
  961. POP DX ;Clean stack in case jump
  962. JC LDRET
  963. PUSH DX
  964. MOV BX,AX ;Handle in BX
  965. XOR CX,CX
  966. XOR DX,DX
  967. MOV AX,(LSEEK SHL 8) OR 2
  968. STC ;IN CASE OF INT 24
  969. INT 21H ; Get file size in DX:AX
  970. JC LDCLSP
  971. OR DX,DX
  972. JNZ LDERRP ; File >64K
  973. POP DX
  974. PUSH DX
  975. MOV CX,ES ; CX:DX is xaddr
  976. ADD DX,AX ; Add file size to Xaddr
  977. JNC DOSIZE
  978. ADD CX,1000H ; ripple carry
  979. DOSIZE:
  980. mov ax,dx
  981. call ParaRound
  982. mov dx,ax
  983. ADD CX,DX
  984. CMP CX,[ALLOCLIM]
  985. JB OKLD
  986. JMP MEM_ERR
  987. OKLD:
  988. XOR CX,CX
  989. XOR DX,DX
  990. MOV AX,LSEEK SHL 8 ;Reset pointer to beginning of file
  991. STC ;IN CASE OF INT 24
  992. INT 21H
  993. JC LDCLSP
  994. POP DX
  995. PUSH ES ;READ THE FILE IN
  996. POP DS ;Trans addr is DS:DX
  997. MOV CX,0FF00H ; .COM files arn't any bigger than
  998. ; 64k-100H
  999. MOV AH,READ
  1000. STC ;IN CASE OF INT 24
  1001. INT 21H
  1002. JC LDCLS
  1003. MOV SI,DX ;CHECK FOR EXE FILE
  1004. CMP WORD PTR [SI],"ZM"
  1005. CLC ; Assume OK
  1006. JNZ LDCLS ; Only know how to do .COM files
  1007. STC
  1008. JMP SHORT LDCLS
  1009. LDERRP:
  1010. STC
  1011. LDCLSP:
  1012. POP DX ;Clean stack
  1013. LDCLS:
  1014. PUSHF
  1015. MOV AH,CLOSE ;CLOSE THE FILE
  1016. STC
  1017. INT 21H
  1018. POPF
  1019. LDRET: POP DS
  1020. POP SI
  1021. POP DX
  1022. POP CX
  1023. POP BX
  1024. POP AX
  1025. return
  1026. ENDIF
  1027. ;
  1028. ; OPEN DEVICE POINTED TO BY DX, AL HAS ACCESS CODE
  1029. ; IF UNABLE TO OPEN DO A DEVICE OPEN NULL DEVICE INSTEAD
  1030. ;
  1031. OPEN_DEV:
  1032. CALL OPEN_FILE
  1033. JNC OPEN_DEV3
  1034. OPEN_DEV1:
  1035. MOV DX,OFFSET NULDEV
  1036. CALL OPEN_FILE
  1037. return
  1038. OPEN_DEV3:
  1039. MOV BX,AX ; Handle from open to BX
  1040. XOR AX,AX ; GET DEVICE INFO
  1041. MOV AH,IOCTL
  1042. INT 21H
  1043. TEST DL,10000000B
  1044. retnz
  1045. MOV AH,CLOSE
  1046. INT 21H
  1047. JMP OPEN_DEV1
  1048. OPEN_FILE:
  1049. MOV AH,OPEN
  1050. STC
  1051. INT 21H
  1052. return
  1053. INT24: ADD SP,6 ;RESTORE MACHINE STATE
  1054. POP AX
  1055. POP BX
  1056. POP CX
  1057. POP DX
  1058. POP SI
  1059. POP DI
  1060. POP BP
  1061. POP DS
  1062. POP ES
  1063. PUSH AX
  1064. MOV AH,GET_DEFAULT_DRIVE ;INITIALIZE DOS
  1065. INT 21H
  1066. POP AX
  1067. IRET ;BACK TO USER
  1068. IF ALTVECT
  1069. BOOTMES DB 13,10,"MS-DOS version "
  1070. DB MAJOR_VERSION + "0"
  1071. DB "."
  1072. DB (MINOR_VERSION / 10) + "0"
  1073. DB (MINOR_VERSION MOD 10) + "0"
  1074. DB 13,10
  1075. DB "Copyright 1981,82 Microsoft Corp.",13,10,"$"
  1076. ENDIF
  1077. NULDEV DB "NUL",0
  1078. CONDEV DB "CON",0
  1079. AUXDEV DB "AUX",0
  1080. PRNDEV DB "PRN",0
  1081. CONFIG DB "\CONFIG.SYS",0
  1082. CNTRY_DRV DB "A:" ;3.30
  1083. CNTRY_ROOT DB "\" ;3.30
  1084. CNTRY_PATH DB "COUNTRY.SYS",0 ;3.30
  1085. DB 52 DUP (0) ;3.30
  1086. ;3.30
  1087. COUNTRY_FILE_SIGNATURE db 0FFh,'COUNTRY' ;3.30
  1088. ;3.30
  1089. CntryCodePage_Id DW ? ;3.30
  1090. COMMND DB "\COMMAND.COM",0
  1091. DB 20 dup (0) ;3.30
  1092. COMTAB LABEL BYTE
  1093. ;;;; DB 8,"AVAILDEV",'A' ; NO LONGER SUPPORTED
  1094. DB 7,"BUFFERS", 'B'
  1095. DB 5,"BREAK", 'C'
  1096. DB 6,"DEVICE", 'D'
  1097. DB 5,"FILES", 'F'
  1098. DB 4,"FCBS", 'X'
  1099. DB 9,"LASTDRIVE",'L'
  1100. DB 8,"DRIVPARM", 'P' ; RS for DOS 3.2
  1101. IF STACKSW ;3.30
  1102. DB 6,"STACKS", 'K' ; BAS for DOS 3.2 ;3.30
  1103. ENDIF ;3.30
  1104. DB 7,"COUNTRY", 'Q'
  1105. DB 5,"SHELL", 'S'
  1106. ;;;; DB 8,"SWITCHAR",'W' ; NO LONGER SUPPORTED
  1107. DB 0
  1108. public DeviceParameters
  1109. DeviceParameters a_DeviceParameters <0,DEV_3INCH720KB,0,80>
  1110. hlim dw 2
  1111. slim dw 9
  1112. public drive
  1113. drive db ?
  1114. public switches
  1115. Switches dw ?
  1116. ;
  1117. ; The following are the recommended BPBs for the media that we know of so
  1118. ; far.
  1119. ; 48 tpi diskettes
  1120. BPB48T DW 512
  1121. DB 2
  1122. DW 1
  1123. DB 2
  1124. DW 112
  1125. DW 2*9*40
  1126. DB 0FDH
  1127. DW 2
  1128. DW 9
  1129. DW 2
  1130. Dd 0 ;hidden sectors - sp
  1131. Dd 0 ;big total sectors - sp
  1132. DB 6 DUP(?) ;reserved - sp
  1133. ; 96tpi diskettes
  1134. BPB96T DW 512
  1135. DB 1
  1136. DW 1
  1137. DB 2
  1138. DW 224
  1139. DW 2*15*80
  1140. DB 0f9H
  1141. DW 7
  1142. DW 15
  1143. DW 2
  1144. Dd 0 ;hidden sectors - sp
  1145. Dd 0 ;big total sectors - sp
  1146. DB 6 DUP(?) ;reserved - sp
  1147. ; 3 1/2 inch diskette BPB
  1148. BPB35 DW 512
  1149. DB 2
  1150. DW 1 ; Double sided with 9 sec/trk
  1151. DB 2
  1152. DW 70h
  1153. DW 2*9*80
  1154. DB 0f9H
  1155. DW 3
  1156. DW 9
  1157. DW 2
  1158. Dd 0 ;hidden sectors - sp
  1159. Dd 0 ;big total sectors - sp
  1160. DB 6 DUP(?) ;reserved - sp
  1161. BPBTable dw BPB48T ; 48tpi drives
  1162. dw BPB96T ; 96tpi drives
  1163. dw BPB35 ; 3.5" drives
  1164. ; The following are not supported, so default to 3.5" media layout
  1165. dw BPB35 ; Not used - 8" drives
  1166. dw BPB35 ; Not Used - 8" drives
  1167. dw BPB35 ; Not Used - hard files
  1168. dw BPB35 ; Not Used - tape drives
  1169. dw BPB35 ; Not Used - Other
  1170. switchlist db 7,"FHSTDCN" ; Preserve the positions of N and C.
  1171. ; The following depend on the positions of the various letters in SwitchList
  1172. flagdrive equ 0004H
  1173. flagcyln equ 0008H
  1174. flagseclim equ 0010H
  1175. flagheads equ 0020H
  1176. flagff equ 0040H
  1177. SWTCHR EQU "/" ; switch follows this character
  1178. SYSINITSEG ENDS
  1179. END