Changeset 35 in xtideuniversalbios


Ignore:
Timestamp:
Aug 24, 2010, 6:44:44 PM (14 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Cleaned recent changes a bit to save few bytes.

Location:
trunk/XTIDE_Universal_BIOS/Src
Files:
13 edited

Legend:

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

    r32 r35  
    22; Project name  :   IDE BIOS
    33; Created date  :   21.9.2007
    4 ; Last update   :   1.8.2010
     4; Last update   :   24.8.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Int 13h BIOS functions (Floppy and Hard disk).
     
    9595    ; Special return processing required if target function
    9696    ; returns something in DL
    97     mov     di, Int13h_ReturnFromAnotherBiosWithoutSwappingDrives
     97    mov     di, Int13h_ReturnFromAnotherBiosWithValueInDL
    9898    call    DriveXlate_DoesFunctionReturnSomethingInDL
    9999    jc      SHORT .PushIretAddress
    100     add     di, BYTE Int13h_ReturnFromAnotherBios - Int13h_ReturnFromAnotherBiosWithoutSwappingDrives
     100    add     di, BYTE Int13h_ReturnFromAnotherBios - Int13h_ReturnFromAnotherBiosWithValueInDL
    101101.PushIretAddress:
    102102    pushf                               ; Push FLAGS to simulate INT
     
    133133
    134134;--------------------------------------------------------------------
    135 ; Return handlers from another INT 13h BIOS.
    136 ;
    137 ; Int13h_ReturnFromAnotherBiosWithoutSwappingDrives
     135; Int13h_ReturnFromAnotherBiosWithValueInDL
    138136; Int13h_ReturnFromAnotherBios
    139137;   Parameters:
     
    147145;--------------------------------------------------------------------
    148146ALIGN JUMP_ALIGN
    149 Int13h_ReturnFromAnotherBiosWithoutSwappingDrives:
     147Int13h_ReturnFromAnotherBiosWithValueInDL:
    150148    push    ds
    151149    push    di
    152150    pushf                               ; Store return flags
    153151    call    RamVars_GetSegmentToDS
    154     dec     BYTE [RAMVARS.xlateVars+XLATEVARS.bRecurCnt]
     152    call    DriveXlate_WhenLeavingInt13hWithReturnValueInDL
    155153    jmp     SHORT Int13h_Leave
     154
    156155ALIGN JUMP_ALIGN
    157156Int13h_ReturnFromAnotherBios:
     
    167166; Returns from any BIOS function implemented by this BIOS.
    168167;
    169 ; Int13h_ReturnWithoutSwappingDrives
    170 ; Int13h_StoreErrorCodeToBDAandPopDSDIandReturn
    171 ; Int13h_StoreErrorCodeToBDAandPopXRegsAndReturn
     168; Int13h_ReturnWithValueInDL
    172169; Int13h_PopXRegsAndReturn
    173170; Int13h_PopDiDsAndReturn
     
    181178;--------------------------------------------------------------------
    182179ALIGN JUMP_ALIGN
    183 Int13h_ReturnWithoutSwappingDrives:
     180Int13h_ReturnWithValueInDL:
    184181    pushf
    185     dec     BYTE [RAMVARS.xlateVars+XLATEVARS.bRecurCnt]    ; Preserves CF
    186     call    HError_StoreBiosErrorCodeFromAHtoBDA
    187     jmp     SHORT Int13h_Leave
    188 
    189 ALIGN JUMP_ALIGN
    190 Int13h_StoreErrorCodeToBDAandPopDSDIandReturn:
    191     call    HError_StoreBiosErrorCodeFromAHtoBDA
    192     jmp     SHORT Int13h_PopDiDsAndReturn
    193 
    194 ALIGN JUMP_ALIGN
    195 Int13h_StoreErrorCodeToBDAandPopXRegsAndReturn:
    196     call    HError_StoreBiosErrorCodeFromAHtoBDA
     182    call    DriveXlate_WhenLeavingInt13hWithReturnValueInDL
     183    jmp     SHORT Int13h_LeaveAfterStoringErrorCodeToBDA
     184
    197185ALIGN JUMP_ALIGN
    198186Int13h_PopXRegsAndReturn:
     
    202190    pop     cx
    203191    pop     dx
     192    ; Fall to Int13h_PopDiDsAndReturn
     193
    204194ALIGN JUMP_ALIGN
    205195Int13h_PopDiDsAndReturn:
    206196    pushf
    207197    call    DriveXlate_WhenLeavingInt13h
     198    ; Fall to Int13h_LeaveAfterStoringErrorCodeToBDA
     199
     200Int13h_LeaveAfterStoringErrorCodeToBDA:
     201    LOAD_BDA_SEGMENT_TO ds, di
     202    mov     [BDA.bHDStatus], ah
     203    ; Fall to Int13h_Leave
     204
    208205Int13h_Leave:
    209206    popf
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm

    r32 r35  
    22; Project name  :   IDE BIOS
    33; Created date  :   27.9.2007
    4 ; Last update   :   3.8.2010
     4; Last update   :   24.8.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Int 13h function AH=0h, Disk Controller Reset.
     
    4444    xor     al, al                      ; Zero AL...
    4545    cmp     al, bh                      ; ...and set CF if error
    46     jmp     Int13h_StoreErrorCodeToBDAandPopXRegsAndReturn
     46    jmp     Int13h_PopXRegsAndReturn
    4747
    4848
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH14h_HDiag.asm

    r28 r35  
    22; Project name  :   IDE BIOS
    33; Created date  :   28.9.2007
    4 ; Last update   :   1.8.2010
     4; Last update   :   24.8.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Int 13h function AH=14h, Controller Internal Diagnostic.
     
    3333    jnz     SHORT .ReturnError
    3434    xor     ah, ah                      ; Zero AH and CF since success
    35     jmp     Int13h_StoreErrorCodeToBDAandPopDSDIandReturn
     35    jmp     Int13h_PopDiDsAndReturn
    3636.ReturnError:
    3737    mov     ah, RET_HD_RESETFAIL
    3838    stc
    39     jmp     Int13h_StoreErrorCodeToBDAandPopDSDIandReturn
     39    jmp     Int13h_PopDiDsAndReturn
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH15h_HSize.asm

    r3 r35  
    22; Project name  :   IDE BIOS
    33; Created date  :   28.9.2007
    4 ; Last update   :   12.4.2010
     4; Last update   :   24.8.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Int 13h function AH=15h, Read Disk Drive Size.
     
    4444    mov     ah, 3                               ; Type code = Hard disk
    4545    clc
    46     jmp     Int13h_ReturnWithoutSwappingDrives
     46    jmp     Int13h_ReturnWithValueInDL
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1h_HStatus.asm

    r28 r35  
    22; Project name  :   IDE BIOS
    33; Created date  :   27.9.2007
    4 ; Last update   :   29.7.2010
     4; Last update   :   24.8.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Int 13h function AH=1h, Read Disk Status.
     
    3232    xor     ah, ah                  ; Zero AH
    3333    cmp     ah, [BDA.bHDLastSt]     ; Set CF if error code is non-zero
    34     xchg    ah, [BDA.bHDLastSt]     ; Last error to AH, zero to BDA
     34    mov     ah, [BDA.bHDLastSt]     ; Last error to AH
    3535
    3636    pop     ds
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH2h_HRead.asm

    r28 r35  
    22; Project name  :   IDE BIOS
    33; Created date  :   27.9.2007
    4 ; Last update   :   1.8.2010
     4; Last update   :   24.8.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Int 13h function AH=2h, Read Disk Sectors.
     
    6363    mov     ah, RET_HD_INVALID          ; Invalid value passed
    6464    stc                                 ; Set CF since error
    65     jmp     Int13h_StoreErrorCodeToBDAandPopDSDIandReturn
     65    jmp     Int13h_PopDiDsAndReturn
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH8h_HParams.asm

    r32 r35  
    22; Project name  :   IDE BIOS
    33; Created date  :   27.9.2007
    4 ; Last update   :   3.8.2010
     4; Last update   :   24.8.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Int 13h function AH=8h, Read Disk Drive Parameters.
     
    3838    call    AH8h_GetDriveParameters
    3939    pop     bx
    40     jmp     Int13h_ReturnWithoutSwappingDrives
     40    jmp     Int13h_ReturnWithValueInDL
    4141
    4242ALIGN JUMP_ALIGN
     
    4444    call    Int13h_CallPreviousInt13hHandler
    4545    call    RamVars_GetCountOfKnownDrivesToDL
    46     jmp     Int13h_ReturnWithoutSwappingDrives
     46    jmp     Int13h_ReturnWithValueInDL
    4747
    4848
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm

    r28 r35  
    8282    and     BYTE [di+DPT.bReset], ~FLG_RESET_nSETBLOCK
    8383
    84     ; Force PIO mode 0
    85     ;call   AH9h_ForcePioMode0
    86 
    8784.ReturnNotSuccessfull:
    8885    pop     cx
     
    152149.Return:
    153150    ret
    154 
    155 
    156 ;--------------------------------------------------------------------
    157 ; AH9h_ForcePioMode0
    158 ;   Parameters:
    159 ;       DL:     Drive number
    160 ;       DS:DI:  Ptr to DPT
    161 ;   Returns:
    162 ;       AH:     BIOS Error code
    163 ;       CF:     Cleared if succesfull
    164 ;               Set if any error
    165 ;   Corrupts registers:
    166 ;       AX, BX
    167 ;--------------------------------------------------------------------
    168 ;ALIGN JUMP_ALIGN
    169 ;AH9h_ForcePioMode0:
    170 ;   mov     bh, 08h     ; Parameter to Sector Count Register (PIO Flow Control Transfer Mode 0)
    171 ;   mov     ax, 2303h   ; Feature: Set transfer mode based on value in Sector Count register
    172 ;   int     13h
    173 ;   jc      SHORT .FailedToForcePIO0
    174 ;   ; Debug output here
    175 ;   ret
    176 ;.FailedToForcePIO0:
    177 ;   ; Debug output here
    178 ;   ret
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AHDh_HReset.asm

    r33 r35  
    22; Project name  :   IDE BIOS
    33; Created date  :   9.12.2007
    4 ; Last update   :   23.8.2010
     4; Last update   :   24.8.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Int 13h function AH=Dh, Reset Hard Disk (Alternate reset).
     
    2626AHDh_HandlerForResetHardDisk:
    2727    call    AHDh_ResetDrive
    28     jmp     Int13h_StoreErrorCodeToBDAandPopDSDIandReturn
     28    jmp     Int13h_PopDiDsAndReturn
    2929
    3030
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Common/HError.asm

    r34 r35  
    22; Project name  :   IDE BIOS
    33; Created date  :   30.11.2007
    4 ; Last update   :   23.8.2010
     4; Last update   :   24.8.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Error checking functions for BIOS Hard disk functions.
     
    2323ALIGN JUMP_ALIGN
    2424HError_ProcessTimeoutAfterPollingBSYandSomeOtherStatusBit:
    25     push    ds
    26     push    dx
    27 
    2825    call    HError_GetStatusAndErrorRegistersToAXandStoreThemToBDA
    2926    call    GetBiosErrorCodeToAHfromStatusAndErrorRegistersInAX
    30     jc      SHORT StoreErrorCodeFromAHtoBDA
     27    jc      SHORT .ReturnErrorCodeInAH
    3128    mov     ah, RET_HD_TIMEOUT          ; Force timeout since no actual error...
    3229    stc                                 ; ...but wanted bit was never set
    33     jmp     SHORT StoreErrorCodeFromAHtoBDA
     30.ReturnErrorCodeInAH:
     31    ret
    3432
    3533
    3634ALIGN JUMP_ALIGN
    3735HError_ProcessErrorsAfterPollingBSY:
    38     push    ds
    39     push    dx
    40 
    4136    call    HError_GetStatusAndErrorRegistersToAXandStoreThemToBDA
    42     call    GetBiosErrorCodeToAHfromStatusAndErrorRegistersInAX
    43 StoreErrorCodeFromAHtoBDA:
    44     mov     [BDA.bHDLastSt], ah         ; Store BIOS error code to BDA
    45 
    46     pop     dx
    47     pop     ds
    48     ret
     37    jmp     SHORT GetBiosErrorCodeToAHfromStatusAndErrorRegistersInAX
    4938
    5039
     
    5645;       AL:     IDE Status Register contents
    5746;       AH:     IDE Error Register contents
    58 ;       DS:     BDA segment
    5947;   Corrupts registers:
    60 ;       DX
     48;       Nothing
    6149;--------------------------------------------------------------------
    6250ALIGN JUMP_ALIGN
    6351HError_GetStatusAndErrorRegistersToAXandStoreThemToBDA:
     52    push    ds
     53    push    dx
     54
    6455    mov     dx, [RAMVARS.wIdeBase]      ; Load IDE base port address
    6556    inc     dx                          ; Increment to Error Register
     
    6859    add     dx, BYTE REGR_IDE_ST - REGR_IDE_ERROR
    6960    in      al, dx                      ; Read Status Register to AL
    70     ; Fall to .StoreStatusAndErrorRegistersFromAXtoBDA
    7161
    72 ;--------------------------------------------------------------------
    73 ; .StoreStatusAndErrorRegistersFromAXtoBDA
    74 ;   Parameters:
    75 ;       AL:     IDE Status Register contents
    76 ;       AH:     IDE Error Register contents
    77 ;   Returns:
    78 ;       DS:     BDA segment (zero)
    79 ;   Corrupts registers:
    80 ;       DX
    81 ;--------------------------------------------------------------------
    82 .StoreStatusAndErrorRegistersFromAXtoBDA:
    8362    LOAD_BDA_SEGMENT_TO ds, dx
    8463    mov     [HDBDA.wHDStAndErr], ax
     64
     65    pop     dx
     66    pop     ds
    8567    ret
    8668
     
    148130    db  RET_HD_BADSECTOR    ; Bit7=BBK, Bad Block Detected
    149131    db  RET_HD_STATUSERR    ; When Error Register is zero
    150 
    151 
    152 ;--------------------------------------------------------------------
    153 ; HError_StoreBiosErrorCodeFromAHtoBDA
    154 ;   Parameters:
    155 ;       AH:     BIOS error code
    156 ;   Returns:
    157 ;       Nothing
    158 ;   Corrupts registers:
    159 ;       DI
    160 ;--------------------------------------------------------------------
    161 ALIGN JUMP_ALIGN
    162 HError_StoreBiosErrorCodeFromAHtoBDA:
    163     push    ds
    164     mov     di, 0                   ; Zero DI and preserve FLAGS
    165     mov     ds, di                  ; Copy BDA segment to DS
    166     mov     [BDA.bHDLastSt], ah
    167     pop     ds
    168     ret
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Common/HIRQ.asm

    r34 r35  
    22; Project name  :   IDE BIOS
    33; Created date  :   11.12.2009
    4 ; Last update   :   23.8.2010
     4; Last update   :   24.8.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Interrupt handling related functions.
     
    9898    jmp     SHORT AcknowledgeMasterInterruptController
    9999
     100
    100101ALIGN JUMP_ALIGN
    101102HIRQ_InterruptServiceRoutineForIrqs8to15:
     
    132133    push    ds
    133134    push    di
    134     push    dx
    135135
    136136    ; Reading Status Register acknowledges IDE interrupt
    137137    call    RamVars_GetSegmentToDS
    138138    call    HError_GetStatusAndErrorRegistersToAXandStoreThemToBDA
     139
     140    ; Set Task Flag
     141    LOAD_BDA_SEGMENT_TO ds, ax
    139142    mov     BYTE [BDA.bHDTaskFlg], 0FFh     ; Set task flag
    140143
    141     pop     dx
    142144    pop     di
    143145    pop     ds
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DriveXlate.asm

    r3 r35  
    22; Project name  :   IDE BIOS
    33; Created date  :   15.3.2010
    4 ; Last update   :   2.4.2010
     4; Last update   :   24.8.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Functions for swapping drive letters.
     
    2828    ret
    2929
     30
     31;--------------------------------------------------------------------
     32; DriveXlate_WhenLeavingInt13hWithReturnValueInDL
     33;   Parameters:
     34;       DS:     RAMVARS segment
     35;   Returns:
     36;       Nothing
     37;   Corrupts registers:
     38;       DI
     39;--------------------------------------------------------------------
     40ALIGN JUMP_ALIGN
     41DriveXlate_WhenLeavingInt13hWithReturnValueInDL:
     42    dec     BYTE [RAMVARS.xlateVars+XLATEVARS.bRecurCnt]
     43    ret
    3044
    3145;--------------------------------------------------------------------
  • trunk/XTIDE_Universal_BIOS/Src/Main.asm

    r33 r35  
    3838    at  ROMVARS.bRomSize,   db  CNT_ROM_BLOCKS  ; ROM size in 512B blocks
    3939    at  ROMVARS.rgbJump,    jmp Initialize_FromMainBiosRomSearch
    40     at  ROMVARS.rgbDate,    db  "08/23/10"      ; Build data (mm/dd/yy)
     40    at  ROMVARS.rgbDate,    db  "08/24/10"      ; Build data (mm/dd/yy)
    4141    at  ROMVARS.rgbSign,    db  "XTIDE110"      ; Signature for flash program
    4242    at  ROMVARS.szTitle
     
    4949        db  " (XT)=-",STOP
    5050%endif
    51     at  ROMVARS.szVersion,  db  "v1.1.3 (08/23/10)",STOP
     51    at  ROMVARS.szVersion,  db  "v1.1.4 (08/24/10)",STOP
    5252
    5353;---------------------------;
Note: See TracChangeset for help on using the changeset viewer.