Changeset 363 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AHDh_HReset.asm
- Timestamp:
- Mar 26, 2012, 4:20:43 PM (13 years ago)
- google:author:
- aitotat@gmail.com
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AHDh_HReset.asm
r294 r363 53 53 54 54 ; Initialize Master and Slave drives 55 eMOVZX ax, [di+DPT.bIdevarsOffset]; (AL) pointer to controller we are looking to reset55 eMOVZX ax, BYTE [di+DPT.bIdevarsOffset] ; (AL) pointer to controller we are looking to reset 56 56 ; (AH) initialize error code, assume success 57 57 58 mov si, IterateAndResetDrives 58 mov si, IterateAndResetDrives ; Callback function for FindDPT_IterateAllDPTs 59 59 call FindDPT_IterateAllDPTs 60 60 … … 73 73 ; merged into overall error code for this controller. Master will be reset 74 74 ; first. Note that the iteration will go until the end of the DPT list. 75 ; 76 ; Parameters: 77 ; AL: Offset to IDEVARS for drives to initialize 78 ; AH: Error status from previous initialization 79 ; DS:DI: Ptr to DPT to examine 80 ; Returns: 81 ; AH: Error status from initialization 82 ; CF: Set to iterate all DPTs 83 ; Corrupts registers: 84 ; AL, BX, DX 75 85 ;-------------------------------------------------------------------- 76 86 IterateAndResetDrives: … … 78 88 jne .done 79 89 push ax 90 push cx 80 91 call AH9h_InitializeDriveForUse ; Reset Master and Slave (Master will come first in DPT list) 92 93 %ifdef MODULE_ADVANCED_ATA 94 jc SHORT .SkipControllerInitSinceError 95 call InitializeAdvancedIdeControllers ; Done after drive init so drives are first set to advanced PIO mode, then the controller 96 .SkipControllerInitSinceError: 97 %endif 98 99 pop cx 81 100 pop ax 82 101 jnc .done … … 85 104 stc ; From IterateAllDPTs perspective, the DPT is never found (continue iteration) 86 105 ret 106 107 108 %ifdef MODULE_ADVANCED_ATA 109 ;-------------------------------------------------------------------- 110 ; Here we initialize the more advanced controllers (VLB and PCI) 111 ; to get better performance for systems with 32-bit bus. 112 ; 113 ; This step is optional since the controllers use slowest possible 114 ; settings by default if they are not initialized. 115 ; 116 ; InitializeAdvancedIdeController 117 ; Parameters: 118 ; DS:DI: Ptr to DPT 119 ; Returns: 120 ; CF: Cleared if success or no controller to initialize 121 ; Set if error 122 ; Corrupts registers: 123 ; AX, BX, CX, DX 124 ;-------------------------------------------------------------------- 125 InitializeAdvancedIdeControllers: 126 ; We want to initialize the advanced controller only after both 127 ; Master and Slave drive are initialized to correct PIO mode. 128 ; We check if next DPT is for the same IDE controller. If it is, 129 ; we skip the initialization. 130 mov al, [di+DPT.bIdevarsOffset] 131 cmp al, [di++LARGEST_DPT_SIZE+DPT.bIdevarsOffset] 132 je SHORT .SkipInitializationUntilNextDrive ; CF cleared 133 134 jmp AdvAtaInit_InitializeControllerForDPTinDSDI 135 .SkipInitializationUntilNextDrive: 136 clc 137 ret 138 139 %endif ; MODULE_ADVANCED_ATA
Note:
See TracChangeset
for help on using the changeset viewer.