mirror of
https://github.com/antoinevignau/source.git
synced 2024-11-19 07:31:13 +00:00
1 line
21 KiB
Plaintext
1 line
21 KiB
Plaintext
|
;*******************************************************
;
; SCSI Driver Get Volume/Disk Parms code.
;
; Written by Matt Gulick. Started April 17,1991
;
; Copyright Apple Computer, Inc. 1990
;
;*******************************************************
;*******************************************************
;
; This file contains the Get Volume/Disk Parms as
; defined in the ERS.
;
;*******************************************************
;*******************************************************
;
; Revision History:
;
;*******************************************************
; April 17, 1991 File started.
IMPORT ddm_data
IMPORT drvr_size
IMPORT ddm_index
IMPORT error
IMPORT gc_buff_ptr
ENTRY pre_load_ddm
ENTRY find_drvr_part
ENTRY pdata_block
EJECT
;*******************************************************
;
; 'g_vol_parms'
;
; This routine is used to get information about the
; volume in question. Calls should have the DIB
; Pointer set to the volume for which the information
; is being requested.
;
; The structure of the parameter list is defined in the
; SCSI Driver ERS. The parameters are going to depend
; greatly on the type of device that this driver is
; written for. That means that the info for the Scanner
; will not be the same in any form as that for a Hard
; Disk, or a Tape drive. These calls will be particular
; for the device type supported.
;
; Called via 'JSR'
;
; Inputs: [dib_ptr] = Target DIB (LONG)
; [buff_ptr] = Data Buffer Pointer (LONG)
; Acc = Unspecified
; Carry = Unspecified
; Y register = Unspecified
; X register = Unspecified
; P register = 0=M=X=e
; Direct Page = Ours
; Data Bank = Ours
;
; Returns via 'RTS'
;
; Outputs: Acc = 0
; Carry = 0
; or
; Acc = Error
; Carry = 1
;
; Y register = Unspecified
; X register = Unspecified
; P register = 0=M=X=e
; Direct Page = Ours
; Data Bank = Ours
;
; Errors: See Spec.
;
;*******************************************************
EXPORT gvp
gvp
;
; Check the Request Count. We need at
; least 4 bytes.
;
lda <rqst_cnt+2
bne @rqst_cnt_ok
lda <rqst_cnt
cmp #$0002
blt @bad_cnt
;
; Check to see if this Volume is Online.
;
@rqst_cnt_ok ldy #dib.dvcflag
lda [dib_ptr],y
and #dvc_online
beq @not_online
;
; Validate that this DIB is from
; a Partition Map Entry.
;
ldy #dib.start_blk
lda [dib_ptr],y
ldy #dib.start_blk+2
ora [dib_ptr],y
beq @exit_parm
;
; Get block that contains this
; DIB's Partition Map Entry.
;
ldy #dib.part_blk
lda [dib_ptr],y
sta |rpm_blk_num
;
; Tell the code that we have already
; set the Block Number and that this
; is not a startup call.
;
dec |stat_cont ;This is from a Status or Control Call
dec |rebuild ;And not from a startup Call
;
; Issue the Read PM Block Call.
;
jsr |read_pm_blk
bcs @bad_exit ;There was an error.
jsr set_our_dp
;
; Is what we read a Partition Map?
;
lda |pm.Sig\
+internal_buff
cmp #Part_sig
bne @bad_exit ;Bad Data Read.
;
; Get the Status Byte
;
lda |pm.PartStatus+2\
+internal_buff
xba
and #$00ff
sta [buff_ptr]
;
; Clean Exit
;
lda #$0002
sta <trans_cnt
lda #no_error
sta <trans_cnt+2
clc
rts
;
; Not from a partition.
;
@not_online lda #drvr_off_line
bra @exit_none
;
; Error exit point.
;
@bad_exit jsr set_our_dp
lda #drvr_io
bra @exit_none
;
; Error exit point.
;
@bad_cnt lda #drvr_bad_cnt
bra @exit_none
;
; Use this code to e
|