Changeset 567 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Initialization
- Timestamp:
- May 26, 2014, 1:25:15 PM (11 years ago)
- google:author:
- krille_n_@hotmail.com
- Location:
- trunk/XTIDE_Universal_BIOS/Src/Initialization
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/AdvAtaInit.asm
r564 r567 88 88 call AdvAtaInit_LoadMasterDPTtoDSSIifSlaveInDSDI 89 89 call Vision_InitializeWithIDinAHandConfigInAL 90 xor ax, ax ; Success 90 91 91 92 pop si … … 93 94 94 95 .NoAdvancedController: 95 xor ax, ax ; Success96 96 ret 97 97 -
trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm
r550 r567 27 27 ; ES:SI: Ptr to 512-byte ATA information read from the drive 28 28 ; Returns: 29 ; CF: Set if failed to verify ATA-ID30 ; Cleared if ATA-ID verified successfully29 ; ZF: Set if ATA-ID verified successfully 30 ; Cleared if failed to verify ATA-ID 31 31 ; Corrupts registers: 32 32 ; AX, BX, CX … … 41 41 ; Verify P-CHS cylinders 42 42 mov bx, ATA1.wCylCnt 43 mov cx, MAX_VALID_PCHS_CYLINDERS44 call .CompareCHorSfromOffsetBXtoMaxValueIn CX43 mov ax, MAX_VALID_PCHS_CYLINDERS 44 call .CompareCHorSfromOffsetBXtoMaxValueInAX 45 45 46 46 mov bl, ATA1.wHeadCnt & 0FFh 47 mov cx, MAX_VALID_PCHS_HEADS48 call .CompareCHorSfromOffsetBXtoMaxValueIn CX47 mov ax, MAX_VALID_PCHS_HEADS 48 call .CompareCHorSfromOffsetBXtoMaxValueInAX 49 49 50 50 mov bl, ATA1.wSPT & 0FFh 51 mov cl, MAX_VALID_PCHS_SECTORS_PER_TRACK52 call .CompareCHorSfromOffsetBXtoMaxValueIn CX51 mov al, MAX_VALID_PCHS_SECTORS_PER_TRACK 52 call .CompareCHorSfromOffsetBXtoMaxValueInAX 53 53 54 54 ; Check signature byte. It is only found on ATA-5 and later. It should be zero on … … 62 62 ; Check checksum byte since signature was present 63 63 mov cx, ATA6_size 64 call Memory_SumCXbytesFromESSItoAL ; Returns with ZF set according to result 65 jnz SHORT .FailedToVerifyAtaID 66 67 ; ATA-ID is now verified to be valid 68 .AtaIDverifiedSuccessfully: 69 clc 70 ret 71 72 ;-------------------------------------------------------------------- 73 ; .CompareCHorSfromOffsetBXtoMaxValueInCX 74 ; Parameters: 64 jmp Memory_SumCXbytesFromESSItoAL ; Returns with ZF set according to result 65 66 ;-------------------------------------------------------------------- 67 ; .CompareCHorSfromOffsetBXtoMaxValueInAX 68 ; Parameters: 69 ; AX: Maximum valid C, H or S value 75 70 ; BX: C, H or S offset to ATA-ID 76 ; CX: Maximum valid C, H or S value 77 ; ES:SI: Ptr to 512-byte ATA information read from the drive 78 ; Returns: 79 ; Exits from AtaID_VerifyFromESSI with CF set if invalid value 80 ; Corrupts registers: 81 ; AX 82 ;-------------------------------------------------------------------- 83 .CompareCHorSfromOffsetBXtoMaxValueInCX: 84 mov ax, [es:bx+si] 85 test ax, ax 86 jz SHORT .InvalidPCHorSinOffsetBX 87 cmp ax, cx ; Compare to max valid value 71 ; ES:SI: Ptr to 512-byte ATA information read from the drive 72 ; Returns: 73 ; Exits from AtaID_VerifyFromESSI with ZF cleared if invalid value 74 ; Corrupts registers: 75 ; CX 76 ;-------------------------------------------------------------------- 77 .CompareCHorSfromOffsetBXtoMaxValueInAX: 78 mov cx, [es:bx+si] 79 jcxz .InvalidPCHorSinOffsetBX 80 cmp cx, ax ; Compare to max valid value 88 81 jbe SHORT .ValidPCHorSinOffsetBX 89 82 .InvalidPCHorSinOffsetBX: 90 add sp, BYTE 2 ; Clear return address for this function 83 pop cx ; Clear return address for this function 84 inc cx ; Clear ZF to indicate invalid ATA-ID (safe to do since return address in CX will never be FFFFh) 85 .AtaIDverifiedSuccessfully: 91 86 .FailedToVerifyAtaID: 92 stc ; Set carry to indicate invalid ATA-ID93 87 .ValidPCHorSinOffsetBX: 94 88 ret … … 97 91 ;-------------------------------------------------------------------- 98 92 ; Writes user defined limits from ROMVARS to ATA ID read from the drive. 99 ; Modifying the ATA ID reduces code and possibilit es for bugs since100 ; only little fur her checks are needed elsewhere.93 ; Modifying the ATA ID reduces code and possibilities for bugs since 94 ; only little further checks are needed elsewhere. 101 95 ; 102 96 ; AtaID_ModifyESSIforUserDefinedLimitsAndReturnTranslateModeInDX -
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm
r558 r567 62 62 ; if serial drive detected, do not scan (avoids duplicate drives and isn't needed - we already have a connection) 63 63 ; 64 call FindDPT_ToDSDIforSerialDevice ; does not modify AX64 call FindDPT_ToDSDIforSerialDevice ; Does not modify AX 65 65 jnc .AddHardDisks 66 66 … … 68 68 69 69 %ifdef MODULE_HOTKEYS 70 cmp al, COM_DETECT_HOTKEY_SCANCODE 70 cmp al, COM_DETECT_HOTKEY_SCANCODE ; Set by last call to HotkeyBar_UpdateDuringDriveDetection above 71 71 je .DriveDetectLoop 72 72 %endif … … 134 134 mov [RAMVARS.xlateVars+XLATEVARS.bFlopCntAndFirst], al 135 135 %endif 136 137 %ifdef MODULE_8BIT_IDE_ADVANCED138 NoSlaveDriveAvailable:139 %endif140 136 ret 141 137 … … 156 152 ; ES: Zero (BDA segment) 157 153 ; Returns: 158 ; 154 ; Nothing 159 155 ; Corrupts registers: 160 156 ; AX, BL, CX, DX, SI, DI 161 157 ;-------------------------------------------------------------------- 162 158 StartDetectionWithDriveSelectByteInBHandStringInCX: 163 %ifdef MODULE_8BIT_IDE_ADVANCED164 mov al, [cs:bp+IDEVARS.bDevice]165 cmp al, DEVICE_8BIT_XTCF_PIO8166 jb SHORT .DoNotSkipSlaveDriveDetection167 cmp al, DEVICE_8BIT_XTCF_DMA168 ja SHORT .DoNotSkipSlaveDriveDetection169 170 ; XT-CF do not support slave drives so skip detection171 test bh, FLG_DRVNHEAD_DRV172 jnz SHORT NoSlaveDriveAvailable173 .DoNotSkipSlaveDriveDetection:174 %endif ; MODULE_8BIT_IDE_ADVANCED175 176 159 call DetectPrint_StartDetectWithMasterOrSlaveStringInCXandIdeVarsInCSBP 177 160 … … 221 204 ; Nothing 222 205 ; Returns: 223 ; CF: 206 ; CF: Set (from DetectPrint_NullTerminatedStringFromCSSIandSetCF) 224 207 ; Corrupts registers: 225 208 ; AX, SI … … 248 231 call AtaID_VerifyFromESSI 249 232 pop bx 250 j cSHORT DetectDrives_DriveNotFound233 jnz SHORT DetectDrives_DriveNotFound 251 234 call CreateDPT_FromAtaInformation 252 235 jc SHORT DetectDrives_DriveNotFound -
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm
r547 r567 60 60 ;-------------------------------------------------------------------- 61 61 DetectPrint_StartDetectWithMasterOrSlaveStringInCXandIdeVarsInCSBP: 62 mov ax, [cs:bp+IDEVARS.wBasePort] ; for IDE: AX=port address, DH=.bDevice63 ; fall throughto DetectPrint_StartDetectWithAutodetectedBasePortInAXandIdeVarsInCSBP62 mov ax, [cs:bp+IDEVARS.wBasePort] ; For IDE: AX=port address, DH=.bDevice 63 ; Fall to DetectPrint_StartDetectWithAutodetectedBasePortInAXandIdeVarsInCSBP 64 64 65 65 ;-------------------------------------------------------------------- … … 75 75 ;-------------------------------------------------------------------- 76 76 DetectPrint_StartDetectWithAutodetectedBasePortInAXandIdeVarsInCSBP: 77 mov dx, [cs:bp+IDEVARS.bDevice-1] ; for Serial: AL=port address>>2, AH=baud rate77 mov dx, [cs:bp+IDEVARS.bDevice-1] ; For Serial: AL=port address>>2, AH=baud rate 78 78 ; DL=COM number character, DH=.bDevice 79 push bp ; setup stack for call to79 push bp ; Setup stack for call to 80 80 mov bp, sp ; BootMenuPrint_FormatCSSIfromParamsInSSBP 81 81 … … 89 89 90 90 %ifdef MODULE_SERIAL 91 cmp dh, DEVICE_SERIAL_PORT 91 cmp dh, DEVICE_SERIAL_PORT ; Check if this is a serial device 92 92 93 93 jnz .pushAndPrint ; CX = string to print, AX = port address, DX won't be used -
trunk/XTIDE_Universal_BIOS/Src/Initialization/FloppyDrive.asm
r551 r567 161 161 ;-------------------------------------------------------------------- 162 162 FloppyDrive_GetCountFromBIOS_or_BDA: 163 push es 164 163 %ifdef USE_AT 165 164 ; Reads Floppy Drive Count from BIOS. 166 165 ; Does not work on most XT systems. Call .GetCountFromBDA 167 166 ; if this function fails. 168 %ifdef USE_AT 167 168 push es 169 169 push di 170 170 push bx … … 181 181 pop bx 182 182 pop di 183 183 pop es 184 185 %else ; ifndef USE_AT 184 186 ; Reads Floppy Drive Count (0...4) from BIOS Data Area. 185 187 ; This function should be used only if .GetCountFromBIOS fails. 186 %else ; ifndef USE_AT 187 LOAD_BDA_SEGMENT_TO es, ax 188 mov al, [es:BDA.wEquipment] ; Load Equipment WORD low byte 188 189 push ds 190 LOAD_BDA_SEGMENT_TO ds, ax 191 mov al, [BDA.wEquipment] ; Load Equipment WORD low byte 192 pop ds 189 193 190 194 %ifdef USE_UNDOC_INTEL … … 200 204 %endif ; USE_AT 201 205 202 pop es 203 ret 206 ret -
trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm
r561 r567 47 47 mov [BIOS_BOOT_LOADER_INTERRUPT_19h*4+2], cs 48 48 49 %ifdef MODULE_VERY_LATE_INIT IALIZATION49 %ifdef MODULE_VERY_LATE_INIT 50 50 push es 51 ; Install special INT 13h hand er that initializes XTIDE Universal BIOS51 ; Install special INT 13h handler that initializes XTIDE Universal BIOS 52 52 ; when our INT 19h is not called 53 53 les ax, [BIOS_DISK_INTERRUPT_13h*4] ; Load system INT 13h handler … … 95 95 ; Nothing 96 96 ; Corrupts registers: 97 ; AX, CX, DX, SI, DI97 ; AX, BX, CX, DX, SI, DI 98 98 ;-------------------------------------------------------------------- 99 99 %ifdef MODULE_COMPATIBLE_TABLES … … 101 101 %ifndef USE_AT 102 102 test BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_FULLMODE 103 jz SHORT . CompatibleDPTsCreated; Only Full operating mode has extra RAM to spare103 jz SHORT .SkipToReturn ; Only Full operating mode has extra RAM to spare 104 104 %endif 105 105 106 mov bx, HD0_DPT_POINTER_41h * 4 106 107 mov dl, 80h 107 call FindDPT_ForDriveNumberInDL ; DPT to DS:DI 108 jc SHORT .FindForDrive81h ; Store nothing if not our drive 108 .FindForNextDrive: 109 call FindDPT_ForDriveNumberInDL ; DPT to DS:DI 110 jc SHORT .NextDrive ; Store nothing if not our drive 109 111 112 push dx 110 113 call CompatibleDPT_CreateToAXSIforDriveDL 111 mov [es:HD0_DPT_POINTER_41h*4], si 112 mov [es:HD0_DPT_POINTER_41h*4+2], ax 114 pop dx 113 115 114 .FindForDrive81h: 115 mov dl, 81h 116 call FindDPT_ForDriveNumberInDL 117 jc SHORT .CompatibleDPTsCreated 116 mov [es:bx], si 117 mov [es:bx+2], ax 118 118 119 call CompatibleDPT_CreateToAXSIforDriveDL 120 mov [es:HD1_DPT_POINTER_46h*4], si 121 mov [es:HD1_DPT_POINTER_46h*4+2], ax 122 .CompatibleDPTsCreated: 119 .NextDrive: 120 inc dx 121 add bx, (HD1_DPT_POINTER_46h - HD0_DPT_POINTER_41h) * 4 122 cmp dl, 82h 123 jb SHORT .FindForNextDrive 124 125 .SkipToReturn: 123 126 %endif ; MODULE_COMPATIBLE_TABLES 124 127 ret
Note:
See TracChangeset
for help on using the changeset viewer.