;******************************************************* ; ; MicroDrive CD Driver 'Equates' file.. ; ; Written by Bill Garber. Started May 18, 2005 ; ; Copyright GarberStreet Enterprizez. 2005 ; ;******************************************************* ;******************************************************* ; ; This file contains the global equates for the ; MicroDrive IDE ATAPI Driver. ; ;******************************************************* ; ; Bit Location equates ; null equ %0000000000000000 bit_0 equ %0000000000000001 bit_1 equ %0000000000000010 bit_2 equ %0000000000000100 bit_3 equ %0000000000001000 bit_4 equ %0000000000010000 bit_5 equ %0000000000100000 bit_6 equ %0000000001000000 bit_7 equ %0000000010000000 bit_8 equ %0000000100000000 bit_9 equ %0000001000000000 bit_10 equ %0000010000000000 bit_11 equ %0000100000000000 bit_12 equ %0001000000000000 bit_13 equ %0010000000000000 bit_14 equ %0100000000000000 bit_15 equ %1000000000000000 ; ; Partition Map Signature ; Part_sig equ $4d50 ;High-->Low ; ; Driver Descriptor Map Signature ; DDM_sig equ $5245 ;High-->Low ; ; Booleans ; true equ bit_0 false equ null ; ; Time definitions. ; qtr_sec equ $0001 one_sec equ 4*qtr_sec one_min equ 60*one_sec ;******************************************************* ; ; ENTRY: move_info ; ;******************************************************* move_info equ $01fc70 moveblkcmd equ $0800 ;Block Move Option move_sinc_dinc equ $0805 ;Source Inc, Dest Inc move_sinc_ddec equ $0809 ;Source Inc, Dest Dec move_sdec_dinc equ $0806 ;Source Dec, Dest Inc move_sdec_ddec equ $080a ;Source Dec, Dest Dec move_scon_dcon equ $0800 ;Source con, Dest con move_sinc_dcon equ $0801 ;Source Inc, Dest con move_sdec_dcon equ $0802 ;Source Dec, Dest con move_scon_dinc equ $0804 ;Source con, Dest Inc move_scon_ddec equ $0808 ;Source con, Dest Dec ;******************************************************* ; ; ENTRY: set_disksw ; ;******************************************************* dev_dispatcher equ $01fc00 cache_find_blk equ $01fc04 cache_add_blk equ $01fc08 cache_del_blk equ $01fc14 cache_del_vol equ $01fc18 set_disksw equ $01fc90 s_dispatch equ $01fca4 install_driver equ $01fca8 ; ; Direct Page Addresses. ; dev_num equ $0000 ;Device Number call_num equ $0002 ;Call Number buff_ptr equ $0004 ;Buffer Pointer rqst_cnt equ $0008 ;Request Count trans_cnt equ $000C ;Transfer Count block_num equ $0010 ;Block Number (Read/Write only) blk_size equ $0014 ;Block Size fst_num equ $0016 ;FST Number (Read/Write only) stat_code equ $0016 ;Status Command Code cont_code equ $0016 ;Control Command Code volume_id equ $0018 ;Volume ID (Read/Write only) cache_prio equ $001A ;Cache Priority Value (Read/Write only) cache_ptr equ $001C ;Cache Pointer (Read/Write only) dib_ptr equ $0020 ;DIB Pointer ; ; MicroDrive IDE Commands ; RESTORCM equ %00010000 SEEKCMD equ %01110000 READCMD equ %00100000 WRITECMD equ %00110000 SCANCMD equ %01000000 SET_MULT equ $C6 ; MULTIPLE CMDS RMULTCMD equ $C4 ; WMULTCMD equ $C5 ; ; ; Error_Codes. ; no_error equ $0000 dev_not_found equ $0010 bad_dev_number equ $0011 drvr_bad_req equ $0020 drvr_bad_code equ $0021 drvr_bad_parm equ $0022 drvr_not_open equ $0023 drvr_prior_open equ $0024 drvr_io equ $0027 drvr_no_dev equ $0028 drvr_busy equ $0029 drvr_wrt_prot equ $002b drvr_bad_cnt equ $002c drvr_bad_blk equ $002d drvr_dsk_swch equ $002e drvr_off_line equ $002f dib RECORD $0000 ; ; Definition of DIB Structure. ; linkptr equ $00 ; DIB Link Pointer (LONG) entry equ $04 ; Pointer to Drvrs Main Entry (LONG) dvcchar equ $08 ; Device Characteristics (WORD) blkcnt equ $0A ; Block Count for this device (LONG) disname equ $0E ; Field for this devices Name (STR) slotnum equ $2E ; Device Slot Number from MGR. (WORD) unitnum equ $30 ; Device Unit Number from MGR. (WORD) versnum equ $32 ; Version Number for our Driver (WORD) dvcid equ $34 ; ID of Device we talk to (WORD) headlnk equ $36 ; Head Device Link (WORD) fdvclnk equ $38 ; Forward Device Link (WORD) ext_ptr equ $3A ; Pointer to DIB Extension (LONG) devnum equ $3E ; DIB Device Number (WORD) ; ; The Starting Block Number for this device ; is maintained here. This is used to ; modify the requested block number from ; a logical to a physical number. ; start_blk ds.l 1 ; Starting Physical Block Num. (LONG) ; ; These two pointers are the compliment ; to the links in the standard DIB and ; will point to the actual DIB referenced ; in the Head and Forward Device Links. ; headptr ds.l 1 ; Head Dvc Pointer (LONG) fdvcptr ds.l 1 ; Forward Dvc Pointer (LONG) mem_dib_cnt ds.w 1 ; Number of active dibs in mem (WORD) part_blk ds.w 1 ; Block containing partition (WORD) Sig ds.w 1 ;Signature Always $504d ; Apple II = $4d50 SigPad ds.w 1 ;Reserved for future use MapBlkCnt ds.l 1 ;Number of blocks in Map PyPartStart ds.l 1 ;First Physical Block of Partition PartBlkCnt ds.l 1 ;Number of Blocks in Partition PartName ds.b 32 ;Partition Name PartType ds.b 32 ;Partition Type LgDataStart ds.l 1 ;1st Logical Data Block DataCnt ds.l 1 ;Number of data blocks PartStatus ds.l 1 ;Partition Status Info LgBootStart ds.l 1 ;1st Logical Boot Block BootSize ds.l 1 ;Size of Boot Code in Bytes BootLoad ds.l 1 ;Boot Code Load Address BootLoad2 ds.l 1 ;Additional Boot Load Info BootEntry ds.l 1 ;Boot Code Entry Point BootEntry2 ds.l 1 ;Additional Boot Entry Info BootCksum ds.l 1 ;Boot Code Checksum Processor ds.b 16 ;Processor Type Args ds.b 128 ;Boot Specific Arguments end equ * ds.b $200-end ;Pad to 1 Block ENDR ; ; Structure of data from Read Capacity Call ; block RECORD $0000 count ds.l 1 ;Block Count High >> Low size ds.l 1 ;Block Size High >> Low ENDR ; ; Structure of data from Mode Sense Call ; mode RECORD $0000 sense_len ds.b 1 ;Sense Data Length med_type ds.b 1 ;Medium Type w_protect ds.b 1 ;Write Protect bit 7 blk_disc ds.b 1 ;Block Descriptor Length ds.b 1 ;Unused data blocks ds.b 3 ;Block Count High >> Low ds.b 1 ;Unused data blk_size ds.b 3 ;Block Size High >> Low page_number ds.b 1 ;Page number of mode sense data length ds.b 1 ;Length of data that follows ENDR ; ; Structure of data from Request Sense Call ; rqst_sens RECORD $0000 error_code ds.b 1 ;Bit 7 = Valid Flag ;Bits 0-6 = Error Code segment ds.b 1 ; = Segment Number sense_key ds.b 1 ;Bit 7 = Filemark bit ;Bit 6 = EOM bit ;Bit 5 = ILI bit ;Bit 4 = Reserved ;Bits 0-3 = Sense Key info_bytes ds.b 4 ; = Information Bytes addnl_sens_len ds.b 1 ; = Additional Sense Length (n-7) command_spec ds.b 4 ; = Command Specific Information addnl_sens_code ds.b 1 ; = Additional Sense Code addnl_code_qual ds.b 1 ; = Additional Sense Code Qualifier ENDR ; ; Structure of data from Inquiry Call ; inq RECORD $0000 pd_type ds.b 1 ;Peripheral Device Type removable ds.b 1 ;Removable bit 7 ds.b $26-2 ;Unused data group ds.b 1 ;First Group Number ENDR ; ; Structure of data from GET DATA STATUS Call ; gds RECORD $0000 ds.b 2 ;reserved data_len ds.b 1 ;Amount of data returned by this call block ds.b 1 ;bit 0 winw_id ds.b 1 ;Window Identifier ds.b 1 ;reserved buf_avail ds.b 3 ;Amount of available Scanner Buffer Space data_avail ds.b 3 ;Amount of Available Scan Data ENDR ; ; Structure of data from Device Specific Calls ; ds RECORD $0000 version ds.w 1 ;Version Number of this structure ds.b 12 ;Command Bytes DCcode ds.l 1 ;1st DC Code DCcount ds.l 1 ;1st Count DCoffset ds.l 1 ;1st Offset DCreserved ds.l 1 ;1st Reserved ENDR EJECT