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.

882 lines
20 KiB

4 years ago
  1. ;
  2. ; After the boot sector reads in msbio it jumps to this location. Msbio
  3. ; immediately jumps to initialization code in msinit.
  4. ;
  5. EXTRN INIT:NEAR
  6. Public START$
  7. START$:
  8. JMP INIT ; START$ patch by init to point to
  9. ; hdrive BPB
  10. PATHSTART 001,BIO
  11. ;----------------------------------------------------------------------------
  12. ;
  13. ; Command Jump Tables
  14. ;
  15. ; These tables hold the entry points for the various service routines
  16. ; for the different drivers. The index in the table is the command code for
  17. ; that funcion plus two. For example the command code for Read (input) is 4,
  18. ; The 6th (4 plus 2) entry in the table DSKTBL is DSK$READ - the command to
  19. ; read a disk. Commands which do not exist for a device are filled with
  20. ; exit (e.g. MediaCheck for CONTBL). The first entry in the table is the
  21. ; largest command code implemented for that device. This value is used
  22. ; for error checking. If new command codes are added then the first entry
  23. ; in the table must be incremented.
  24. ;
  25. ; BEWARE - These tables overlap somewhat! -c.p.
  26. ;
  27. ;
  28. ; Disk:
  29. ;
  30. ODD
  31. DSKTBL LABEL BYTE
  32. DB 24 ; This is the size of the table YUK!!!!
  33. DW DSK$INIT ; Code 0: INIT
  34. DW MEDIA$CHK ; code 1: Media Check
  35. DW GET$BPB ; code 2: BUILD BPB
  36. DW CMDERR ; code 3: IOCTL input
  37. DW DSK$READ ; code 4: INPUT
  38. DW BUS$EXIT ; code 5: NONDESTRUCITVE INPUT, NO WAIT
  39. DW EXIT ; code 6: INPUT STATUS
  40. DW EXIT ; code 7: INPUT FLUSH
  41. DW DSK$WRIT ; code 8: OUTPUT
  42. DW DSK$WRITV ; code 9: OUTPUT with verify
  43. DW EXIT ; code 10: OUTPUT STATUS
  44. DW EXIT ; code 11: OUTPUT FLUSH
  45. DW CMDERR ; code 12: IOCTL output
  46. Public TABLE_PATCH
  47. TABLE_PATCH LABEL WORD ;ARR 2.42
  48. DW DSK$OPEN ; code 13: DEVICE OPEN
  49. DW DSK$CLOSE ; code 14: DEVICE CLOSE
  50. DW DSK$REM ; code 15: REMOVABLE MEDIA
  51. dw exit
  52. dw exit
  53. dw exit
  54. DW GENERIC$IOCTL
  55. dw exit
  56. dw exit
  57. dw exit
  58. dw IOCTL$GETOWN
  59. dw IOCTL$SETOWN
  60. ;
  61. ; Console:
  62. ;
  63. ODD
  64. CONTBL LABEL BYTE
  65. DB 10
  66. DW EXIT
  67. DW EXIT
  68. DW EXIT
  69. DW CMDERR
  70. DW CON$READ
  71. DW CON$RDND
  72. DW EXIT
  73. DW CON$FLSH
  74. DW CON$WRIT
  75. DW CON$WRIT
  76. DW EXIT
  77. ;
  78. ; Auxilary:
  79. ;
  80. ODD
  81. AUXTBL LABEL BYTE
  82. DB 10
  83. DW EXIT
  84. DW EXIT
  85. DW EXIT
  86. DW CMDERR
  87. DW AUX$READ
  88. DW AUX$RDND
  89. DW EXIT
  90. DW AUX$FLSH
  91. DW AUX$WRIT
  92. DW AUX$WRIT
  93. DW AUX$WRST
  94. ;
  95. ; Clock:
  96. ;
  97. ODD
  98. TIMTBL LABEL BYTE
  99. DB 9
  100. DW EXIT
  101. DW EXIT
  102. DW EXIT
  103. DW CMDERR
  104. DW TIM$READ
  105. DW BUS$EXIT
  106. DW EXIT
  107. DW EXIT
  108. DW TIM$WRIT
  109. DW TIM$WRIT
  110. ;
  111. ; Printer:
  112. ;
  113. ODD
  114. PRNTBL LABEL BYTE
  115. DB 24
  116. DW EXIT ;INIT
  117. DW EXIT
  118. DW EXIT
  119. DW CMDERR
  120. DW EXIT$ZER ;INDICATE ZERO CHARS READ
  121. DW BUS$EXIT
  122. DW EXIT
  123. DW EXIT
  124. DW PRN$WRIT
  125. DW PRN$WRIT
  126. DW PRN$STAT
  127. DW EXIT
  128. DW EXIT
  129. DW EXIT
  130. DW EXIT
  131. DW EXIT
  132. DW PRN$TilBusy
  133. DW EXIT
  134. DW EXIT
  135. DW PRN$GenIOCTL
  136. dw exit
  137. dw exit
  138. dw exit
  139. dw CMDERR
  140. dw CMDERR
  141. EVENB
  142. Public Old13
  143. OLD13 label DWORD
  144. db '5986' ;Code for 3.30
  145. Public Orig13
  146. ORIG13 label DWORD
  147. db '21',0,0 ;Code for 3.30
  148. ;
  149. ; PTRSAV - pointer save
  150. ;
  151. ; This variable holds the pointer to the Request Header passed by a
  152. ; program wishing to use a device driver. When the strategy routine is
  153. ; called it puts the address of the Request header in this variable and
  154. ; returns.
  155. ;
  156. EVENB
  157. PUBLIC PTRSAV
  158. PTRSAV DD 0
  159. ;
  160. ; Buffer for the AUX device driver
  161. ;
  162. ;;Rev 3.30 Modification
  163. PUBLIC AUXBUF
  164. AUXBUF DB 0,0,0,0 ;SET OF 1 BYTE BUFFERS FOR COM 1,2,3, AND 4
  165. EVENB
  166. PUBLIC PREVOPER,NUMBER_OF_SEC
  167. ;;End of Modification
  168. PrevOper DW ? ; Holds ROM DISK INT request (i.e. Register AX).
  169. Number_Of_Sec DB ? ; Holds number of sectors to read on an ECC error
  170. ;;Rev 3.30 Modification
  171. IF ($-CODE) GT 100H
  172. %OUT VDISK BUFFER NOT CORRECTLY LOCATED
  173. ELSE
  174. ORG 100H
  175. ENDIF
  176. PUBLIC VDISK_AREA
  177. VDISK_AREA DB 108 DUP(0) ;FOR USE BY VDISK
  178. ;;End of Modification
  179. ;
  180. ; AUXNUM holds the number of the printer or AUX device requested. For
  181. ; example if printer 2 was called (PRN2$IN) AUXNUM is set to be one; with
  182. ; line printer 3 AUXNUM is set to 2. With this set the printer device driver
  183. ; can tell which printer to command applies to.
  184. ;
  185. ; WARNING!!! These are addressed together in GETDX
  186. ;
  187. EVENB
  188. AUXNUM DB 0
  189. DB 0
  190. ;
  191. ; Device Header for the CON Device Driver
  192. ;
  193. EVENB
  194. PUBLIC CONHeader
  195. CONHeader LABEL WORD
  196. DD AUXDEV2
  197. DW 1000000000010011B ; Con in and con out + special
  198. DW STRATEGY ; Strategy entry point
  199. DW CON$IN ; interrupt entry point
  200. DB 'CON ' ; device name
  201. ;
  202. ; Device Header for device "AUX"
  203. ;
  204. EVENB
  205. PUBLIC AUXDEV2
  206. AUXDEV2 LABEL WORD ;HEADER FOR DEVICE "AUX"
  207. DD PRNDEV2
  208. DW 1000000000000000B ; attribute word, character device
  209. DW STRATEGY ; device strategy routine
  210. DW AUX0$IN ; device interrupt routine
  211. DB 'AUX ' ; device name
  212. ;
  213. ; Device Header for device PRN
  214. ;
  215. EVENB
  216. PUBLIC PRNDEV2
  217. PRNDEV2 LABEL WORD ;HEADER FOR DEVICE "PRN"
  218. DD TIMDEV
  219. DW CharDev + OutTilBusy + Dev320
  220. DW STRATEGY
  221. DW PRN0$IN
  222. DB 'PRN '
  223. ;
  224. ; Device Header for device CLOCK$
  225. ;
  226. EVENB
  227. PUBLIC TIMDEV
  228. TIMDEV LABEL WORD
  229. DD DSKDEV
  230. DW 1000000000001000B
  231. DW STRATEGY
  232. DW TIM$IN
  233. DB 'CLOCK$ '
  234. ;
  235. ; Device Header for disk devices
  236. ;
  237. ; Device attribute bits:
  238. ; Bit 6 - DOS 3.2 Bit
  239. ;
  240. EVENB
  241. PUBLIC DSKDEV
  242. DSKDEV LABEL WORD
  243. DD COM1DEV
  244. DW 0000100001000000B ; DOS 3.2
  245. DW STRATEGY ; strategy routine
  246. DW DSK$IN ; Interrupt entry point
  247. ;
  248. ; maximum number of drives
  249. ;
  250. DRVMAX DB 4
  251. Public DRVMAX
  252. ;
  253. ; Last drive accessed
  254. ;
  255. PUBLIC STEP_DRV
  256. STEP_DRV DB -2 ; ARR 2.20 LAST DRIVE ACCESSED
  257. Public Phys_Drv
  258. Phys_Drv DB 0 ; Used by setdrvie for getting
  259. ; BDS for logical drive, or physical
  260. ; drive. 0 => use logical
  261. ; 1 => use physical
  262. Public fHave96
  263. fHave96 DB 0 ; Flag to indicate presence of
  264. ; 96tpi support
  265. Public Single
  266. Single DB 0 ; Used to detect single drive systems
  267. Public fHaveK09
  268. fHaveK09 DB 0 ;Indicates if this is a K09 or not
  269. ; used by console driver.
  270. Public NEW_ROM
  271. NEW_ROM DB 0 ;Set to 1 if we have a ROM that can
  272. ; handle strange media layouts.
  273. PUBLIC FSETOWNER
  274. fSetOwner db ? ;=1 if we are setting the owner of a
  275. ;drive. (Examined by CheckSingle).
  276. public Secrete_Code
  277. Secrete_Code dw 'jk' ;Code for 3.30.
  278. ;
  279. ; Device Header for device "COM1"
  280. ;
  281. EVENB
  282. Public COM1DEV
  283. COM1DEV LABEL WORD
  284. DD LPT1DEV
  285. DW 1000000000000000B ; attribute word, character device
  286. DW STRATEGY ; device strategy routine
  287. DW AUX0$IN ; device interrupt routine
  288. DB 'COM1 ' ; device name
  289. ;
  290. ; Device Header for device LPT1
  291. ;
  292. EVENB
  293. Public LPT1DEV
  294. LPT1DEV LABEL WORD
  295. DD LPT2DEV
  296. DW CharDev + OutTilBusy + Dev320
  297. DW STRATEGY
  298. DW PRN1$IN
  299. DB 'LPT1 '
  300. ;
  301. ; Device Header for device LPT2
  302. ;
  303. EVENB
  304. Public Lpt2Dev
  305. LPT2DEV LABEL WORD
  306. DD LPT3DEV
  307. DW CharDev + OutTilBusy + Dev320
  308. DW STRATEGY
  309. DW PRN2$IN
  310. DB 'LPT2 '
  311. ;
  312. ; Device Header for device LPT3
  313. ;
  314. EVENB
  315. Public Lpt3Dev
  316. LPT3DEV LABEL WORD
  317. DD COM2DEV
  318. DW CharDev + OutTilBusy + Dev320
  319. DW STRATEGY
  320. DW PRN3$IN
  321. DB 'LPT3 '
  322. ;
  323. ; Device Header for device "COM2"
  324. ;
  325. EVENB
  326. Public Com2Dev
  327. COM2DEV LABEL WORD
  328. dd COM3DEV
  329. DW 1000000000000000B ; attribute word, character device
  330. DW STRATEGY ; device strategy routine
  331. DW AUX1$IN ; device interrupt routine
  332. DB 'COM2 ' ; device name
  333. ;;Rev 3.30 Modification
  334. ;
  335. ; Device header for device "COM3"
  336. ;
  337. EVENB
  338. PUBLIC COM3DEV
  339. COM3DEV LABEL WORD
  340. dd COM4DEV
  341. dw 1000000000000000b ; character device attribute
  342. dw STRATEGY
  343. dw AUX2$IN ; com3 == aux2
  344. db 'COM3 '
  345. ;
  346. ; Device header for device "COM4"
  347. ;
  348. EVENB
  349. PUBLIC COM4DEV
  350. COM4DEV LABEL WORD
  351. dw -1,CODE
  352. dw 1000000000000000b ; character device attribute
  353. dw STRATEGY
  354. dw AUX3$IN ; com4 == aux3
  355. db 'COM4 '
  356. ;;End of Modification
  357. ; Hard-wire the link to the next Int2f handler.
  358. ;;Rev 3.30 Modification
  359. EVENB
  360. PUBLIC Next2f_13
  361. NEXT2F_13 LABEL WORD
  362. EXTRN INT2F_DISK:FAR ;MSBIO2
  363. DD INT2F_DISK
  364. ;
  365. ; Start of linked list of BDS's
  366. ;
  367. EVENB
  368. Public Start_BDS
  369. START_BDS LABEL WORD
  370. DD BDS1 ;START OF BDS LINKED LIST.
  371. ;;End of Modification
  372. ;
  373. ; Some floppy drives do not have changeline support. The result is a
  374. ; large amount of inefficiency in the code. A media-check always returns
  375. ; "I don`t know". This cause DOS to reread the FAT on every access and
  376. ; always discard any cached data.
  377. ; We get around this inefficiency by implementing a "Logical Door Latch".
  378. ; The following three items are used to do this. The logical door latch is
  379. ; based on the premise that it is not physically possible to change floppy
  380. ; disks in a drive in under two seconds (most people take about 10). The
  381. ; logical door latch is implemented by saving the time of the last successful
  382. ; disk operation (in the value TIM_DRV). When a new request is made the
  383. ; current time is compared to the saved time. If less than two seconds have
  384. ; passed then the value "No Change" is returned. If more than two seconds
  385. ; have passed the value "Don't Know" is returned.
  386. ; There is one complecation to this algorithm. Some programs change the
  387. ; value of the timer. In this unfortunate case we have an invalid timer.
  388. ; This possiblity is detected by counting the number of disk operations
  389. ; which occur without any time passing. If this count exceeds the value of
  390. ; "AccessMax" we assume the counter is invalid and always return "Don't
  391. ; Know". The variable "AccessCount" is used to keep track of the number
  392. ; of disk operation which occur without the time changing.
  393. ;
  394. PUBLIC ACCESSCOUNT
  395. AccessCount db 0 ; number of times media check called
  396. PUBLIC TIM_DRV
  397. TIM_DRV DB -1 ; time when last disk I/O was performed
  398. PUBLIC FLAGBITS
  399. FlagBits dw 0 ; Bits to set in flag field when doing
  400. ; a Set_Changed_DL
  401. PUBLIC MEDBYT
  402. MedByt DB ? ; hold media byte from floppy
  403. EVENB
  404. PUBLIC WRTVERIFY
  405. WRTVERIFY LABEL WORD
  406. PUBLIC RFLAG
  407. RFLAG DB ROMRead ;2 for read, 3 for write
  408. VERIFY DB 0 ;1 if verify after write
  409. PUBLIC SECCNT
  410. SECCNT DW 0
  411. Public HARDNUM
  412. HARDNUM DB 99 ;logical drive number of first hardfile
  413. ;
  414. ; Some of the older versions of the IBM rom-bios always assumed a seek would
  415. ; have to be made to read the diskette. Consequently a large head settle
  416. ; time was always used in the I/O operations. To get around this problem
  417. ; we need to continually adjust the head settle time. The following
  418. ; algorithm is used:
  419. ;
  420. ; Get the current head settle value.
  421. ; If it is 1, then
  422. ; set slow = 15
  423. ; else
  424. ; set slow = value
  425. ; ...
  426. ; if we are seeking and writing then
  427. ; use slow
  428. ; else
  429. ; use fast
  430. ; ...
  431. ; restore current head settle value
  432. ;
  433. PUBLIC MOTORSTARTUP,SETTLECURRENT,SETTLESLOW
  434. MotorStartup db ? ; value from table
  435. SettleCurrent db ? ; value from table
  436. SettleSlow db ? ; slow settle value
  437. NextSpeed DB ? ; value of speed to be used
  438. public save_head_sttl
  439. Save_head_sttl db ? ;used by READ_SECTOR routine
  440. Public EOT
  441. EOT DB 9
  442. ;
  443. ; pointer to Disk Parameter Table
  444. ;
  445. EVENB
  446. PUBLIC DPT
  447. DPT DD ?
  448. ;
  449. ; The following two sets of variables are used to hold values for
  450. ; disk I/O operations
  451. ; Keep the next two items contiguous - see IOCTL_Block for reason
  452. PUBLIC CURSEC,CURHD,CURTRK,SPSAV
  453. CURSEC DB 0 ; current sector
  454. CURHD DB 0 ; current head
  455. CURTRK DW 0 ; current track
  456. SPSAV DW 0 ; save the stack pointer
  457. ;
  458. ; The following are used for IOCTL function calls
  459. ;
  460. PUBLIC FORMT_EOT,HDNUM,TRKNUM,GAP_PATCH
  461. FORMT_EOT DB 8 ; EOT used for format
  462. HDNUM DB 0 ; Head number
  463. TRKNUM DW 0 ; Track being manipulated
  464. GAP_PATCH DB 50h ; Format gap patched into DPT
  465. ;
  466. ; Disk errors returned from the IBM rom
  467. ;
  468. Public ERRIN
  469. ERRIN LABEL BYTE
  470. DB 80H ; no response
  471. DB 40H ; seek failure
  472. DB 10H ; bad CRC
  473. DB 8 ; DMA overrun
  474. DB 6 ; media change
  475. DB 4 ; sector not found
  476. DB 3 ; write attempt to write-protect disk
  477. PUBLIC LSTERR
  478. LSTERR DB 0 ; all other errors
  479. ;
  480. ; returned error code corresponding to above errors
  481. ;
  482. Public ERROUT
  483. ERROUT LABEL BYTE
  484. DB 2 ; no response
  485. DB 6 ; seek failure
  486. DB 4 ; bad CRC
  487. DB 4 ; DMA overrun
  488. DB 15 ; invalid media change
  489. DB 8 ; sector not found
  490. DB 0 ; write attempt on write-protect disk
  491. DB 12 ; general error
  492. PUBLIC NUMERR
  493. NUMERR = ERROUT-ERRIN
  494. ;-------------------------------------------------------------
  495. ;
  496. ; DiskSector is a 512 byte sector into which the boot sector
  497. ; is read. It is also used as read sector for DMA check for
  498. ; hard disk.
  499. Public DiskSector
  500. DiskSector db 11 dup(?) ; take care of 3 jump bytes plus OEM name.
  501. PUBLIC BPB_IN_SECTOR
  502. BPB_In_Sector dw ?
  503. PUBLIC SECPERCLUSINSECTOR
  504. SECPERCLUSINSECTOR DB ?
  505. dw ?
  506. db ?
  507. dw ?
  508. dw ?
  509. PUBLIC MEDIABYTE
  510. mediabyte db ?
  511. dw ?
  512. dw ?
  513. dw ?
  514. dw ?
  515. db ?
  516. db 512-($-DiskSector) dup (?)
  517. ;---------------------------------------------------------------------
  518. ;
  519. ; The "BDS"'s contain information for each drive in the system.
  520. ; There is one BDS for each logical drvie in the system. The BDS's
  521. ; are all linked together in a chain. The BDS contain various values
  522. ; important to the disk drive. Various values are updated whenever actions
  523. ; are performed. For example if a drive is read from the last time
  524. ; accessed fields are updated to the current time.
  525. ; Initial values:
  526. ; * Sectors/Alloc. unit in BPB initially set to -1 to signify that
  527. ; the BPB has not been filled.
  528. ; * Link is set to -1 to signify end of list.
  529. ; * number of cylinders in MaxParms initialized to -1 to indicate
  530. ; that the parameters have not been set.
  531. ;
  532. ; Start_BDS contains a pointer to the first BDS. It is through this
  533. ; pointer that routines find particular BDS (see SetDrive to see how
  534. ; this is done).
  535. ;
  536. EVENB
  537. BDS1 LABEL WORD
  538. DD BDS2 ;LINK TO NEXT STRUCTURE
  539. DB 0 ;ROM DISK INT Drive Number
  540. DB 0 ;Logical Drive Letter
  541. PUBLIC FDRIVE1
  542. FDRIVE1 DW 512 ;Physical sector size in bytes
  543. DB -1 ;Sectors/allocation unit
  544. DW 1 ;Reserved sectors for DOS
  545. DB 2 ;No. allocation tables
  546. DW 64 ;Number directory entries
  547. DW 9*40 ;Number sectors (at 512 bytes ea.)
  548. DB 00000000B ;Media descriptor, initially 00H.
  549. DW 2 ;Number of FAT sectors
  550. DW 9 ;Sector limit
  551. DW 1 ;Head limit
  552. DW 0 ;Hidden sector count
  553. DB 0 ; TRUE => Large fats
  554. OPCNT1 DW 0 ;Open Ref. Count
  555. VOLID1 DB "NO NAME ",0 ;Volume ID for this disk
  556. DB 3 ;Form Factor
  557. FLAGS1 DW 0020H ;Various Flags
  558. ; DB 9 dup (0) ;Reserved for future use
  559. dw 40 ; number of cylinders
  560. RecBPB1 DW 512 ;Physical sector size in bytes
  561. DB 1 ;Sectors/allocation unit
  562. DW 1 ;Reserved sectors for DOS
  563. DB 2 ;No. allocation tables
  564. DW 0E0H ;NUMBER DIRECTORY ENTRIES
  565. DW 9*40 ;Number sectors (at 512 bytes ea.)
  566. DB 0F0h ;Media descriptor, initially 00H.
  567. DW 2 ;Number of FAT sectors
  568. DW 9 ;Sector limit
  569. DW 2 ;HEAD LIMIT
  570. DW 0 ;Hidden sector count
  571. DB 12 DUP (?)
  572. TRACK1 DB -1 ;Last track accessed on this drive
  573. TIM_LO1 DW -1 ;Keep these two contiguous (?)
  574. TIM_HI1 DW -1
  575. EVENB
  576. BDS2 LABEL WORD
  577. DD BDS3 ;LINK TO NEXT STRUCTURE
  578. DB 0 ;INT 13 DRIVE NUMBER
  579. DB 0 ;Logical Drive Letter
  580. PUBLIC FDRIVE2
  581. FDRIVE2 DW 512 ;Physical sector size in bytes
  582. DB -1 ;Sectors/allocation unit
  583. DW 1 ;Reserved sectors for DOS
  584. DB 2 ;No. allocation tables
  585. DW 64 ;Number directory entries
  586. DW 9*40 ;Number sectors (at 512 bytes ea.)
  587. DB 00000000B ;Media descriptor, initially 00H.
  588. DW 2 ;Number of FAT sectors
  589. DW 9 ;Sector limit
  590. DW 1 ;Head limit
  591. DW 0 ;Hidden sector count
  592. DB 0 ; TRUE => Large fats
  593. OPCNT2 DW 0 ;Open Ref. Count
  594. VOLID2 DB "NO NAME ",0 ;Volume ID for this disk
  595. DB 3 ;Form Factor
  596. FLAGS2 DW 0020H ;Various Flags
  597. ; DB 9 dup (0) ;Reserved for future use
  598. dw 40 ; number of cylinders
  599. RecBPB2 DW 512 ;Physical sector size in bytes
  600. DB 1 ;Sectors/allocation unit
  601. DW 1 ;Reserved sectors for DOS
  602. DB 2 ;No. allocation tables
  603. DW 0E0H ;NUMBER DIRECTORY ENTRIES
  604. DW 9*40 ;Number sectors (at 512 bytes ea.)
  605. DB 0F0h ;Media descriptor, initially 00H.
  606. DW 2 ;Number of FAT sectors
  607. DW 9 ;Sector limit
  608. DW 2 ;HEAD LIMIT
  609. DW 0 ;Hidden sector count
  610. DB 12 DUP (?)
  611. TRACK2 DB -1 ;Last track accessed on this drive
  612. TIM_LO2 DW -1 ;Keep these two contiguous (?)
  613. TIM_HI2 DW -1
  614. EVENB
  615. BDS3 LABEL WORD
  616. DD BDS4 ;LINK TO NEXT STRUCTURE
  617. DB 0 ;INT 13 DRIVE NUMBER
  618. DB 0 ;Logical Drive Letter
  619. PUBLIC FDRIVE3
  620. FDRIVE3 DW 512 ;Physical sector size in bytes
  621. DB -1 ;Sectors/allocation unit
  622. DW 1 ;Reserved sectors for DOS
  623. DB 2 ;No. allocation tables
  624. DW 64 ;Number directory entries
  625. DW 9*40 ;Number sectors (at 512 bytes ea.)
  626. DB 00000000B ;Media descriptor, initially 00H.
  627. DW 2 ;Number of FAT sectors
  628. DW 9 ;Sector limit
  629. DW 1 ;Head limit
  630. DW 0 ;Hidden sector count
  631. DB 0 ; TRUE => Large fats
  632. OPCNT3 DW 0 ;Open Ref. Count
  633. VOLID3 DB "NO NAME ",0 ;Volume ID for this disk
  634. DB 3 ;Form Factor
  635. FLAGS3 DW 0020H ;Various Flags
  636. ; DB 9 dup (0) ;Reserved for future use
  637. dw 40 ; number of cylinders
  638. RecBPB3 DW 512 ;Physical sector size in bytes
  639. DB 1 ;Sectors/allocation unit
  640. DW 1 ;Reserved sectors for DOS
  641. DB 2 ;No. allocation tables
  642. DW 0E0H ;NUMBER DIRECTORY ENTRIES
  643. DW 9*40 ;Number sectors (at 512 bytes ea.)
  644. DB 0F0h ;Media descriptor, initially 00H.
  645. DW 2 ;Number of FAT sectors
  646. DW 9 ;Sector limit
  647. DW 2 ;HEAD LIMIT
  648. DW 0 ;Hidden sector count
  649. DB 12 DUP (?)
  650. TRACK3 DB -1 ;Last track accessed on this drive
  651. TIM_LO3 DW -1 ;Keep these two contiguous (?)
  652. TIM_HI3 DW -1
  653. EVENB
  654. BDS4 LABEL WORD
  655. DW -1 ;Link to next structure
  656. DW Code
  657. DB 0 ;INT 13 DRIVE NUMBER
  658. DB 0 ;Logical Drive Letter
  659. PUBLIC FDRIVE4
  660. FDRIVE4 DW 512 ;Physical sector size in bytes
  661. DB -1 ;Sectors/allocation unit
  662. DW 1 ;Reserved sectors for DOS
  663. DB 2 ;No. allocation tables
  664. DW 64 ;Number directory entries
  665. DW 9*40 ;Number sectors (at 512 bytes ea.)
  666. DB 00000000B ;Media descriptor, initially 00H.
  667. DW 2 ;Number of FAT sectors
  668. DW 9 ;Sector limit
  669. DW 1 ;Head limit
  670. DW 0 ;Hidden sector count
  671. DB 0 ; TRUE => Large fats
  672. OPCNT4 DW 0 ;Open Ref. Count
  673. VOLID4 DB "NO NAME ",0 ;Volume ID for this disk
  674. DB 3 ;Form Factor
  675. FLAGS4 DW 0020H ;Various Flags
  676. ; DB 9 dup (0) ;Reserved for future use
  677. dw 40 ; number of cylinders
  678. ;;Rev 3.30 Modification
  679. RECBPB4 DW 512 ;BYTES PER SECTOR
  680. DB 1 ;SECTORS/ALLOCATION UNIT
  681. DW 1 ;RESERVED SECTORS FOR DOS
  682. DB 2 ;NO. ALLOCATION TABLES
  683. DW 0E0H ;NUMBER DIRECTORY ENTRIES
  684. DW 9*40 ;NUMBER SECTORS (AT 512 BYTES EA.)
  685. DB 0F0H ;MEDIA DESCRIPTOR, INITIALLY F0H.
  686. DW 2 ;NUMBER OF FAT SECTORS
  687. DW 9 ;SECTOR LIMIT
  688. DW 2 ;HEAD LIMIT
  689. DW 0 ;HIDDEN SECTOR COUNT
  690. DB 12 DUP (?)
  691. ;;End of Modification
  692. TRACK4 DB -1 ;Last track accessed on this drive
  693. TIM_LO4 DW -1 ;Keep these two contiguous (?)
  694. TIM_HI4 DW -1
  695. bpbType struc
  696. spf db ?
  697. spt db ?
  698. cdire db ?
  699. csec dw ?
  700. spa db ?
  701. chead db ?
  702. bpbType ends
  703. PUBLIC SM92
  704. sm92 bpbType <3,9,70H,2*9*80,2,2>
  705. ;
  706. ; ALTAH is a single character buffer used to handle special keys.
  707. ;
  708. PUBLIC ALTAH
  709. ALTAH DB 0 ;Special key handling
  710. ;
  711. ; The following variable can be modified via IOCTL sub-function 16. In this
  712. ; way, the wait can be set to suit the speed of the particular printer being
  713. ; used. One for each printer device.
  714. ;
  715. PUBLIC PRINTDEV
  716. PRINTDEV DB 0 ; Index into following array
  717. EVENB
  718. PUBLIC WAIT_COUNT
  719. WAIT_COUNT DW 4 dup (50h) ; Array of Retry counts for printer
  720. ;
  721. ; DAYCNT is the number of days since 1-1-80.
  722. ; Each time the clock is read it is necessary to check if another day has
  723. ; passed. The ROM only returns the day rollover once so if it is missed
  724. ; the time will be off by a day.
  725. ;
  726. EVENB
  727. Public DAYCNT
  728. DAYCNT DW 0
  729. ;
  730. ; The following variables and two routines (MSGOUT and MSGNUM) are used
  731. ; with the debug routines to print numbers and messages on the screen.
  732. ;
  733. ; The variable fTestBits controls the level of debugging in the system.
  734. ; See the comments and "equ's" in msmacro.inc for an explination of
  735. ; how to control the level of debugging. In a nutshell, setting
  736. ; fTestBits to fTestALL prints all the debugging messages. Setting
  737. ; it to fTestDisk prints all disk related messages, etc.
  738. ;
  739. if test
  740. Public NumBuf
  741. NumBuf DB 5 dup (?)
  742. Public Digits
  743. Digits DB "0123456789ABCDEF"
  744. Public fTestBits
  745. FTESTBITS DW fTestDISK
  746. endif
  747. PATHEND 001,BIO