Changeset 294 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Initialization
- Timestamp:
- Mar 4, 2012, 1:35:10 AM (13 years ago)
- google:author:
- krille_n_@hotmail.com
- Location:
- trunk/XTIDE_Universal_BIOS/Src/Initialization
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm
r269 r294 26 26 mov cx, g_szDetectMaster 27 27 mov bh, MASK_DRVNHEAD_SET ; Select Master drive 28 call StartDetectionWithDriveSelectByteInBHandStringIn AX ; Detect and create DPT + BOOTNFO28 call StartDetectionWithDriveSelectByteInBHandStringInCX ; Detect and create DPT + BOOTNFO 29 29 30 30 mov cx, g_szDetectSlave 31 31 mov bh, MASK_DRVNHEAD_SET | FLG_DRVNHEAD_DRV 32 call StartDetectionWithDriveSelectByteInBHandStringIn AX32 call StartDetectionWithDriveSelectByteInBHandStringInCX 33 33 34 34 pop cx … … 72 72 mov al, [es:BDA.bHDCount] 73 73 add cl, al ; Add our drives to the system count 74 mov [es:BDA.bHDCount], cl 75 or al, 80h ; Or in hard disk flag 76 mov [RAMVARS.bFirstDrv], al ; Store first drive number 77 78 .AddFloppies: 79 %ifdef MODULE_SERIAL_FLOPPY 74 mov [es:BDA.bHDCount], cl 75 or al, 80h ; Or in hard disk flag 76 mov [RAMVARS.bFirstDrv], al ; Store first drive number 77 78 .AddFloppies: 79 %ifdef MODULE_SERIAL_FLOPPY 80 80 ;---------------------------------------------------------------------- 81 81 ; … … 84 84 dec ch 85 85 mov al, ch 86 js .NoFloppies ; if no drives are present, we store 0ffh 86 js .NoFloppies ; if no drives are present, we store 0ffh 87 87 88 88 call FloppyDrive_GetCountFromBIOS_or_BDA … … 92 92 add al, ch ; Add our drives to existing drive count 93 93 cmp al, 3 ; For BDA, max out at 4 drives (ours is zero based) 94 j l.MaxBDAFloppiesExceeded95 mov al, 3 94 jb .MaxBDAFloppiesExceeded 95 mov al, 3 96 96 .MaxBDAFloppiesExceeded: 97 97 eROR_IM al, 2 ; move to bits 6-7 98 98 inc ax ; low order bit, indicating floppy drive exists 99 99 100 mov ah, [es:BDA.wEquipment] ; Load Equipment WORD low byte 100 mov ah, [es:BDA.wEquipment] ; Load Equipment WORD low byte 101 101 and ah, 03eh ; Mask off drive number and drives present bit 102 102 or al, ah ; Or in new values … … 111 111 shr ch, 1 ; number of drives, 1 or 2 only, to CF flag (clear=1, set=2) 112 112 rcl al, 1 ; starting drive number in upper 7 bits, number of drives in low bit 113 .NoFloppies: 113 .NoFloppies: 114 114 mov [RAMVARS.xlateVars+XLATEVARS.bFlopCntAndFirst], al 115 115 %endif 116 116 117 117 ret 118 118 119 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 119 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 120 120 %if FLG_ROMVARS_SERIAL_SCANDETECT != 8 121 121 %error "DetectDrives is currently coded to assume that FLG_ROMVARS_SERIAL_SCANDETECT is the same bit as the ALT key code in the BDA. Changes in the code will be needed if these values are no longer the same." … … 125 125 126 126 ;-------------------------------------------------------------------- 127 ; StartDetectionWithDriveSelectByteInBHandStringIn AX127 ; StartDetectionWithDriveSelectByteInBHandStringInCX 128 128 ; Parameters: 129 129 ; BH: Drive Select byte for Drive and Head Register … … 137 137 ; AX, BX, CX, DX, SI, DI 138 138 ;-------------------------------------------------------------------- 139 StartDetectionWithDriveSelectByteInBHandStringIn AX:140 call DetectPrint_StartDetectWithMasterOrSlaveStringIn AXandIdeVarsInCSBP139 StartDetectionWithDriveSelectByteInBHandStringInCX: 140 call DetectPrint_StartDetectWithMasterOrSlaveStringInCXandIdeVarsInCSBP 141 141 ; Fall to .ReadAtaInfoFromHardDisk 142 142 -
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm
r285 r294 28 28 29 29 ;-------------------------------------------------------------------- 30 ; DetectPrint_StartDetectWithMasterOrSlaveStringIn AXandIdeVarsInCSBP30 ; DetectPrint_StartDetectWithMasterOrSlaveStringInCXandIdeVarsInCSBP 31 31 ; Parameters: 32 32 ; CS:CX: Ptr to "Master" or "Slave" string … … 38 38 ; AX, SI, DI, CX 39 39 ;-------------------------------------------------------------------- 40 DetectPrint_StartDetectWithMasterOrSlaveStringIn AXandIdeVarsInCSBP:40 DetectPrint_StartDetectWithMasterOrSlaveStringInCXandIdeVarsInCSBP: 41 41 mov ax, [cs:bp+IDEVARS.wPort] ; for IDE: AX=port address, DH=.bDevice 42 42 mov dx, [cs:bp+IDEVARS.bDevice-1] ; for Serial: AL=port address>>2, AH=baud rate … … 48 48 49 49 mov si, g_szDetectOuter ; Load SI with default wrapper string "IDE %s at %s: " 50 50 51 51 push bp ; setup stack for call to 52 52 mov bp, sp ; BootMenuPrint_FormatCSSIfromParamsInSSBP … … 98 98 mov cl, (g_szDetectCOMSmall-$$) & 0xff ; Setup secondary print string for "COMn/XXy00" 99 99 100 .pushAndPrintSerial: 100 .pushAndPrintSerial: 101 101 mov si, g_szDetectOuterSerial ; Finally load SI with wrapper string "Serial %s on %s: " 102 102 103 103 .pushAndPrint: 104 104 %endif 105 105 106 106 push cx ; Push print string 107 107 push ax ; Push high order digits, or port address, or N/A -
trunk/XTIDE_Universal_BIOS/Src/Initialization/DriveXlate.asm
r248 r294 39 39 SwapFloppyDriveOrHardDisk: 40 40 mov ah, 80h ; Assume hard disk 41 mov al, BYTE[RAMVARS.xlateVars+XLATEVARS.bHDSwap]41 mov al, [RAMVARS.xlateVars+XLATEVARS.bHDSwap] 42 42 test dl, ah ; Hard disk? 43 43 jnz SHORT SwapDrive ; If so, jump to swap 44 mov al, BYTE[RAMVARS.xlateVars+XLATEVARS.bFDSwap]44 mov al, [RAMVARS.xlateVars+XLATEVARS.bFDSwap] 45 45 cbw 46 46 ; Fall to SwapDrive -
trunk/XTIDE_Universal_BIOS/Src/Initialization/FloppyDrive.asm
r274 r294 127 127 ;-------------------------------------------------------------------- 128 128 ALIGN JUMP_ALIGN 129 FloppyDrive_GetCountToAX: 129 FloppyDrive_GetCountToAX: 130 130 %ifdef MODULE_SERIAL_FLOPPY 131 131 call RamVars_UnpackFlopCntAndFirstToAL 132 132 js .UseBIOSorBDA ; We didn't add in any drives, counts here are not valid 133 134 adc al,1 ; adds in the drive count bit, and adds 1 for count vs. 0-index, 133 134 adc al,1 ; adds in the drive count bit, and adds 1 for count vs. 0-index, 135 135 jmp .FinishCalc ; need to clear AH on the way out, and add in minimum drive numbers 136 136 137 .UseBIOSorBDA: 137 .UseBIOSorBDA: 138 138 %endif 139 139 call FloppyDrive_GetCountFromBIOS_or_BDA 140 140 141 .FinishCalc: 141 .FinishCalc: 142 142 mov ah, [cs:ROMVARS.bMinFddCnt] 143 143 MAX_U al, ah 144 144 cbw 145 146 ret 147 148 ALIGN JUMP_ALIGN 145 146 ret 147 148 ALIGN JUMP_ALIGN 149 149 FloppyDrive_GetCountFromBIOS_or_BDA: 150 150 push es … … 152 152 ;-------------------------------------------------------------------- 153 153 ; Reads Floppy Drive Count from BIOS. 154 ; Does not work on most XT systems. Call FloppyDrive_GetCountFromBDA154 ; Does not work on most XT systems. Call .GetCountFromBDA 155 155 ; if this function fails. 156 156 ; 157 ; GetCountFromBIOS157 ; .GetCountFromBIOS 158 158 ; Parameters: 159 159 ; Nothing 160 160 ; Returns: 161 161 ; AL: Number of Floppy Drives 162 ; CF: Cleared if successful l162 ; CF: Cleared if successful 163 163 ; Set if BIOS function not supported 164 164 ; Corrupts registers: … … 169 169 .GetCountFromBIOS: 170 170 push di 171 push es172 171 push bx 173 172 push cx … … 182 181 pop cx 183 182 pop bx 184 pop es185 183 pop di 186 184 %endif … … 188 186 ;-------------------------------------------------------------------- 189 187 ; Reads Floppy Drive Count (0...4) from BIOS Data Area. 190 ; This function should be used only if FloppyDrive_GetCountFromBIOS fails.191 ; 192 ; GetCountFromBDA193 ; Parameters: 194 ; Nothing 195 ; Returns: 196 ; CL: Number of Floppy Drives197 ; Corrupts registers: 198 ; CH, ES188 ; This function should be used only if .GetCountFromBIOS fails. 189 ; 190 ; .GetCountFromBDA 191 ; Parameters: 192 ; Nothing 193 ; Returns: 194 ; AL: Number of Floppy Drives 195 ; Corrupts registers: 196 ; AH, ES 199 197 ;-------------------------------------------------------------------- 200 198 %ifndef USE_AT … … 203 201 LOAD_BDA_SEGMENT_TO es, ax 204 202 mov al, [es:BDA.wEquipment] ; Load Equipment WORD low byte 205 mov ah, al ; Copy it to CH203 mov ah, al ; Copy it to AH 206 204 and ax, 0C001h ; Leave bits 15..14 and 0 207 205 eROL_IM ah, 2 ; EW low byte bits 7..6 to 1..0 208 add al, ah ; CL = Floppy Drive count206 add al, ah ; AL = Floppy Drive count 209 207 %endif 210 208 211 209 pop es 212 210 ret 213 -
trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm
r258 r294 62 62 mov di, ROMVARS.ideVars0 ; CS:SI points to first IDEVARS 63 63 .IdeControllerLoop: 64 mov al, BYTE[cs:di+IDEVARS.bIRQ]64 mov al, [cs:di+IDEVARS.bIRQ] 65 65 add di, BYTE IDEVARS_size ; Increment to next controller 66 66 call .InstallLowOrHighIrqHandler … … 147 147 ;-------------------------------------------------------------------- 148 148 Interrupts_UnmaskInterruptControllerForDriveInDSDI: 149 eMOVZX bx, BYTE[di+DPT.bIdevarsOffset]149 eMOVZX bx, [di+DPT.bIdevarsOffset] 150 150 mov al, [cs:bx+IDEVARS.bIRQ] 151 151 test al, al
Note:
See TracChangeset
for help on using the changeset viewer.