Changeset 567 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Initialization


Ignore:
Timestamp:
May 26, 2014, 1:25:15 PM (11 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes:

  • Renamed MODULE_FEATURE_SETS to MODULE_POWER_MANAGEMENT.
  • Renamed MODULE_VERY_LATE_INITIALIZATION to MODULE_VERY_LATE_INIT and removed it from the official builds.
  • Removed the code that skips detection of slave drives on XT-CF controllers since slave drives can be used with Lo-tech ISA CompactFlash boards.
  • Added autodetection of the SVC ADP50L controller to XTIDECFG.
  • The autodetection of XT-CF controllers now requires MODULE_8BIT_IDE_ADVANCED in the loaded BIOS.
  • Fixed a bug in XTIDECFG from r502 where the "Base (cmd block) address" menu option would be displayed when a serial device was selected as the IDE controller.
  • XTIDECFG would display the "Enable interrupt" menu option for the XTIDE r1 but not for the XTIDE r2. It's now displayed for both controller types.
  • Disabled the "Internal Write Cache" menu option in the Master/Slave Drive menus for serial device type drives.
  • Optimizations and other fixes.
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  
    8888    call    AdvAtaInit_LoadMasterDPTtoDSSIifSlaveInDSDI
    8989    call    Vision_InitializeWithIDinAHandConfigInAL
     90    xor     ax, ax                      ; Success
    9091
    9192    pop     si
     
    9394
    9495.NoAdvancedController:
    95     xor     ax, ax                      ; Success
    9696    ret
    9797
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm

    r550 r567  
    2727;       ES:SI:  Ptr to 512-byte ATA information read from the drive
    2828;   Returns:
    29 ;       CF:     Set if failed to verify ATA-ID
    30 ;               Cleared if ATA-ID verified successfully
     29;       ZF:     Set if ATA-ID verified successfully
     30;               Cleared if failed to verify ATA-ID
    3131;   Corrupts registers:
    3232;       AX, BX, CX
     
    4141    ; Verify P-CHS cylinders
    4242    mov     bx, ATA1.wCylCnt
    43     mov     cx, MAX_VALID_PCHS_CYLINDERS
    44     call    .CompareCHorSfromOffsetBXtoMaxValueInCX
     43    mov     ax, MAX_VALID_PCHS_CYLINDERS
     44    call    .CompareCHorSfromOffsetBXtoMaxValueInAX
    4545
    4646    mov     bl, ATA1.wHeadCnt & 0FFh
    47     mov     cx, MAX_VALID_PCHS_HEADS
    48     call    .CompareCHorSfromOffsetBXtoMaxValueInCX
     47    mov     ax, MAX_VALID_PCHS_HEADS
     48    call    .CompareCHorSfromOffsetBXtoMaxValueInAX
    4949
    5050    mov     bl, ATA1.wSPT & 0FFh
    51     mov     cl, MAX_VALID_PCHS_SECTORS_PER_TRACK
    52     call    .CompareCHorSfromOffsetBXtoMaxValueInCX
     51    mov     al, MAX_VALID_PCHS_SECTORS_PER_TRACK
     52    call    .CompareCHorSfromOffsetBXtoMaxValueInAX
    5353
    5454    ; Check signature byte. It is only found on ATA-5 and later. It should be zero on
     
    6262    ; Check checksum byte since signature was present
    6363    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
    7570;       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
    8881    jbe     SHORT .ValidPCHorSinOffsetBX
    8982.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:
    9186.FailedToVerifyAtaID:
    92     stc                     ; Set carry to indicate invalid ATA-ID
    9387.ValidPCHorSinOffsetBX:
    9488    ret
     
    9791;--------------------------------------------------------------------
    9892; Writes user defined limits from ROMVARS to ATA ID read from the drive.
    99 ; Modifying the ATA ID reduces code and possibilites for bugs since
    100 ; only little furher checks are needed elsewhere.
     93; Modifying the ATA ID reduces code and possibilities for bugs since
     94; only little further checks are needed elsewhere.
    10195;
    10296; AtaID_ModifyESSIforUserDefinedLimitsAndReturnTranslateModeInDX
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm

    r558 r567  
    6262; if serial drive detected, do not scan (avoids duplicate drives and isn't needed - we already have a connection)
    6363;
    64     call    FindDPT_ToDSDIforSerialDevice   ; does not modify AX
     64    call    FindDPT_ToDSDIforSerialDevice   ; Does not modify AX
    6565    jnc     .AddHardDisks
    6666
     
    6868
    6969%ifdef MODULE_HOTKEYS
    70     cmp     al, COM_DETECT_HOTKEY_SCANCODE  ; Set by last call to HotkeyBar_UpdateDuringDriveDetection above
     70    cmp     al, COM_DETECT_HOTKEY_SCANCODE  ; Set by last call to HotkeyBar_UpdateDuringDriveDetection above
    7171    je      .DriveDetectLoop
    7272%endif
     
    134134    mov     [RAMVARS.xlateVars+XLATEVARS.bFlopCntAndFirst], al
    135135%endif
    136 
    137 %ifdef MODULE_8BIT_IDE_ADVANCED
    138 NoSlaveDriveAvailable:
    139 %endif
    140136    ret
    141137
     
    156152;       ES:     Zero (BDA segment)
    157153;   Returns:
    158 ;       Nothing
     154;       Nothing
    159155;   Corrupts registers:
    160156;       AX, BL, CX, DX, SI, DI
    161157;--------------------------------------------------------------------
    162158StartDetectionWithDriveSelectByteInBHandStringInCX:
    163 %ifdef MODULE_8BIT_IDE_ADVANCED
    164     mov     al, [cs:bp+IDEVARS.bDevice]
    165     cmp     al, DEVICE_8BIT_XTCF_PIO8
    166     jb      SHORT .DoNotSkipSlaveDriveDetection
    167     cmp     al, DEVICE_8BIT_XTCF_DMA
    168     ja      SHORT .DoNotSkipSlaveDriveDetection
    169 
    170     ; XT-CF do not support slave drives so skip detection
    171     test    bh, FLG_DRVNHEAD_DRV
    172     jnz     SHORT NoSlaveDriveAvailable
    173 .DoNotSkipSlaveDriveDetection:
    174 %endif ; MODULE_8BIT_IDE_ADVANCED
    175 
    176159    call    DetectPrint_StartDetectWithMasterOrSlaveStringInCXandIdeVarsInCSBP
    177160
     
    221204;       Nothing
    222205;   Returns:
    223 ;       CF:     Set (from DetectPrint_NullTerminatedStringFromCSSIandSetCF)
     206;       CF:     Set (from DetectPrint_NullTerminatedStringFromCSSIandSetCF)
    224207;   Corrupts registers:
    225208;       AX, SI
     
    248231    call    AtaID_VerifyFromESSI
    249232    pop     bx
    250     jc      SHORT DetectDrives_DriveNotFound
     233    jnz     SHORT DetectDrives_DriveNotFound
    251234    call    CreateDPT_FromAtaInformation
    252235    jc      SHORT DetectDrives_DriveNotFound
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm

    r547 r567  
    6060;--------------------------------------------------------------------
    6161DetectPrint_StartDetectWithMasterOrSlaveStringInCXandIdeVarsInCSBP:
    62     mov     ax, [cs:bp+IDEVARS.wBasePort]   ; for IDE: AX=port address, DH=.bDevice
    63     ; fall through to DetectPrint_StartDetectWithAutodetectedBasePortInAXandIdeVarsInCSBP
     62    mov     ax, [cs:bp+IDEVARS.wBasePort]   ; For IDE: AX=port address, DH=.bDevice
     63    ; Fall to DetectPrint_StartDetectWithAutodetectedBasePortInAXandIdeVarsInCSBP
    6464
    6565;--------------------------------------------------------------------
     
    7575;--------------------------------------------------------------------
    7676DetectPrint_StartDetectWithAutodetectedBasePortInAXandIdeVarsInCSBP:
    77     mov     dx, [cs:bp+IDEVARS.bDevice-1]   ; for Serial: AL=port address>>2, AH=baud rate
     77    mov     dx, [cs:bp+IDEVARS.bDevice-1]   ; For Serial: AL=port address>>2, AH=baud rate
    7878                                            ;             DL=COM number character, DH=.bDevice
    79     push    bp                              ; setup stack for call to
     79    push    bp                              ; Setup stack for call to
    8080    mov     bp, sp                          ; BootMenuPrint_FormatCSSIfromParamsInSSBP
    8181
     
    8989
    9090%ifdef MODULE_SERIAL
    91     cmp     dh, DEVICE_SERIAL_PORT          ; Check if this is a serial device
     91    cmp     dh, DEVICE_SERIAL_PORT          ; Check if this is a serial device
    9292
    9393    jnz     .pushAndPrint                   ; CX = string to print, AX = port address, DX won't be used
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/FloppyDrive.asm

    r551 r567  
    161161;--------------------------------------------------------------------
    162162FloppyDrive_GetCountFromBIOS_or_BDA:
    163     push    es
    164 
     163%ifdef USE_AT
    165164; Reads Floppy Drive Count from BIOS.
    166165; Does not work on most XT systems. Call .GetCountFromBDA
    167166; if this function fails.
    168 %ifdef USE_AT
     167
     168    push    es
    169169    push    di
    170170    push    bx
     
    181181    pop     bx
    182182    pop     di
    183 
     183    pop     es
     184
     185%else ; ifndef USE_AT
    184186; Reads Floppy Drive Count (0...4) from BIOS Data Area.
    185187; 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
    189193
    190194%ifdef USE_UNDOC_INTEL
     
    200204%endif ; USE_AT
    201205
    202     pop     es
    203     ret
     206    ret
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm

    r561 r567  
    4747    mov     [BIOS_BOOT_LOADER_INTERRUPT_19h*4+2], cs
    4848
    49 %ifdef MODULE_VERY_LATE_INITIALIZATION
     49%ifdef MODULE_VERY_LATE_INIT
    5050    push    es
    51     ; Install special INT 13h hander that initializes XTIDE Universal BIOS
     51    ; Install special INT 13h handler that initializes XTIDE Universal BIOS
    5252    ; when our INT 19h is not called
    5353    les     ax, [BIOS_DISK_INTERRUPT_13h*4] ; Load system INT 13h handler
     
    9595;       Nothing
    9696;   Corrupts registers:
    97 ;       AX, CX, DX, SI, DI
     97;       AX, BX, CX, DX, SI, DI
    9898;--------------------------------------------------------------------
    9999%ifdef MODULE_COMPATIBLE_TABLES
     
    101101%ifndef USE_AT
    102102    test    BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_FULLMODE
    103     jz      SHORT .CompatibleDPTsCreated    ; Only Full operating mode has extra RAM to spare
     103    jz      SHORT .SkipToReturn             ; Only Full operating mode has extra RAM to spare
    104104%endif
    105105
     106    mov     bx, HD0_DPT_POINTER_41h * 4
    106107    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
    109111
     112    push    dx
    110113    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
    113115
    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
    118118
    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:
    123126%endif ; MODULE_COMPATIBLE_TABLES
    124127    ret
Note: See TracChangeset for help on using the changeset viewer.