Changeset 530 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src
- Timestamp:
- Mar 28, 2013, 1:36:23 PM (12 years ago)
- google:author:
- aitotat@gmail.com
- Location:
- trunk/XTIDE_Universal_BIOS/Src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm
r526 r530 58 58 .SkipEddConfigurationParameters: 59 59 mov [si+EDRIVE_INFO.wSize], cx 60 mov WORD [si+EDRIVE_INFO.wFlags], FLG_DMA_BOUNDARY_ERRORS_HANDLED_BY_BIOS | FLG_CHS_INFORMATION_IS_VALID60 mov WORD [si+EDRIVE_INFO.wFlags], FLG_DMA_BOUNDARY_ERRORS_HANDLED_BY_BIOS 61 61 62 62 ; Store total sector count 63 63 mov [si+EDRIVE_INFO.qwTotalSectors], ax 64 xor ax, ax ; Return with success65 64 mov [si+EDRIVE_INFO.qwTotalSectors+2], dx 66 65 mov [si+EDRIVE_INFO.qwTotalSectors+4], bx 67 mov [si+EDRIVE_INFO.qwTotalSectors+6], ax ; Always zero 66 xor cx, cx 67 mov [si+EDRIVE_INFO.qwTotalSectors+6], cx ; Always zero 68 68 mov WORD [si+EDRIVE_INFO.wSectorSize], 512 69 69 70 ; Store P-CHS 70 ; Store P-CHS. Based on phoenix specification this is returned only if 71 ; total sector count is 15,482,880 or less. 72 sub ax, 4001h 73 sbb dx, 0ECh 74 sbb bx, cx ; Zero 75 jnc SHORT .ReturnWithSuccess ; More than EC4000h 76 or WORD [si+EDRIVE_INFO.wFlags], FLG_CHS_INFORMATION_IS_VALID 77 71 78 eMOVZX dx, BYTE [es:di+DPT.bPchsHeads] 72 xor ax, ax ; Also a return code73 79 mov [si+EDRIVE_INFO.dwHeads], dx 74 mov [si+EDRIVE_INFO.dwHeads+2], ax80 mov [si+EDRIVE_INFO.dwHeads+2], cx 75 81 76 82 mov dl, [es:di+DPT.bPchsSectorsPerTrack] 77 83 mov [si+EDRIVE_INFO.dwSectorsPerTrack], dx 78 mov [si+EDRIVE_INFO.dwSectorsPerTrack+2], ax84 mov [si+EDRIVE_INFO.dwSectorsPerTrack+2], cx 79 85 80 86 mov dx, [es:di+DPT.wPchsCylinders] 81 87 mov [si+EDRIVE_INFO.dwCylinders], dx 82 mov [si+EDRIVE_INFO.dwCylinders+2], ax88 mov [si+EDRIVE_INFO.dwCylinders+2], cx 83 89 90 .ReturnWithSuccess: 91 xor ax, ax 84 92 .ReturnWithError: 85 93 jmp Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH -
trunk/XTIDE_Universal_BIOS/Src/Initialization/FloppyDrive.asm
r526 r530 22 22 SECTION .text 23 23 24 %ifdef COPY_13H_HANDLER_TO_40H25 24 ;-------------------------------------------------------------------- 26 25 ; Checks is floppy drive handler installed to interrupt vector 40h. … … 36 35 ;-------------------------------------------------------------------- 37 36 FloppyDrive_IsInt40hInstalled: 38 cmp WORD [es:BIOS_DISKETTE_INTERRUPT_40h*4+2], 0C000h ; Any ROM segment?39 %ifdef USE_AT ; No need to verify on XT systems.40 jb SHORT .Int40hHandlerIsNotInstalled41 call .VerifyInt40hHandlerSinceSomeBiosesSimplyReturnFromInt40h42 .Int40hHandlerIsNotInstalled:43 %endif44 cmc45 ret46 47 ;--------------------------------------------------------------------48 ; .VerifyInt40hHandlerSinceSomeBiosesSimplyReturnFromInt40h49 ; Parameters:50 ; Nothing51 ; Returns:52 ; CF: Cleared if INT 40h is installed53 ; Set if INT 40h is not installed54 ; Corrupts registers:55 ; BX, CX, DI56 ;--------------------------------------------------------------------57 37 %ifdef USE_AT 58 .VerifyInt40hHandlerSinceSomeBiosesSimplyReturnFromInt40h:59 38 push es 60 39 push dx 61 40 push ax 62 41 63 call .LoadInt40hVerifyParameters42 call LoadInt40hVerifyParameters 64 43 int BIOS_DISK_INTERRUPT_13h 65 44 jc SHORT .Int40hIsInstalled ; Maybe there are not any floppy drives at all 66 push es 67 push di 45 push es ; Drive Parameter Table segment 46 push di ; Drive Parameter Table offset 68 47 69 call .LoadInt40hVerifyParameters48 call LoadInt40hVerifyParameters 70 49 int BIOS_DISKETTE_INTERRUPT_40h 71 50 … … 83 62 pop dx 84 63 pop es 64 65 %else ; if XT build 66 cmp WORD [es:BIOS_DISKETTE_INTERRUPT_40h*4+2], 0C000h ; Any ROM segment? (set CF if not) 67 %endif ; USE_AT 68 cmc 85 69 ret 86 70 87 71 ;-------------------------------------------------------------------- 88 ; .LoadInt40hVerifyParameters72 ; LoadInt40hVerifyParameters 89 73 ; Parameters: 90 74 ; Nothing … … 96 80 ; DH 97 81 ;-------------------------------------------------------------------- 98 .LoadInt40hVerifyParameters: 99 mov ah, 08h ; Get Drive Parameters 100 cwd ; Floppy drive 0 82 %ifdef USE_AT 83 LoadInt40hVerifyParameters: 84 mov ah, GET_DRIVE_PARAMETERS 85 cwd ; Floppy drive 0 101 86 mov di, dx 102 mov es, dx 87 mov es, dx ; ES:DI = 0000:0000h to guard against BIOS bugs 103 88 ret 104 89 %endif 105 106 %endif ; COPY_13H_HANDLER_TO_40H107 90 108 91 … … 130 113 %ifdef MODULE_BOOT_MENU 131 114 FloppyDrive_GetType: 132 mov ah, 08h ; Get Drive Parameters115 mov ah, GET_DRIVE_PARAMETERS 133 116 xor bx, bx ; FLOPPY_TYPE_525_OR_35_DD when function not supported 134 117 int BIOS_DISKETTE_INTERRUPT_40h … … 151 134 js .UseBIOSorBDA ; We didn't add in any drives, counts here are not valid 152 135 153 adc al ,1 ; adds in the drive count bit, and adds 1 for count vs. 0-index,136 adc al ,1 ; adds in the drive count bit, and adds 1 for count vs. 0-index, 154 137 jmp .FinishCalc ; need to clear AH on the way out, and add in minimum drive numbers 155 138 … … 165 148 ret 166 149 167 FloppyDrive_GetCountFromBIOS_or_BDA:168 push es169 150 170 151 ;-------------------------------------------------------------------- 171 ; Reads Floppy Drive Count from BIOS. 172 ; Does not work on most XT systems. Call .GetCountFromBDA 173 ; if this function fails. 174 ; 175 ; .GetCountFromBIOS 152 ; FloppyDrive_GetCountFromBIOS_or_BDA 176 153 ; Parameters: 177 154 ; Nothing … … 181 158 ; Set if BIOS function not supported 182 159 ; Corrupts registers: 183 ; ES160 ; AH, ES 184 161 ;-------------------------------------------------------------------- 162 FloppyDrive_GetCountFromBIOS_or_BDA: 163 push es 164 165 ; Reads Floppy Drive Count from BIOS. 166 ; Does not work on most XT systems. Call .GetCountFromBDA 167 ; if this function fails. 185 168 %ifdef USE_AT 186 .GetCountFromBIOS:187 169 push di 188 170 push bx … … 190 172 push dx 191 173 192 mov ah, 08h ; Get Drive Parameters174 mov ah, GET_DRIVE_PARAMETERS 193 175 cwd ; Floppy Drive 00h 194 176 int BIOS_DISKETTE_INTERRUPT_40h … … 199 181 pop bx 200 182 pop di 201 %endif202 183 203 ;--------------------------------------------------------------------204 184 ; Reads Floppy Drive Count (0...4) from BIOS Data Area. 205 185 ; This function should be used only if .GetCountFromBIOS fails. 206 ; 207 ; .GetCountFromBDA 208 ; Parameters: 209 ; Nothing 210 ; Returns: 211 ; AL: Number of Floppy Drives 212 ; Corrupts registers: 213 ; AH, ES 214 ;-------------------------------------------------------------------- 215 %ifndef USE_AT 216 .GetCountFromBDA: 186 %else ; ifndef USE_AT 217 187 LOAD_BDA_SEGMENT_TO es, ax 218 mov al, [es:BDA.wEquipment] 219 mov ah, al 220 and ax, 0C001h 221 eROL_IM ah, 2 222 add al, ah 188 mov al, [es:BDA.wEquipment] ; Load Equipment WORD low byte 189 mov ah, al ; Copy it to AH 190 and ax, 0C001h ; Leave bits 15..14 and 0 191 eROL_IM ah, 2 ; EW low byte bits 7..6 to 1..0 192 add al, ah ; AL = Floppy Drive count 223 193 %endif 224 194 -
trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm
r526 r530 64 64 mov [RAMVARS.fpOldI13h], ax ; Store old INT 13h offset 65 65 66 %ifdef COPY_13H_HANDLER_TO_40H67 66 ; Only store INT 13h handler to 40h if 40h is not already installed. 68 67 ; At least AMI BIOS for 286 stores 40h handler by itself and calls 69 ; 40h from 13h. That system locks to infinite loop if we copy 13h to 40h.68 ; 40h from 13h. That system locks to infinite loop if we blindly copy 13h to 40h. 70 69 call FloppyDrive_IsInt40hInstalled 71 70 jc SHORT .Int40hAlreadyInstalled … … 73 72 mov [es:BIOS_DISKETTE_INTERRUPT_40h*4+2], dx ; Store old INT 13h segment 74 73 .Int40hAlreadyInstalled: 75 %endif ; COPY_13H_HANDLER_TO_40H76 74 77 75 mov al, BIOS_DISK_INTERRUPT_13h ; INT 13h interrupt vector offset
Note:
See TracChangeset
for help on using the changeset viewer.