Changeset 262 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm
- Timestamp:
- Feb 24, 2012, 10:28:31 AM (13 years ago)
- google:author:
- gregli@hotmail.com
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm
r258 r262 115 115 116 116 ;-------------------------------------------------------------------- 117 ; Checks if INT 13h function is handled by this BIOS.118 ;119 ; RamVars_IsFunctionHandledByThisBIOS120 ; Parameters:121 ; AH: INT 13h function number122 ; DL: Drive number123 ; DS: RAMVARS segment124 ; Returns:125 ; CF: Cleared if function is handled by this BIOS126 ; Set if function belongs to some other BIOS127 ; Corrupts registers:128 ; Nothing129 ;--------------------------------------------------------------------130 ALIGN JUMP_ALIGN131 RamVars_IsFunctionHandledByThisBIOS:132 test ah, ah ; Reset for all floppy and hard disk drives?133 jz SHORT RamVars_IsDriveHandledByThisBIOS.CFAlreadyClear_IsHandledByOurBIOS134 cmp ah, 08h135 %ifdef MODULE_SERIAL_FLOPPY136 ; we handle all traffic for function 08h, as we need to wrap both hard disk and floppy drive counts137 je SHORT RamVars_IsDriveHandledByThisBIOS.CFAlreadyClear_IsHandledByOurBIOS138 %else139 ; we handle all *hard disk* traffic for function 08h, as we need to wrap the hard disk drive count140 je SHORT RamVars_IsDriveHandledByThisBIOS.IsDriveAHardDisk141 %endif142 ;;; fall-through143 144 ;--------------------------------------------------------------------145 ; Checks if drive is handled by this BIOS.146 ;147 ; RamVars_IsDriveHandledByThisBIOS148 ; Parameters:149 ; DL: Drive number150 ; DS: RAMVARS segment151 ; Returns:152 ; CF: Cleared if drive is handled by this BIOS153 ; Set if drive belongs to some other BIOS154 ; Corrupts registers:155 ; Nothing156 ;--------------------------------------------------------------------157 ALIGN JUMP_ALIGN158 RamVars_IsDriveHandledByThisBIOS:159 push ax160 161 mov ax, [RAMVARS.wDrvCntAndFirst] ; Drive count to AH, First number to AL162 add ah, al ; One past last drive to AH163 cmp dl, ah ; Above last supported?164 jae SHORT .HardDiskIsNotHandledByThisBIOS165 .TestLowLimit:166 cmp dl, al ; Below first supported?167 jae SHORT .CFAlreadyClear_IsHandledByOurBIOS_PopAX ; note that CF is clear if the branch is taken168 169 .HardDiskIsNotHandledByThisBIOS:170 %ifdef MODULE_SERIAL_FLOPPY171 call RamVars_UnpackFlopCntAndFirstToAL172 cbw ; normally 0h, could be ffh if no drives present173 adc ah, al ; if no drives present, still ffh (ffh + ffh + 1 = ffh)174 js SHORT .DiskIsNotHandledByThisBIOS175 cmp ah, dl176 jz SHORT .CFAlreadyClear_IsHandledByOurBIOS_PopAX177 cmp al, dl178 jz SHORT .CFAlreadyClear_IsHandledByOurBIOS_PopAX179 .DiskIsNotHandledByThisBIOS:180 %endif181 182 stc ; Is not supported by our BIOS183 184 .CFAlreadyClear_IsHandledByOurBIOS_PopAX:185 pop ax186 .CFAlreadyClear_IsHandledByOurBIOS:187 ret188 189 %ifndef MODULE_SERIAL_FLOPPY190 ;191 ; Note that we could have just checked for the high order bit in dl, but with the needed STC and jumps,192 ; leveraging the code above resulted in space savings.193 ;194 .IsDriveAHardDisk:195 push ax ; match stack at the top of routine196 mov al, 80h ; to catch all hard disks, lower limit is 80h vs. bFirstDrv197 jmp .TestLowLimit ; and there is no need to test a high limit198 %endif199 200 ;--------------------------------------------------------------------201 117 ; RamVars_GetHardDiskCountFromBDAtoAX 202 118 ; Parameters:
Note:
See TracChangeset
for help on using the changeset viewer.