Changeset 116 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h


Ignore:
Timestamp:
Feb 26, 2011, 11:55:06 PM (14 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes to all parts of the project:

  • Removed a redundant macro (HPIO_NORMALIZE_PTR)
  • Deleted XTIDE_Universal_BIOS/Inc/BiosData.inc since that was also redundant.
  • Size optimization: Changed the LOAD_BDA_SEGMENT_TO macro to use the stack on 186+ processors (the old behaviour can still be used where needed).
  • Made other minor size optimizations and cleanups to various functions, mostly in the Int13h handler.
Location:
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1h_HStatus.asm

    r35 r116  
    1 ; File name     :   AH1h_HStatus.asm
    2 ; Project name  :   IDE BIOS
    3 ; Created date  :   27.9.2007
    4 ; Last update   :   24.8.2010
    5 ; Author        :   Tomi Tilli
     1; Project name  :   XTIDE Universal BIOS
    62; Description   :   Int 13h function AH=1h, Read Disk Status.
    73
     
    3026
    3127    LOAD_BDA_SEGMENT_TO ds, di
    32     xor     ah, ah                  ; Zero AH
    33     cmp     ah, [BDA.bHDLastSt]     ; Set CF if error code is non-zero
    3428    mov     ah, [BDA.bHDLastSt]     ; Last error to AH
     29    cmp     ah, 1                   ; Set CF if error code is zero
     30    cmc                             ; Invert CF
    3531
    3632    pop     ds
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH25h_HDrvID.asm

    r88 r116  
    108108;--------------------------------------------------------------------
    109109; Returns timeout value for drive detection.
    110 ; Long timeout is required for detecing first drive to make sure it is
     110; Long timeout is required for detecting first drive to make sure it is
    111111; ready after power-on (ATA specification says up to 31 seconds).
    112112; Short timeout is used for additional drives to prevent long boot time
     
    123123ALIGN JUMP_ALIGN
    124124AH25h_GetDriveDetectionTimeoutValue:
     125    mov     cl, B_TIMEOUT_RESET         ; Load long timeout (assume first drive)
    125126    cmp     BYTE [RAMVARS.bDrvCnt], 0   ; Detecting first drive?
    126     je      SHORT .GetLongDelayForInitialDetection
     127    je      SHORT .Return
    127128    mov     cl, B_TIMEOUT_DRVINFO       ; Load short timeout
     129ALIGN JUMP_ALIGN, ret   ; This speed optimization may be unnecessary
     130.Return:
    128131    ret
    129 ALIGN JUMP_ALIGN
    130 .GetLongDelayForInitialDetection:
    131     mov     cl, B_TIMEOUT_RESET         ; Load long timeout
    132     ret
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AHCh_HSeek.asm

    r84 r116  
    1 ; File name     :   AHCh_HSeek.asm
    2 ; Project name  :   IDE BIOS
    3 ; Created date  :   13.12.2007
    4 ; Last update   :   14.1.2011
    5 ; Author        :   Tomi Tilli,
    6 ;               :   Krister Nordvall (optimizations)
     1; Project name  :   XTIDE Universal BIOS
    72; Description   :   Int 13h function AH=Ch, Seek.
    83
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AHDh_HReset.asm

    r88 r116  
    100100    ; HSR2: Check_status
    101101    mov     cl, B_TIMEOUT_RESET         ; Reset timeout delay
    102     mov     dx, [RAMVARS.wIdeBase]      ; Load base port address
    103     jmp     HStatus_WaitBsyBase
     102    jmp     HStatus_WaitBsy
    104103
    105104
     
    125124    call    AH9h_InitializeDriveForUse
    126125    mov     cl, ah                      ; Copy error code to CL
    127 ALIGN JUMP_ALIGN
    128126.InitializeSlave:
    129127    pop     dx                          ; Restore base port address
     
    132130    call    AH9h_InitializeDriveForUse
    133131    mov     ch, ah                      ; Copy error code to CH
    134 ALIGN JUMP_ALIGN
    135132.CombineErrors:
    136133    or      cl, ch                      ; OR error codes, clear CF
    137     jnz     SHORT .ReturnError
    138     ret
    139 .ReturnError:
     134    jz      SHORT .Return
    140135    mov     ah, RET_HD_RESETFAIL        ; Load Reset Failed error code
    141136    stc
     137.Return:
    142138    ret
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Common/HIRQ.asm

    r86 r116  
    1 ; Project name  :   IDE BIOS
     1; Project name  :   XTIDE Universal BIOS
    22; Description   :   Interrupt handling related functions.
    33
     
    3535    push    ds
    3636
    37     LOAD_BDA_SEGMENT_TO ds, ax          ; Zero AX
     37    LOAD_BDA_SEGMENT_TO ds, ax, !       ; Zero AX
    3838    cli                                 ; Disable interrupts
    3939    cmp     al, [BDA.bHDTaskFlg]        ; Task flag already set?
     
    6868HIRQ_ClearTaskFlag:
    6969    push    ds
    70     LOAD_BDA_SEGMENT_TO ds, ax      ; Also zero AX
     70    LOAD_BDA_SEGMENT_TO ds, ax, !       ; Also zero AX
    7171    mov     [BDA.bHDTaskFlg], al
    7272    pop     ds
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Common/HPIO.asm

    r86 r116  
    1 ; Project name  :   IDE BIOS
     1; Project name  :   XTIDE Universal BIOS
    22; Description   :   PIO transfer functions.
    33
     
    1515
    1616;--------------------------------------------------------------------
    17 ; Normalizes far pointer to that offset overflows won't happen
    18 ; when transferring data using PIO.
    19 ;
    20 ; HPIO_NORMALIZE_PTR
    21 ;   Parameters:
    22 ;       %1:%2:      Far pointer to normalize
    23 ;       %3:         Scratch register
    24 ;       %4:         Scratch register
    25 ;   Returns:
    26 ;       %1:%2:      Normalized far pointer
    27 ;   Corrupts registers:
    28 ;       %3, %4
    29 ;--------------------------------------------------------------------
    30 %macro HPIO_NORMALIZE_PTR 4
    31     mov     %4, %2              ; Copy offset to scratch reg
    32     and     %2, BYTE 0Fh        ; Clear offset bits 15...4
    33     eSHR_IM %4, 4               ; Divide offset by 16
    34     mov     %3, %1              ; Copy segment to scratch reg
    35     add     %3, %4              ; Add shifted offset to segment
    36     mov     %1, %3              ; Set normalized segment
    37 %endmacro
    38 
    39 
    40 ;--------------------------------------------------------------------
    4117; Reads sectors from hard disk using PIO transfer mode.
    4218;
     
    11086    mov     [bp+PIOVARS.fnXfer], bx             ; Store offset to transfer function
    11187    xchg    bx, ax
    112     ; Fall to HPIO_NormalizePtr
    113 
    114 ;--------------------------------------------------------------------
    115 ; Initializes PIOVARS members.
    116 ;
    117 ; HPIO_InitializePIOVARS
     88    ; Fall to HPIO_NormalizeDataPointer
     89
     90;--------------------------------------------------------------------
     91; Normalizes far pointers so that offset overflows won't happen
     92; when transferring data using PIO.
     93;
     94; HPIO_NormalizeDataPointer
    11895;   Parameters:
    11996;       ES:BX:  Ptr to source or destination data buffer
     
    125102;ALIGN JUMP_ALIGN
    126103HPIO_NormalizeDataPointer:
    127     HPIO_NORMALIZE_PTR  es, bx, ax, cx
     104    NORMALIZE_FAR_POINTER es, bx, ax, cx
    128105    ret
    129106
Note: See TracChangeset for help on using the changeset viewer.