Changeset 566 in xtideuniversalbios


Ignore:
Timestamp:
Aug 29, 2013, 12:49:15 AM (8 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Fixed a very old bug (from r150) in IdeError.asm where GetBiosErrorCodeToAHfromStatusAndErrorRegistersInAX would return RET_HD_SEEK_FAIL instead of RET_HD_STATUSERR.
  • Optimizations and other fixes.
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Inc/Macros.inc

    r258 r566  
    11; Project name  :   Assembly Library
    22; Description   :   This is the place to put various generic macros.
    3 ;                   Should be included immediately after emulate.inc
     3;                   Should be included immediately after Emulate.inc
    44%ifndef MACROS_INC
    55%define MACROS_INC
  • trunk/Assembly_Library/Src/Serial/SerialServer.asm

    r526 r566  
    9292
    9393        mov     al,047h
    94         inc     dx              ;  fifo
     94        inc     dx              ; fifo
    9595        out     dx,al
    9696
    9797        mov     al,03h
    98         inc     dx              ;  linecontrol
     98        inc     dx              ; linecontrol
    9999        out     dx,al
    100100
    101101        mov     al,0bh
    102         inc     dx              ;  modemcontrol
    103         out     dx,al
    104 
    105         inc     dx              ;  linestatus (no output now, just setting up BH for later use)
     102        inc     dx              ; modemcontrol
     103        out     dx,al
     104
     105        inc     dx              ; linestatus (no output now, just setting up BH for later use)
    106106        mov     bh,dl
    107107
     
    158158        mov     cx,0101h        ; writing 256 words (plus 1)
    159159
    160         shr     ah,1            ; command byte, are we doing a write?
     160        sahf                    ; command byte, are we doing a write?
    161161        jnc     .readEntry
    162162
     
    285285; taken care of this, but I have seen cases where this is not true.
    286286;
    287         xor     cx,cx                   ; timeout this clearing routine, in case the UART isn't there
     287        xor     cx,cx           ; timeout this clearing routine, in case the UART isn't there
    288288.clearBuffer:
    289289        mov     dl,bh
     
    294294        test    al,1
    295295        in      al,dx
    296         loopnz  .clearBuffer            ; note ZF from test above
     296        loopnz  .clearBuffer    ; note ZF from test above
    297297
    298298.clearBufferComplete:
    299         mov     al, 3           ;  error return code and CF (low order bit)
     299        mov     al, 1           ; error return code
    300300
    301301ALIGN JUMP_ALIGN
    302302SerialServer_OutputWithParameters_ReturnCodeInAL:
    303303%if 0
    304         sti                     ;  all paths here will already have interrupts turned back on
    305 %endif
    306         mov     ah, al          ;  for success, AL will already be zero
    307 
    308         pop     bx              ;  recover "ax" (command and count) from stack
    309         pop     cx              ;  recover saved sector count
     304        sti                     ; all paths here will already have interrupts turned back on
     305%endif
     306        mov     ah, al          ; for success, AL will already be zero
     307
     308        pop     bx              ; recover "ax" (command and count) from stack
     309        pop     cx              ; recover saved sector count
    310310        xor     ch, ch
    311311        sub     cl, bl          ; subtract off the number of sectors that remained
     
    315315        pop     si
    316316
    317         shr     ah, 1           ; shift down return code and CF
     317        sahf                    ; error return code to CF
    318318
    319319        ret
     
    440440;
    441441        sti
     442%ifndef SERIALSERVER_TIMER_LOCATION
    442443        mov     cl,SerialServer_WaitAndPoll_SoftDelayTicks
    443 %ifndef SERIALSERVER_TIMER_LOCATION
    444444        call    Timer_InitializeTimeoutWithTicksInCL
    445445%else
  • trunk/BIOS_Drive_Information_Tool/Src/Bios.asm

    r526 r566  
    2626;       Nothing
    2727;   Returns: (if no errors)
    28 ;       DX:     Number of hard drives in system
     28;       DX:     Number of hard drives in system
    2929;       CF:     Set if no hard drives found
    3030;   Corrupts registers:
     
    4444;       DL:     BIOS drive number
    4545;   Returns: (if no errors)
    46 ;       BL:     Drive Type (for floppies only)
     46;       BL:     Drive Type (for floppies only)
    4747;       AX:     Sectors per track (1...63)
    4848;       DX:     Number of heads (1...255)
     
    6767;       DH:     Maximum head number (0...254)
    6868;   Returns:
    69 ;       BL:     Drive Type (for floppies only)
     69;       BL:     Drive Type (for floppies only)
    7070;       AX:     Sectors per track (1...63)
    7171;       DX:     Number of heads (1...255)
     
    9393;       DL:     BIOS drive number
    9494;   Returns: (if no errors)
    95 ;       CX:DX:  Total number of sectors
    96 ;       AH:     BIOS Error code
     95;       CX:DX:  Total number of sectors
     96;       AH:     BIOS Error code
    9797;       CF:     Cleared = no errors
    9898;               Set = BIOS error code stored in AH
     
    113113;       DL:     BIOS drive number
    114114;   Returns: (if no errors)
    115 ;      DS:BX:  Ptr to ATA information
    116 ;       AH:     BIOS Error code
     115;       DS:BX:  Ptr to ATA information
     116;       AH:     BIOS Error code
    117117;       CF:     Cleared = no errors
    118118;               Set = BIOS error code stored in AH
     
    135135;   Returns:
    136136;       AH:     BIOS error code
    137 ;       BX:     Version of extensions
     137;       BX:     Version of extensions
    138138;       CX:     Interface support bit map
    139139;       CF:     Cleared = no errors
     
    163163;       DL:     BIOS drive number
    164164;   Returns: (if no errors)
    165 ;      DS:SI:  Ptr to EDRIVE_INFO
    166 ;       AH:     BIOS Error code
     165;       DS:SI:  Ptr to EDRIVE_INFO
     166;       AH:     BIOS Error code
    167167;       CF:     Cleared = no errors
    168168;               Set = BIOS error code stored in AH
     
    184184;       Nothing
    185185;   Returns: (if no errors)
    186 ;       AH:     BIOS Error code
     186;       AH:     BIOS Error code
    187187;       CF:     Set
    188188;   Corrupts registers:
  • trunk/XTIDE_Universal_BIOS/Inc/Controllers/Vision.inc

    r558 r566  
    5050MASK_QD6580IDE_RECOVERY_TIME            EQU MASK_QD6500IDE_RECOVERY_TIME
    5151                                                    ; 0000b = 15 clocks, 1101b = 2 clocks
    52 POSITON_QD65XXIDE_RECOVERY_TIME         EQU 4
     52POSITION_QD65XXIDE_RECOVERY_TIME        EQU 4
    5353
    5454
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeError.asm

    r526 r566  
    5555ALIGN JUMP_ALIGN
    5656GetBiosErrorCodeToAHfromStatusAndErrorRegistersInAX:
    57     test    al, FLG_STATUS_BSY
    58     jz      SHORT .CheckErrorBitsFromStatusRegisterInAL
    59     mov     ah, RET_HD_TIMEOUT
    60     jmp     SHORT .ReturnBiosErrorCodeInAH
     57    test    al, FLG_STATUS_BSY | FLG_STATUS_DF | FLG_STATUS_CORR | FLG_STATUS_ERR   ; Clears CF
     58    jnz     SHORT .CheckErrorBitsFromStatusRegisterInAL
     59    ; The MSB of AL (FLG_STATUS_BSY) is cleared at this point.
     60    cbw                             ; No errors, zero AH (CF already cleared)
     61    ret
    6162
    6263ALIGN JUMP_ALIGN
    6364.CheckErrorBitsFromStatusRegisterInAL:
    64     test    al, FLG_STATUS_DF | FLG_STATUS_CORR | FLG_STATUS_ERR
    65     jnz     SHORT .ProcessErrorFromStatusRegisterInAL
    66     xor     ah, ah                  ; No errors, zero AH and CF
    67     ret
    68 
    69 .ProcessErrorFromStatusRegisterInAL:
     65    js      SHORT .Flg_Status_Bsy   ; Jump if FLG_STATUS_BSY
    7066    test    al, FLG_STATUS_ERR      ; Error specified in Error register?
    7167    jnz     SHORT .ConvertBiosErrorToAHfromErrorRegisterInAH
     
    7470    jnz     SHORT .ReturnBiosErrorCodeInAH
    7571    mov     ah, RET_HD_CONTROLLER   ; Must be Device Fault
    76     jmp     SHORT .ReturnBiosErrorCodeInAH
     72    SKIP2B  bx
     73.Flg_Status_Bsy:
     74    mov     ah, RET_HD_TIMEOUT
     75.ReturnBiosErrorCodeInAH:
     76    stc
     77    ret
    7778
    7879.ConvertBiosErrorToAHfromErrorRegisterInAH:
    79     xor     bx, bx                  ; Clear CF
     80    stc                             ; Needed in case Error register (AH) is zero
     81    mov     bx, .rgbRetCodeLookup-1
    8082.ErrorBitLoop:
    81     rcr     ah, 1                   ; Set CF if error bit set
    82     jc      SHORT .LookupErrorCode
    8383    inc     bx
    84     test    ah, ah                  ; Clear CF
    85     jnz     SHORT .ErrorBitLoop
    86 .LookupErrorCode:
    87     mov     ah, [cs:bx+.rgbRetCodeLookup]
    88 .ReturnBiosErrorCodeInAH:
    89     stc                             ; Set CF since error
     84    rcr     ah, 1
     85    jnc     SHORT .ErrorBitLoop     ; CF will be set eventually
     86    mov     ah, [cs:bx]
    9087    ret
     88
    9189
    9290.rgbRetCodeLookup:
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm

    r558 r566  
    106106    jc      .ReturnWithErrorCodeInAH
    107107%else
    108     jnc     SHORT .ContinueInitializationSinceDriveSelectedSuccesfully
     108    jnc     SHORT .ContinueInitializationSinceDriveSelectedSuccessfully
    109109    jmp     .ReturnWithErrorCodeInAH
    110 .ContinueInitializationSinceDriveSelectedSuccesfully:
     110.ContinueInitializationSinceDriveSelectedSuccessfully:
    111111%endif
    112112
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13hBiosInit.asm

    r561 r566  
    2828; Int 13h software interrupt handler.
    2929; This handler captures boot sector read from foreign drive when our
    30 ; INT 19h is not called. This way we can for XTIDE Universal BIOS
     30; INT 19h is not called. This way we can force XTIDE Universal BIOS
    3131; initialization even without INT 19h being called.
    3232;
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/Vision.asm

    r564 r566  
    179179    test    al, FLG_QDCONTROL_HDONLY_in
    180180    eCMOVNZ ah, FLG_QDCONTROL_NONATAPI              ; Enable Read-Ahead and Post-Write Buffers
    181     or      ah, MASK_QDCONTROL_FLAGS_TO_SET
    182181    mov     al, ah
     182    or      al, MASK_QDCONTROL_FLAGS_TO_SET
    183183    out     dx, al
    184184    sub     dx, BYTE QD6580_CONTROL_REGISTER
     
    187187    ; QD6500 has only one channel that can be Primary at 1F0h or Secondary at 170h.
    188188    ; QD6580 always has Primary channel at 1F0h. Secondary channel at 170h can be Enabled or Disabled.
    189     mov     bx, [di+DPT.wBasePort]
    190     cmp     bx, DEVICE_ATA_PRIMARY_PORT
     189    cmp     WORD [di+DPT.wBasePort], DEVICE_ATA_PRIMARY_PORT
    191190    je      SHORT .CalculateTimingTicksForQD6580    ; Primary Channel so no need to modify DX
    192191    times 2 inc dx                                  ; Secondary Channel IDE Timing Register
     
    216215
    217216    ; Merge the values to a single byte to output
    218     eSHIFT_IM   al, POSITON_QD65XXIDE_RECOVERY_TIME, shl
     217    eSHL_IM al, POSITION_QD65XXIDE_RECOVERY_TIME
    219218    or      al, bl
    220219    out     dx, al
Note: See TracChangeset for help on using the changeset viewer.