Changeset 294 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm
- Timestamp:
- Mar 4, 2012, 1:35:10 AM (12 years ago)
- google:author:
- krille_n_@hotmail.com
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm
r277 r294 8 8 ; Checks if drive is handled by this BIOS, and return DPT pointer. 9 9 ; 10 ; FindDPT_ForDriveNumberInDL 10 ; FindDPT_ForDriveNumberInDL 11 11 ; Parameters: 12 12 ; DL: Drive number … … 21 21 ;-------------------------------------------------------------------- 22 22 ALIGN JUMP_ALIGN 23 FindDPT_ForDriveNumberInDL: 23 FindDPT_ForDriveNumberInDL: 24 24 xchg di, ax ; Save the contents of AX in DI 25 25 26 ; 26 ; 27 27 ; Check Our Hard Disks 28 28 ; … … 33 33 cmp dl, ah ; Above last supported? 34 34 jae SHORT .HardDiskNotHandledByThisBIOS 35 35 36 36 cmp dl, al ; Below first supported? 37 37 jae SHORT .CalcDPTForDriveNumber 38 38 39 ALIGN JUMP_ALIGN 40 .HardDiskNotHandledByThisBIOS: 39 ALIGN JUMP_ALIGN 40 .HardDiskNotHandledByThisBIOS: 41 41 ; 42 42 ; Check Our Floppy Disks 43 ; 43 ; 44 44 call RamVars_UnpackFlopCntAndFirstToAL 45 45 js SHORT .DiskIsNotHandledByThisBIOS 46 46 47 47 cbw ; Always 0h (no floppy drive covered above) 48 48 adc ah, al ; Add in first drive number and number of drives … … 51 51 jz SHORT .CalcDPTForDriveNumber 52 52 cmp al, dl ; Check first drive in all cases, redundant but OK to repeat 53 jnz SHORT .DiskIsNotHandledByThisBIOS 53 jnz SHORT .DiskIsNotHandledByThisBIOS 54 54 %else 55 cmp dl, ah ; Above last supported? 55 cmp dl, ah ; Above last supported? 56 56 jae SHORT .DiskIsNotHandledByThisBIOS 57 57 58 58 cmp dl, al ; Below first supported? 59 jb SHORT .DiskIsNotHandledByThisBIOS 59 jb SHORT .DiskIsNotHandledByThisBIOS 60 60 %endif 61 61 ; fall-through to CalcDPTForDriveNumber … … 63 63 ;-------------------------------------------------------------------- 64 64 ; Finds Disk Parameter Table for drive number. 65 ; Not e intended to be called except by FindDPT_ForDriveNumber65 ; Not intended to be called except by FindDPT_ForDriveNumberInDL 66 66 ; 67 67 ; CalcDPTForDriveNumber … … 69 69 ; DL: Drive number 70 70 ; DS: RAMVARS segment 71 ; DI: Saved copy of AX from entry at FindDPT_ForDriveNumber 71 ; DI: Saved copy of AX from entry at FindDPT_ForDriveNumberInDL 72 72 ; Returns: 73 73 ; DS:DI: Ptr to DPT … … 82 82 %ifdef MODULE_SERIAL_FLOPPY 83 83 mov ax, [RAMVARS.wDrvCntAndFirst] 84 84 85 85 test dl, dl 86 86 js .harddisk … … 88 88 call RamVars_UnpackFlopCntAndFirstToAL 89 89 add dl, ah ; add in end of hard disk DPT list, floppies start immediately after 90 91 ALIGN JUMP_ALIGN 90 91 ALIGN JUMP_ALIGN 92 92 .harddisk: 93 93 sub dl, al ; subtract off beginning of either hard disk or floppy list (as appropriate) … … 96 96 %endif 97 97 98 .CalcDPTForNewDrive: 98 .CalcDPTForNewDrive: 99 99 mov al, LARGEST_DPT_SIZE 100 100 101 101 mul dl 102 add ax, BYTE RAMVARS_size ; Clears CF (will not ove flow)102 add ax, BYTE RAMVARS_size ; Clears CF (will not overflow) 103 103 104 104 pop dx … … 107 107 ret 108 108 109 ALIGN JUMP_ALIGN 110 .DiskIsNotHandledByThisBIOS: 109 ALIGN JUMP_ALIGN 110 .DiskIsNotHandledByThisBIOS: 111 111 ; 112 112 ; Drive not found... 113 113 ; 114 114 xor ax, ax ; Clear DPT pointer 115 stc ; Is not supported by our BIOS 116 115 stc ; Is not supported by our BIOS 116 117 117 xchg di, ax ; Restore AX from save at top 118 118 ret … … 136 136 137 137 ;-------------------------------------------------------------------- 138 ; Iteration routine for FindDPT_ForIdevarsOffsetInDL, 138 ; Iteration routine for FindDPT_ForIdevarsOffsetInDL, 139 139 ; for use with IterateAllDPTs 140 ; 140 ; 141 141 ; Returns when DPT is found on the controller with Idevars offset in DL 142 142 ; … … 148 148 ; Set if wrong DPT 149 149 ;-------------------------------------------------------------------- 150 IterateFindFirstDPTforIdevars: 150 IterateFindFirstDPTforIdevars: 151 151 cmp dl, [di+DPT.bIdevarsOffset] ; Clears CF if matched 152 152 je .done 153 153 stc ; Set CF for not found 154 .done: 154 .done: 155 155 ret 156 156 … … 171 171 FindDPT_ForNewDriveToDSDI: 172 172 push dx 173 173 174 174 %ifdef MODULE_SERIAL_FLOPPY 175 175 mov dx, [RAMVARS.wDrvCntAndFlopCnt] … … 178 178 mov dl, [RAMVARS.bDrvCnt] 179 179 %endif 180 180 181 181 jmp short FindDPT_ForDriveNumberInDL.CalcDPTForNewDrive 182 182 … … 185 185 ; Parameters: 186 186 ; DS:DI: Ptr to DPT to examine 187 ; BL: Bit(s) to test in DPT.bFlagsHigh 187 ; BL: Bit(s) to test in DPT.bFlagsHigh 188 188 ; Returns: 189 189 ; CF: Clear if wanted DPT found … … 193 193 ;-------------------------------------------------------------------- 194 194 ALIGN JUMP_ALIGN 195 IterateToDptWithFlagsHighInBL: 196 test BYTE [di+DPT.bFlagsHigh], bl; Clears CF195 IterateToDptWithFlagsHighInBL: 196 test [di+DPT.bFlagsHigh], bl ; Clears CF 197 197 jnz SHORT .ReturnRightDPT 198 198 stc 199 .ReturnRightDPT: 199 .ReturnRightDPT: 200 200 ret 201 201 … … 212 212 ;-------------------------------------------------------------------- 213 213 %ifdef MODULE_SERIAL 214 ALIGN JUMP_ALIGN 215 FindDPT_ToDSDIforSerialDevice: 214 ALIGN JUMP_ALIGN 215 FindDPT_ToDSDIforSerialDevice: 216 216 mov bl, FLGH_DPT_SERIAL_DEVICE 217 217 ; fall-through 218 218 %endif 219 219 220 220 ;-------------------------------------------------------------------- 221 221 ; FindDPT_ToDSDIforFlagsHigh … … 231 231 ;-------------------------------------------------------------------- 232 232 ALIGN JUMP_ALIGN 233 FindDPT_ToDSDIforFlagsHighInBL: 233 FindDPT_ToDSDIforFlagsHighInBL: 234 234 mov si, IterateToDptWithFlagsHighInBL 235 235 ; Fall to IterateAllDPTs … … 257 257 258 258 mov di, RAMVARS_size ; Point DS:DI to first DPT 259 260 mov cl, [RAMVARS.bDrvCnt] 261 xor ch, ch ; Clears CF 262 259 eMOVZX cx, [RAMVARS.bDrvCnt] 263 260 jcxz .NotFound ; Return if no drives 264 261 265 262 ALIGN JUMP_ALIGN 266 263 .LoopWhileDPTsLeft:
Note: See TracChangeset
for help on using the changeset viewer.