- Timestamp:
- Feb 9, 2013, 5:25:53 PM (12 years ago)
- google:author:
- aitotat@gmail.com
- Location:
- trunk/XTIDE_Universal_BIOS_Configurator_v2/Src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/AutoConfigure.asm
r497 r502 70 70 mov ax, DISABLE_WRITE_CACHE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION) | FLG_DRVPARAMS_BLOCKMODE 71 71 mov [di+ROMVARS.ideVars0+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags], ax 72 mov [di+ROMVARS.ideVars0+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags], ax 73 72 74 mov [di+ROMVARS.ideVars1+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags], ax 75 mov [di+ROMVARS.ideVars1+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags], ax 76 73 77 mov [di+ROMVARS.ideVars2+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags], ax 78 mov [di+ROMVARS.ideVars2+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags], ax 79 74 80 mov [di+ROMVARS.ideVars3+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags], ax 81 mov [di+ROMVARS.ideVars3+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags], ax 75 82 ret 76 83 … … 95 102 jz SHORT .AllPortsAlreadyDetected 96 103 push cx 97 call IdeAutodetect_DetectIdeDeviceFromPortDX 104 call IdeAutodetect_DetectIdeDeviceFromPortDXAndReturnControlBlockInCX 105 mov bx, cx 98 106 pop cx 99 107 jc SHORT .DetectFromNextPort … … 101 109 ; Device found from port DX, Device Type returned in AL 102 110 inc cx ; Increment number of controllers found 103 call GetControlBlockPortToBXfromDeviceTypeInALandBasePortInDX104 111 mov [si+IDEVARS.wBasePort], dx 105 112 mov [si+IDEVARS.wControlBlockPort], bx … … 112 119 jmp SHORT .DetectFromNextPort 113 120 .AllPortsAlreadyDetected: 114 ret115 116 117 ;--------------------------------------------------------------------118 ; GetControlBlockPortToBXfromDeviceTypeInALandBasePortInDX119 ; Parameters:120 ; AL: Device Type121 ; DX: Base port122 ; Returns:123 ; BX: Control Block Port124 ; Corrupts registers:125 ; Nothing126 ;--------------------------------------------------------------------127 ALIGN JUMP_ALIGN128 GetControlBlockPortToBXfromDeviceTypeInALandBasePortInDX:129 mov bx, dx130 cmp al, DEVICE_8BIT_XTIDE_REV1131 jae SHORT .NonStandardControlBlockPortLocation132 133 ; Standard IDE Devices134 add bx, STANDARD_CONTROL_BLOCK_OFFSET135 ret136 137 .NonStandardControlBlockPortLocation:138 cmp al, DEVICE_8BIT_JRIDE_ISA139 je SHORT .JrIdeIsaDoesNotNeedControlBlockAddress140 141 ; 8-bit Devices142 add bx, BYTE XTIDE_CONTROL_BLOCK_OFFSET ; XT-CF also143 .JrIdeIsaDoesNotNeedControlBlockAddress:144 121 ret 145 122 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/IdeAutodetect.asm
r498 r502 22 22 23 23 ;-------------------------------------------------------------------- 24 ; IdeAutodetect_DetectIdeDeviceFromPortDX 24 ; IdeAutodetect_DetectIdeDeviceFromPortDXAndReturnControlBlockInCX 25 25 ; Parameters: 26 26 ; DX: IDE Base Port … … 28 28 ; Returns: 29 29 ; AL: Device Type 30 ; CX: Control Block Base port (detected since there is no 31 ; standard address for Tetriary and Quaternary IDE controllers) 30 32 ; CF: Clear if IDE Device found 31 33 ; Set if IDE Device not found 32 34 ; Corrupts registers: 33 ; AH, BX , CX34 ;-------------------------------------------------------------------- 35 IdeAutodetect_DetectIdeDeviceFromPortDX :35 ; AH, BX 36 ;-------------------------------------------------------------------- 37 IdeAutodetect_DetectIdeDeviceFromPortDXAndReturnControlBlockInCX: 36 38 cmp dx, FIRST_MEMORY_SEGMENT_ADDRESS 37 39 jb SHORT .DetectPortMappedDevices 38 40 39 ; Try to detect JR-IDE/ISA (only if MODULE_8BIT_IDE_ADVANCED is present)41 ; *** Try to detect JR-IDE/ISA (only if MODULE_8BIT_IDE_ADVANCED is present) *** 40 42 test WORD [di+ROMVARS.wFlags], FLG_ROMVARS_MODULE_8BIT_IDE_ADVANCED 41 43 jz SHORT .SkipRestOfDetection … … 43 45 push ds 44 46 mov ds, dx 45 cli ; Disable Interrupts47 cli ; Disable Interrupts 46 48 mov ah, [JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET + STATUS_REGISTER_in] 47 49 mov al, [JRIDE_CONTROL_BLOCK_REGISTER_WINDOW_OFFSET + ALTERNATE_STATUS_REGISTER_in] 48 sti ; Enable Interrupts50 sti ; Enable Interrupts 49 51 pop ds 50 52 call CompareIdeStatusRegistersFromALandAH 51 mov al, DEVICE_8BIT_JRIDE_ISA 52 ret 53 mov al, DEVICE_8BIT_JRIDE_ISA ; Assume CF was cleared 54 ret ; No need to return Control Block Port 53 55 .DetectPortMappedDevices: 54 56 55 57 56 ; Try to detect Standard 16- and 32-bit IDE Devices58 ; *** Try to detect Standard 16- and 32-bit IDE Devices *** 57 59 mov bh, DEVICE_16BIT_ATA ; Assume 16-bit ISA slot for AT builds 58 60 call Buffers_IsXTbuildLoaded 59 61 eCMOVE bh, DEVICE_8BIT_ATA ; Assume 8-bit ISA slot for XT builds 62 60 63 mov bl, STATUS_REGISTER_in 61 64 mov cx, STANDARD_CONTROL_BLOCK_OFFSET + ALTERNATE_STATUS_REGISTER_in 65 .RedetectTertiaryOrQuaternaryWithDifferentAlternativeStatusRegisterPort: 62 66 call DetectIdeDeviceFromPortDXwithStatusRegOffsetsInBLandCX 63 67 mov al, bh 64 68 jnc SHORT .IdeDeviceFound 65 69 70 ; 16- or 32-bit IDE Device was not found but we may have used wrong Control Block port if we were trying 71 ; to detect Tertiary or Quaternary IDE controllers. Control Block port location is not standardized. For 72 ; example Promise FloppyMAX has Control Block at STANDARD_CONTROL_BLOCK_OFFSET but Sound Blaster 16 (CT2290) 73 ; use DEVICE_ATA_SECONDARY_PORTCTRL for Tertiary and Quaternary even though only Secondary should use that. 74 cmp cx, STANDARD_CONTROL_BLOCK_OFFSET + ALTERNATE_STATUS_REGISTER_in 75 jne SHORT .AlreadyTriedAlternativeControlBlock 76 mov cx, DEVICE_ATA_SECONDARY_PORTCTRL + ALTERNATE_STATUS_REGISTER_in 77 sub cx, dx ; Offset to add to DX 78 cmp dx, DEVICE_ATA_TERTIARY_PORT 79 je SHORT .RedetectTertiaryOrQuaternaryWithDifferentAlternativeStatusRegisterPort 80 cmp dx, DEVICE_ATA_QUATERNARY_PORT 81 je SHORT .RedetectTertiaryOrQuaternaryWithDifferentAlternativeStatusRegisterPort 82 .AlreadyTriedAlternativeControlBlock: 83 66 84 67 85 ; Detect 8-bit devices only if MODULE_8BIT_IDE is available … … 69 87 jz SHORT .SkipRestOfDetection 70 88 71 ; Try to detect XT-CF89 ; *** Try to detect XT-CF *** 72 90 mov bl, STATUS_REGISTER_in << 1 73 91 mov cx, (XTIDE_CONTROL_BLOCK_OFFSET + ALTERNATE_STATUS_REGISTER_in) << 1 74 92 call DetectIdeDeviceFromPortDXwithStatusRegOffsetsInBLandCX 93 rcl ax, 1 ; Store CF 94 shr cx, 1 ; XTIDE_CONTROL_BLOCK_OFFSET + ALTERNATE_STATUS_REGISTER_in 95 rcr ax, 1 ; Restore CF 75 96 mov al, DEVICE_8BIT_XTCF_PIO8 76 97 jnc SHORT .IdeDeviceFound 77 98 78 ; Try to detect 8-bit XT-IDE rev 1 or rev 2. 99 100 ; *** Try to detect 8-bit XT-IDE rev 1 or rev 2 *** 79 101 ; Note that A0<->A3 address swaps Status Register and Alternative 80 102 ; Status Register addresses. That is why we need another step 81 103 ; to check is this XT-IDE rev 1 or rev 2. 82 shr cx, 183 104 call DetectIdeDeviceFromPortDXwithStatusRegOffsetsInBLandCX 84 105 jc SHORT .SkipRestOfDetection ; No XT-IDE rev 1 or rev 2 found … … 99 120 je SHORT .IdeDeviceFound 100 121 mov al, DEVICE_8BIT_XTIDE_REV1 ; We must have rev 1 101 clc102 122 .IdeDeviceFound: 123 sub cl, ALTERNATE_STATUS_REGISTER_in ; Clear CF 124 add cx, dx ; CX = Control Block address 103 125 ret 104 126 .SkipRestOfDetection: … … 156 178 157 179 ; Bytes were the same but it is possible they were both FFh, for 158 ; example. We must make sure bit are what is expected from valid 159 ; IDE Status Register. 180 ; example. We must make sure bits are what is expected from valid 181 ; IDE Status Register. So far all drives I've tested return 50h 182 ; (FLG_STATUS_DRDY and FLG_STATUS_DSC set) but I don't want to assume 183 ; just yet that all drives report 50h. 160 184 test al, FLG_STATUS_BSY | FLG_STATUS_DF | FLG_STATUS_DRQ | FLG_STATUS_ERR 161 185 jnz SHORT .InvalidStatusRegister ; Busy or Errors cannot be set -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/IdeControllerMenu.asm
r491 r502 83 83 at MENUITEM.szQuickInfo, dw g_szNfoIdeCmdPort 84 84 at MENUITEM.szHelp, dw g_szHelpIdeCmdPort 85 at MENUITEM.bFlags, db NULL85 at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE 86 86 at MENUITEM.bType, db TYPE_MENUITEM_HEX 87 87 at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL … … 357 357 push cs 358 358 pop ds 359 call .EnableOrDisableCommandBlockPort360 359 call .EnableOrDisableControlBlockPort 361 360 call .DisableIRQchannelSelection … … 368 367 369 368 ;-------------------------------------------------------------------- 370 ; .EnableOrDisableCommandBlockPort371 ; Parameters:372 ; SS:BP: Menu handle373 ; Returns:374 ; Nothing375 ; Corrupts registers:376 ; AX, BX377 ;--------------------------------------------------------------------378 ALIGN JUMP_ALIGN379 .EnableOrDisableCommandBlockPort:380 mov bx, [cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]381 call Buffers_GetRomvarsValueToAXfromOffsetInBX382 mov bx, g_MenuitemIdeControllerCommandBlockAddress383 cmp al, DEVICE_8BIT_XTCF_PIO8384 jb SHORT .EnableMenuitemFromCSBX385 cmp al, DEVICE_SERIAL_PORT386 je SHORT .DisableMenuitemFromCSBX387 cmp al, DEVICE_8BIT_XTCF_MEMMAP388 ja SHORT .EnableMenuitemFromCSBX389 jmp SHORT .DisableMenuitemFromCSBX390 391 392 ;--------------------------------------------------------------------393 369 ; .EnableOrDisableControlBlockPort 394 370 ; Parameters: … … 405 381 mov bx, g_MenuitemIdeControllerControlBlockAddress 406 382 cmp al, DEVICE_8BIT_XTCF_PIO8 407 jb SHORT .EnableMenuitemFromCSBX 383 jb SHORT .EnableMenuitemFromCSBX ; Not needed for XT-CF and JR-IDE/ISA 408 384 jmp SHORT .DisableMenuitemFromCSBX 409 385 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm
r497 r502 201 201 g_szItemIdeEnIRQ: db "Enable interrupt",NULL 202 202 g_szItemIdeIRQ: db "IRQ",NULL 203 g_szItemIdeXTCFwindow: db "XT-CF Sector Window",NULL203 g_szItemIdeXTCFwindow: db "XT-CF v2 Sector Window",NULL 204 204 g_szItemSerialCOM: db "COM Port",NULL 205 205 g_szItemSerialBaud: db "Baud Rate",NULL … … 213 213 g_szDlgIdeEnIRQ: db "Enable interrupt?",NULL 214 214 g_szDlgIdeIRQ: db "Enter IRQ channel (2...7 for 8-bit controllers, 2...15 for any other controller).",NULL 215 g_szDlgIdeXTCFwindow: db "XT-CF Sector Window segment (A000h...E800h).",NULL215 g_szDlgIdeXTCFwindow: db "XT-CF v2 Sector Window segment (A000h...E800h).",NULL 216 216 217 217 g_szNfoIdeBackToCfgMenu:db "Back to XTIDE Universal BIOS Configuration Menu.",NULL … … 223 223 g_szNfoIdeEnIRQ: db "Interrupt or polling mode.",NULL 224 224 g_szNfoIdeIRQ: db "IRQ channel to use.",NULL 225 g_szNfoIdeXTCFwindow: db "Segment Address for XT-CF 4 kiB Sector Access Window.",NULL225 g_szNfoIdeXTCFwindow: db "Segment Address for XT-CF v2 4 kiB Sector Access Window.",NULL 226 226 g_szNfoIdeSerialCOM: db "Select a COM port by number.",NULL 227 227 g_szNfoIdeSerialBaud: db "Select the COM port's Baud Rate. The server must match this speed." … … 250 250 db "XTIDE rev 1",LF 251 251 db "XTIDE rev 2 or modded rev 1",LF 252 db " Lo-tech XT-CFin PIO mode",LF253 db " Lo-tech XT-CFin DMA mode",LF254 db " Lo-tech XT-CFin memory mode",LF252 db "XT-CF v2/v3/Lite in PIO mode",LF 253 db "XT-CF v2 in DMA mode",LF 254 db "XT-CF v2 in memory mode",LF 255 255 db "JR-IDE/ISA",LF 256 256 db "Serial port virtual device",NULL
Note:
See TracChangeset
for help on using the changeset viewer.