Changeset 551 in xtideuniversalbios


Ignore:
Timestamp:
Jun 6, 2013, 3:31:51 PM (12 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • DMA fixes by James Pearce.
  • Interrupt handlers are now installed before starting to detect drives (HotkeyBar require INT 40h handler for correct drive letters).
Location:
trunk/XTIDE_Universal_BIOS/Src
Files:
3 edited

Legend:

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

    r545 r551  
    11; Project name  :   XTIDE Universal BIOS
    22; Description   :   IDE Read/Write functions for transferring
    3 ;                   block using DMA.
    4 ;                   These functions should only be called from IdeTransfer.asm.
    5 
     3;           block using DMA.
     4;           These functions should only be called from IdeTransfer.asm.
     5; Modified JJP 05-Jun-13
    66;
    77; XTIDE Universal BIOS and Associated Tools
     
    1919; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    2020;
    21 
    2221
    2322; Section containing code
     
    8180    add     dl, XTCF_CONTROL_REGISTER
    8281
    83     ; Calculate bytes for first page
    84     mov     ax, di
    85     neg     ax                                      ; AX = Max BYTEs for first page
     82    ; convert sectors in CX to BYTES
    8683%ifdef USE_186
    8784    shl     cx, 9                                   ; CX = Block size in BYTEs
    8885%else
    89     xchg    cl, ch
     86    xchg        cl, ch
    9087    shl     cx, 1
    9188%endif
     89
     90    ; Calculate bytes for first page
     91    mov     ax, di
     92    neg     ax          ; 2s compliment
     93
     94    ; if DI was zero carry flag will be cleared (and set otherwise)
     95    ; When DI is zero only one transfer is required since we've limited the
     96    ; XT-CFv3 block size to 32k
     97    jnc .TransferLastDmaPageWithSizeInCX
     98
     99    ; CF was set, so DI != 0 and we might need one or two transfers
    92100    cmp     cx, ax                                  ; if we won't cross a physical page boundary...
    93     jbe     SHORT .TransferLastDmaPageWithSizeInCX  ; ...perform the transfer in one operation
     101    jbe SHORT .TransferLastDmaPageWithSizeInCX  ; ...perform the transfer in one operation
    94102
    95103    ; Calculate how much we can transfer on first and second rounds
    96     xchg    cx, ax                                  ; CX = BYTEs for first page
    97     sub     ax, cx                                  ; AX = BYTEs for second page
    98     push    ax                                      ; Save bytes for second transfer on stack
     104    xchg        cx, ax          ; CX = BYTEs for first page
     105    sub     ax, cx          ; AX = BYTEs for second page
     106    push        ax          ; Save bytes for second transfer on stack
    99107
    100108    ; Transfer first DMA page
     
    111119;   Parameters:
    112120;       BL:     Byte for DMA Mode Register
    113 ;       CX:     Number of BYTEs to transfer (512...32768 since max block size is limited to 64)
     121;       CX:     Number of BYTEs to transfer (1...32768 since max block size is limited to 64)
    114122;       DX:     XT-CFv3 Control Register
    115123;       ES:     Bits 3..0 have physical address bits 19..16
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/FloppyDrive.asm

    r547 r551  
    175175    cwd                             ; Floppy Drive 00h
    176176    int     BIOS_DISKETTE_INTERRUPT_40h
    177     xchg    dx, ax                  ; Number of Floppy Drives to AL
     177    xchg    ax, dx                  ; Number of Floppy Drives to AL
    178178
    179179    pop     dx
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm

    r550 r551  
    5252    mov     WORD [BIOS_BOOT_LOADER_INTERRUPT_19h*4], Int19h_BootLoaderHandler
    5353    mov     [BIOS_BOOT_LOADER_INTERRUPT_19h*4+2], cs
     54    ;mov        WORD [BIOS_BOOT_FAILURE_INTERRUPT_18h*4], Int19h_BootLoaderHandler
     55    ;mov        [BIOS_BOOT_FAILURE_INTERRUPT_18h*4+2], cs
    5456
    5557.SkipRomInitialization:
     
    7880    call    RamVars_Initialize
    7981    call    BootVars_Initialize
     82    call    Interrupts_InitializeInterruptVectors   ; HotkeyBar requires INT 40h so install handlers before drive detection
    8083    call    DetectDrives_FromAllIDEControllers
    81     call    Interrupts_InitializeInterruptVectors
    8284    ; Fall to .StoreDptPointersToIntVectors
    8385
Note: See TracChangeset for help on using the changeset viewer.