Changeset 249 in xtideuniversalbios


Ignore:
Timestamp:
Feb 16, 2012, 1:56:36 PM (13 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Number of successfully transferred sectors is now returned by all transfer functions (instead of requested sector count).
  • Added INT 19h handler for proper reboot.
Location:
trunk/XTIDE_Universal_BIOS/Src
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm

    r238 r249  
    141141;   Returns:
    142142;       AH:     INT 13h Error Code
    143 ;       CF:     Cleared if success, Set if error
    144 ;   Corrupts registers:
    145 ;       AL, BX, CX, DX, (ES:SI for data transfer commands)
     143;       CX:     Number of successfully transferred sectors (for transfer commands)
     144;       CF:     Cleared if success, Set if error
     145;   Corrupts registers:
     146;       AL, BX, (CX), DX, (ES:SI for data transfer commands)
    146147;--------------------------------------------------------------------
    147148%ifdef MODULE_JRIDE
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm

    r238 r249  
    9393;   Returns:
    9494;       AH:     INT 13h Error Code
    95 ;       CF:     Cleared if success, Set if error
    96 ;   Corrupts registers:
    97 ;       AL, BX, CX, DX, (ES:SI for data transfer commands)
     95;       CX:     Number of successfully transferred sectors (for transfer commands)
     96;       CF:     Cleared if success, Set if error
     97;   Corrupts registers:
     98;       AL, BX, (CX), DX, (ES:SI for data transfer commands)
    9899;--------------------------------------------------------------------
    99100ALIGN JUMP_ALIGN
  • trunk/XTIDE_Universal_BIOS/Src/Device/Idepack.asm

    r224 r249  
    3232;   Returns:
    3333;       AH:     INT 13h Error Code
     34;       CX:     Number of successfully transferred sectors (for transfer commands)
    3435;       CF:     Cleared if success, Set if error
    3536;   Corrupts registers:
    36 ;       AL, BX, CX, DX, SI, ES
     37;       AL, BX, (CX), DX, SI, ES
    3738;--------------------------------------------------------------------
    3839%ifdef MODULE_EBIOS
     
    8586;   Returns:
    8687;       AH:     INT 13h Error Code
     88;       CX:     Number of successfully transferred sectors (for transfer commands)
    8789;       CF:     Cleared if success, Set if error
    8890;   Corrupts registers:
    89 ;       AL, BX, CX, DX
     91;       AL, BX, (CX), DX
    9092;--------------------------------------------------------------------
    9193ALIGN JUMP_ALIGN
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm

    r227 r249  
    105105ALIGN JUMP_ALIGN
    106106.ExchangeInt13hHandlers:
    107     call    ExchangeCurrentInt13hHandlerWithOldInt13hHandler
     107%ifdef USE_186
     108    push    Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
     109    jmp     SHORT ExchangeCurrentInt13hHandlerWithOldInt13hHandler
     110%else
     111    call    ExchangeCurrentInt13hHandlerWithOldInt13hHandler
     112    jmp     SHORT Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
     113%endif
     114
     115
     116;--------------------------------------------------------------------
     117; Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAHandTransferredSectorsFromCL
     118;   Parameters:
     119;       AH:     BIOS Error code
     120;       CL:     Number of sectors actually transferred
     121;       SS:BP:  Ptr to IDEPACK
     122;   Returns:
     123;       All registers are loaded from INTPACK
     124;--------------------------------------------------------------------
     125ALIGN JUMP_ALIGN
     126Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAHandTransferredSectorsFromCL:
     127    mov     [bp+IDEPACK.intpack+INTPACK.al], cl
    108128    ; Fall to Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
    109 
    110129
    111130;--------------------------------------------------------------------
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH2h_HRead.asm

    r221 r249  
    2323;   Returns with INTPACK:
    2424;       AH:     Int 13h/40h floppy return status
    25 ;       AL:     Burst error length if AH returns 11h, undefined otherwise
     25;       AL:     Burst error length if AH returns 11h (we never return error code 11h)
     26;               Number of sectors actually read (only valid if CF set for someBIOSes)
    2627;       CF:     0 if successfull, 1 if error
    2728;--------------------------------------------------------------------
     
    3334    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRQ)
    3435%ifdef USE_186
    35     push    Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
     36    push    Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAHandTransferredSectorsFromCL
    3637    jmp     Idepack_TranslateOldInt13hAddressAndIssueCommandFromAH
    3738%else
    3839    call    Idepack_TranslateOldInt13hAddressAndIssueCommandFromAH
    39     jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
     40    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAHandTransferredSectorsFromCL
    4041%endif
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH3h_HWrite.asm

    r221 r249  
    2323;   Returns with INTPACK:
    2424;       AH:     Int 13h/40h floppy return status
     25;       AL:     Number of sectors actually written (only valid if CF set for someBIOSes)
    2526;       CF:     0 if successfull, 1 if error
    2627;--------------------------------------------------------------------
     
    3233    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRQ)
    3334%ifdef USE_186
    34     push    Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
     35    push    Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAHandTransferredSectorsFromCL
    3536    jmp     Idepack_TranslateOldInt13hAddressAndIssueCommandFromAH
    3637%else
    3738    call    Idepack_TranslateOldInt13hAddressAndIssueCommandFromAH
    38     jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
     39    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAHandTransferredSectorsFromCL
    3940%endif
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH4h_HVerify.asm

    r221 r249  
    2222;   Returns with INTPACK in SS:BP:
    2323;       AH:     Int 13h/40h floppy return status
     24;       AL:     Number of sectors actually verified (only valid if CF set for someBIOSes)
    2425;       CF:     0 if successfull, 1 if error
    2526;--------------------------------------------------------------------
     
    3031    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRDY)
    3132%ifdef USE_186
    32     push    Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
     33    push    Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAHandTransferredSectorsFromCL
    3334    jmp     Idepack_TranslateOldInt13hAddressAndIssueCommandFromAH
    3435%else
    3536    call    Idepack_TranslateOldInt13hAddressAndIssueCommandFromAH
    36     jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
     37    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAHandTransferredSectorsFromCL
    3738%endif
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH42h_ExtendedReadSectors.asm

    r221 r249  
    2020;       CF:     0 if succesfull, 1 if error
    2121;   Return with Disk Address Packet in INTPACK:
    22 ;       .bSectorCount   Number of sectors read successfully
     22;       .wSectorCount   Number of sectors read successfully
    2323;--------------------------------------------------------------------
    2424ALIGN JUMP_ALIGN
     
    2727    mov     ah, [cs:bx+g_rgbReadCommandLookup]
    2828    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRQ)
    29 %ifdef USE_186
    30     push    Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
    31     jmp     Idepack_ConvertDapToIdepackAndIssueCommandFromAH
    32 %else
    3329    call    Idepack_ConvertDapToIdepackAndIssueCommandFromAH
     30    ; Fall to AH42h_ReturnFromInt13hAfterStoringErrorCodeFromAHandTransferredSectorsFromCX
     31
     32
     33;--------------------------------------------------------------------
     34; AH42h_ReturnFromInt13hAfterStoringErrorCodeFromAHandTransferredSectorsFromCX
     35;   Parameters:
     36;       AH:     INT 13h Error Code
     37;       CX:     Number of successfully transferred sectors
     38;       SS:BP:  Ptr to IDEPACK
     39;   Returns:
     40;       Nothing, jumps to Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
     41;   Corrupts registers:
     42;       SI, DS
     43;--------------------------------------------------------------------
     44AH42h_ReturnFromInt13hAfterStoringErrorCodeFromAHandTransferredSectorsFromCX:
     45    mov     ds, [bp+IDEPACK.intpack+INTPACK.ds]
     46    mov     si, [bp+IDEPACK.intpack+INTPACK.si]
     47    mov     [si+DAP.wSectorCount], cx
    3448    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
    35 %endif
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH43h_ExtendedWriteSectors.asm

    r221 r249  
    2222;       CF:     0 if succesfull, 1 if error
    2323;   Return with Disk Address Packet in INTPACK:
    24 ;       .bSectorCount   Number of sectors written successfully
     24;       .wSectorCount   Number of sectors written successfully
    2525;--------------------------------------------------------------------
    2626ALIGN JUMP_ALIGN
     
    3333    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRQ)
    3434%ifdef USE_186
    35     push    Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
     35    push    AH42h_ReturnFromInt13hAfterStoringErrorCodeFromAHandTransferredSectorsFromCX
    3636    jmp     Idepack_ConvertDapToIdepackAndIssueCommandFromAH
    3737%else
    3838    call    Idepack_ConvertDapToIdepackAndIssueCommandFromAH
    39     jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
     39    jmp     SHORT AH42h_ReturnFromInt13hAfterStoringErrorCodeFromAHandTransferredSectorsFromCX
    4040%endif
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH44h_ExtendedVerifySectors.asm

    r221 r249  
    2020;       CF:     0 if succesfull, 1 if error
    2121;   Return with Disk Address Packet in INTPACK:
    22 ;       .bSectorCount   Number of sectors verified successfully
     22;       .wSectorCount   Number of sectors verified successfully
    2323;--------------------------------------------------------------------
    2424ALIGN JUMP_ALIGN
     
    2828    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRDY)
    2929%ifdef USE_186
    30     push    Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
     30    push    AH42h_ReturnFromInt13hAfterStoringErrorCodeFromAHandTransferredSectorsFromCX
    3131    jmp     Idepack_ConvertDapToIdepackAndIssueCommandFromAH
    3232%else
    3333    call    Idepack_ConvertDapToIdepackAndIssueCommandFromAH
    34     jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
     34    jmp     SHORT AH42h_ReturnFromInt13hAfterStoringErrorCodeFromAHandTransferredSectorsFromCX
    3535%endif
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH47h_ExtendedSeek.asm

    r221 r249  
    3636    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
    3737%endif
    38 
    39 .WriteWithVerifyNotSupported:
    40     jmp     Prepare_ReturnFromInt13hWithInvalidFunctionError
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm

    r243 r249  
    44; Section containing code
    55SECTION .text
     6
     7;--------------------------------------------------------------------
     8; INT 19h handler that properly reboots the computer when
     9; INT 19h is called.
     10;
     11; Int19h_ResetHandler
     12;   Parameters:
     13;       Nothing
     14;   Returns:
     15;       Never returns (reboots computer)
     16;--------------------------------------------------------------------
     17Int19h_ResetHandler:
     18    mov     ax, BOOT_FLAG_WARM              ; Skip memory tests
     19    jmp     Reboot_ComputerWithBootFlagInAX
     20
    621
    722;--------------------------------------------------------------------
     
    125140    push    cx          ; sgment address for MBR
    126141    push    bx          ; offset address for MBR
     142    mov     bx, BIOS_BOOT_LOADER_INTERRUPT_19h  ; INT 19h interrupt vector offset
     143    mov     si, Int19h_ResetHandler             ; INT 19h handler to reboot the system
     144    call    Interrupts_InstallHandlerToVectorInBXFromCSSI
    127145    retf                ; NOTE: DL is set to the drive number
    128146
Note: See TracChangeset for help on using the changeset viewer.