Changeset 294 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers


Ignore:
Timestamp:
Mar 4, 2012, 1:35:10 AM (12 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Commit 2/2 (BIOS):

  • Fixed a bug in AH1h_HStatus.asm.
  • Minor optimizations.
  • Fixed spelling and did some cleaning.
Location:
trunk/XTIDE_Universal_BIOS/Src/Handlers
Files:
24 edited

Legend:

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

    r277 r294  
    2626
    2727    call    RamVars_GetSegmentToDS
    28        
     28
    2929    call    DriveXlate_ToOrBack
    3030    mov     [RAMVARS.xlateVars+XLATEVARS.bXlatedDrv], dl
    31        
     31
    3232    call    FindDPT_ForDriveNumberInDL              ; DS:DI points to our DPT, or NULL if not our drive
    3333    jnc     SHORT .OurFunction                      ; DPT found, this is one of our drives, and thus our function
    3434
    35     cmp     ah, 0
    36     jz      short .OurFunction                      ; we handle all function 0h requests (resets)
     35    test    ah, ah
     36    jz      SHORT .OurFunction                      ; we handle all function 0h requests (resets)
    3737    cmp     ah, 8
    38     jnz     SHORT Int13h_DirectCallToAnotherBios    ; non-8h function, handled by foreign bios
     38    jne     SHORT Int13h_DirectCallToAnotherBios    ; non-8h function, handled by foreign bios
    3939
    4040%ifndef MODULE_SERIAL_FLOPPY
    41 ; With floppy support, we handle all traffic for function 08h, as we need to wrap both hard disk and 
    42 ; floppy drive counts.  Without floppy support, we handle only hard disk traffic for function 08h, 
     41; With floppy support, we handle all traffic for function 08h, as we need to wrap both hard disk and
     42; floppy drive counts.  Without floppy support, we handle only hard disk traffic for function 08h,
    4343; and thus need the check below.
    4444;
    45     test    dl, dl                             
     45    test    dl, dl
    4646    jns     SHORT Int13h_DirectCallToAnotherBios
    47 %endif     
    48                
    49 .OurFunction:   
     47%endif
     48
     49.OurFunction:
    5050    ; Jump to correct BIOS function
    5151    eMOVZX  bx, ah
     
    141141    test    dl, dl
    142142    js      short Int13h_UnsupportedFunction
    143     mov     ah, 0
     143    xor     ah, ah
    144144    jmp     short Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
    145145%endif
     
    172172%ifdef MODULE_SERIAL_FLOPPY
    173173    mov     al, [bp+IDEPACK.intpack+INTPACK.dl]
    174 Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH_ALHasDriveNumber:   
     174Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH_ALHasDriveNumber:
    175175    call    Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH_ALHasDriveNumber
    176176%else
     
    191191;   Returns:
    192192;       Depends on function
    193 ;       NOTE: ES:DI needs to be returned from the previous interrupt 
     193;       NOTE: ES:DI needs to be returned from the previous interrupt
    194194;             handler, for floppy DPT in function 08h
    195195;   Corrupts registers:
     
    251251.HardDisk:
    252252    LOAD_BDA_SEGMENT_TO ds, di
    253     mov     [bx], ah       
     253    mov     [bx], ah
    254254%else
    255255Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH:
    256256    ; Store error code to BDA
    257     LOAD_BDA_SEGMENT_TO ds, di     
     257    LOAD_BDA_SEGMENT_TO ds, di
    258258    mov     [BDA.bHDLastSt], ah
    259259%endif
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm

    r282 r294  
    1919;   Returns with INTPACK:
    2020;       AH:     Int 13h return status (from drive requested in DL)
    21 ;       CF:     0 if succesfull, 1 if error
     21;       CF:     0 if successful, 1 if error
    2222;--------------------------------------------------------------------
    2323ALIGN JUMP_ALIGN
     
    2828%ifdef MODULE_SERIAL_FLOPPY
    2929;
    30 ; "Reset" emulatd serial floppy drives, if any.  There is nothing to actually do for this reset,
     30; "Reset" emulated serial floppy drives, if any.  There is nothing to actually do for this reset,
    3131; but record the proper error return code if one of these floppy drives is the drive requested.
    3232;
     
    3939
    4040    adc     dl, al                                      ; second drive (CF set) if present
    41                                                         ; If no drive is present, this will result in ffh which 
     41                                                        ; If no drive is present, this will result in ffh which
    4242                                                        ; won't match a drive
    4343    call    BackupErrorCodeFromTheRequestedDriveToBH
     
    4848    test    bl, bl                                      ; If we were called with a floppy disk, then we are done,
    4949    jns     SHORT .SkipHardDiskReset                    ; don't do hard disks.
    50        
     50
    5151    call    ResetForeignHardDisks
    5252
    53     ; Resetting our hard disks will modify dl and bl to be idevars offset based instead of drive number based, 
     53    ; Resetting our hard disks will modify dl and bl to be idevars offset based instead of drive number based,
    5454    ; such that this call must be the last in the list of reset routines called.
    5555    ;
     
    5757    ; and we need to override that value if we are xlate'd into 80h with one of our drives.
    5858    ;
    59     call    ResetHardDisksHandledByOurBIOS         
     59    call    ResetHardDisksHandledByOurBIOS
    6060
    6161.SkipHardDiskReset:
     
    139139;   Parameters:
    140140;       DS:DI:  Ptr to DPT for requested drive
    141 ;               If DPT pointer is not available, or error result in BH won't be used anyway, 
     141;               If DPT pointer is not available, or error result in BH won't be used anyway,
    142142;               enter through .ErrorCodeNotUsed.
    143143;       SS:BP:  Ptr to IDEPACK
     
    148148;--------------------------------------------------------------------
    149149ResetHardDisksHandledByOurBIOS:
    150     mov     bl, 0                                       ; Assume Null IdevarsOffset for now, assuming foreign drive
     150    xor     bl, bl                                      ; Assume Null IdevarsOffset for now, assuming foreign drive
    151151    test    di, di
    152152    jz      .ErrorCodeNotUsed
    153153    mov     bl, [di+DPT.bIdevarsOffset]                 ; replace drive number with Idevars pointer for cmp with dl
    154        
    155 .ErrorCodeNotUsed:                                      ; BH will be garbage on exit if thie entry point is used,
     154
     155.ErrorCodeNotUsed:                                      ; BH will be garbage on exit if this entry point is used,
    156156                                                        ; but reset of all drives will still happen
    157157
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH10h_HReady.asm

    r150 r294  
    1515;   Returns with INTPACK:
    1616;       AH:     Int 13h return status
    17 ;       CF:     0 if succesfull, 1 if error
     17;       CF:     0 if successful, 1 if error
    1818;--------------------------------------------------------------------
    1919ALIGN JUMP_ALIGN
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH11h_HRecal.asm

    r162 r294  
    1515;   Returns with INTPACK:
    1616;       AH:     BIOS Error code
    17 ;       CF:     0 if succesfull, 1 if error
     17;       CF:     0 if successful, 1 if error
    1818;--------------------------------------------------------------------
    1919ALIGN JUMP_ALIGN
     
    3535;   Returns:
    3636;       AH:     BIOS Error code
    37 ;       CF:     0 if succesfull, 1 if error
     37;       CF:     0 if successful, 1 if error
    3838;   Corrupts registers:
    3939;       AL, BX, CX, DX
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH15h_HSize.asm

    r285 r294  
    1414;       SS:BP:  Ptr to IDEPACK
    1515;   Returns with INTPACK:
    16 ;       If succesfull:
     16;       If successful:
    1717;           AH:     Hard Disk: 3 (Hard disk accessible)
    1818;                   Floppy:    1 (Floppy disk, without change detection)
     
    2828%ifdef MODULE_SERIAL_FLOPPY
    2929    mov     cl, 1                                       ; 1 = floppy disk, no change detection
    30                
    31     test    dl,dl                                       ; DO NOT store the sector count if this is a 
    32     jns     .FloppyDrive                                ; floppy disk, some OS's depend on this not 
     30
     31    test    dl,dl                                       ; DO NOT store the sector count if this is a
     32    jns     .FloppyDrive                                ; floppy disk, some OS's depend on this not
    3333                                                        ; happening for floppies in order to boot.
    3434%endif
    35        
     35
    3636    call    AH15h_GetSectorCountToBXDXAX
    3737    mov     [bp+IDEPACK.intpack+INTPACK.cx], dx         ; HIWORD to CX
    3838    xchg    [bp+IDEPACK.intpack+INTPACK.dx], ax         ; LOWORD to DX, AL gets drive number
    3939
    40     xor     ah, ah     
    41 %ifdef MODULE_SERIAL_FLOPPY             
     40    xor     ah, ah
     41%ifdef MODULE_SERIAL_FLOPPY
    4242    mov     cl, 3                                       ; 3 = Hard Disk Accessible
    4343.FloppyDrive:
    44        
    45     call    Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH_ALHasDriveNumber   ; Store success to BDA and CF       
    46     mov     BYTE [bp+IDEPACK.intpack+INTPACK.ah], cl
     44
     45    call    Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH_ALHasDriveNumber   ; Store success to BDA and CF
     46    mov     [bp+IDEPACK.intpack+INTPACK.ah], cl
    4747%else
    48     call    Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH    ; Store success to BDA and CF       
     48    call    Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH    ; Store success to BDA and CF
    4949    mov     BYTE [bp+IDEPACK.intpack+INTPACK.ah], 3
    50 %endif     
    51        
     50%endif
     51
    5252    jmp     Int13h_ReturnFromHandlerWithoutStoringErrorCode
    5353
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1h_HStatus.asm

    r258 r294  
    2323%ifdef MODULE_SERIAL_FLOPPY
    2424    test    dl, dl
    25     jns     .HardDisk
    26     mov     ah, [BDA.bFDRetST]      ; Unlike for hard disks below, floppy version does not clear the status
     25    js      .HardDisk
     26    mov     ah, [BDA.bFDRetST]  ; Unlike for hard disks below, floppy version does not clear the status
    2727    jmp     .done
    28 .HardDisk: 
     28.HardDisk:
    2929%endif
    30        
    31     xchg    ah, [BDA.bHDLastSt]     ; Load and clear last error
    32                                     ; Note that AH is cleared with the LOAD_BDA_SEGMENT above
    33                
     30
     31    xchg    ah, [BDA.bHDLastSt] ; Load and clear last error (AH is cleared with the LOAD_BDA_SEGMENT_TO above)
     32
    3433.done:
     34%ifndef USE_186
    3535    call    Int13h_SetErrorCodeToIntpackInSSBPfromAH
    3636    jmp     Int13h_ReturnFromHandlerWithoutStoringErrorCode
     37%else
     38    push    Int13h_ReturnFromHandlerWithoutStoringErrorCode
     39    jmp     Int13h_SetErrorCodeToIntpackInSSBPfromAH
     40%endif
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH23h_HFeatures.asm

    r170 r294  
    2424;   Returns with INTPACK:
    2525;       AH:     Int 13h return status
    26 ;       CF:     0 if succesfull, 1 if error
     26;       CF:     0 if successful, 1 if error
    2727;--------------------------------------------------------------------
    2828ALIGN JUMP_ALIGN
     
    5151;   Returns:
    5252;       AH:     Int 13h return status
    53 ;       CF:     0 if succesfull, 1 if error
     53;       CF:     0 if successful, 1 if error
    5454;   Corrupts registers:
    5555;       AL, BX, CX, DX
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH24h_HSetBlocks.asm

    r232 r294  
    1818;   Returns with INTPACK:
    1919;       AH:     Int 13h return status
    20 ;       CF:     0 if succesfull, 1 if error
     20;       CF:     0 if successful, 1 if error
    2121;--------------------------------------------------------------------
    2222AH24h_HandlerForSetMultipleBlocks:
     
    3838;   Returns:
    3939;       AH:     Int 13h return status
    40 ;       CF:     0 if succesfull, 1 if error
     40;       CF:     0 if successful, 1 if error
    4141;   Corrupts registers:
    4242;       AL, BX, CX, DX
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH25h_HDrvID.asm

    r221 r294  
    1818;   Returns with INTPACK:
    1919;       AH:     Int 13h return status
    20 ;       CF:     0 if succesfull, 1 if error
     20;       CF:     0 if successful, 1 if error
    2121;--------------------------------------------------------------------
    2222ALIGN JUMP_ALIGN
     
    4040;   Returns with INTPACK:
    4141;       AH:     Int 13h return status
    42 ;       CF:     0 if succesfull, 1 if error
     42;       CF:     0 if successful, 1 if error
    4343;   Corrupts registers:
    4444;       AL, BX, CX, DX
     
    5353    call    AccessDPT_GetDriveSelectByteToAL
    5454    mov     bh, al
    55     eMOVZX  ax, BYTE [di+DPT.bIdevarsOffset]
     55    eMOVZX  ax, [di+DPT.bIdevarsOffset]
    5656    xchg    bp, ax
    5757    call    Device_IdentifyToBufferInESSIwithDriveSelectByteInBH
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH2h_HRead.asm

    r258 r294  
    2020;               Bits 5...0: Starting sector number (1...63)
    2121;       DH:     Starting head number (0...255)
    22 ;       ES:BX:  Pointer to buffer recieving data
     22;       ES:BX:  Pointer to buffer receiving data
    2323;   Returns with INTPACK:
    2424;       AH:     Int 13h/40h floppy return status
    2525;       AL:     Burst error length if AH returns 11h (we never return error code 11h)
    2626;               Number of sectors actually read (only valid if CF set for someBIOSes)
    27 ;       CF:     0 if successfull, 1 if error
     27;       CF:     0 if successful, 1 if error
    2828;--------------------------------------------------------------------
    2929ALIGN JUMP_ALIGN
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH3h_HWrite.asm

    r249 r294  
    2424;       AH:     Int 13h/40h floppy return status
    2525;       AL:     Number of sectors actually written (only valid if CF set for someBIOSes)
    26 ;       CF:     0 if successfull, 1 if error
     26;       CF:     0 if successful, 1 if error
    2727;--------------------------------------------------------------------
    2828ALIGN JUMP_ALIGN
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH4h_HVerify.asm

    r249 r294  
    2323;       AH:     Int 13h/40h floppy return status
    2424;       AL:     Number of sectors actually verified (only valid if CF set for someBIOSes)
    25 ;       CF:     0 if successfull, 1 if error
     25;       CF:     0 if successful, 1 if error
    2626;--------------------------------------------------------------------
    2727ALIGN JUMP_ALIGN
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH8h_HParams.asm

    r285 r294  
    2222;       ES:DI:  Floppy DPT (for floppies only)
    2323;       AH:     Int 13h/40h floppy return status
    24 ;       CF:     0 if successfull, 1 if error
     24;       CF:     0 if successful, 1 if error
    2525;--------------------------------------------------------------------
    2626AH8h_HandlerForReadDiskDriveParameters:
     
    3131    jnc     SHORT .MidGame
    3232    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
    33        
    34 .OurDrive:     
     33
     34.OurDrive:
    3535    call    AH8h_GetDriveParameters
    3636
     
    4141%endif
    4242    ;; fall-through
    43        
    44 .MidGame:       
     43
     44.MidGame:
    4545    call    RamVars_GetCountOfKnownDrivesToAX       ; assume hard disk for now, will discard if for floppies
    4646
    4747    test    byte [bp+IDEPACK.intpack+INTPACK.dl], 080h
    4848    jnz     .Done
    49        
     49
    5050    mov     [bp+IDEPACK.intpack+INTPACK.bl], bl
    5151
    5252    mov     [bp+IDEPACK.intpack+INTPACK.es], es
    53     mov     [bp+IDEPACK.intpack+INTPACK.di], di     
     53    mov     [bp+IDEPACK.intpack+INTPACK.di], di
    5454
    5555    call    FloppyDrive_GetCountToAX
    5656
    57 .Done: 
     57.Done:
    5858    mov     ah, dh
    59        
     59
    6060    mov     [bp+IDEPACK.intpack+INTPACK.cx], cx
    6161    xchg    [bp+IDEPACK.intpack+INTPACK.dx], ax     ; recover DL for BDA last status byte determination
     
    6363    xor     ah, ah
    6464%ifdef MODULE_SERIAL_FLOPPY
    65     jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH_ALHasDriveNumber           
     65    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH_ALHasDriveNumber
    6666%else
    6767    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
     
    118118    eSHR_IM bl,FLGH_DPT_SERIAL_FLOPPY_TYPE_FIELD_POSITION
    119119%endif
    120 %endif     
     120%endif
    121121    ret
    122122
     
    127127; So we return fixed values out of the ROM for callers who might be expecting this information.
    128128;
    129 ; On AT systems, we return the information for a 1.44 MB disk, 
     129; On AT systems, we return the information for a 1.44 MB disk,
    130130; and on XT systems, we return the information for a 360 KB disk.
    131131;
     
    138138
    139139    db      1h << 1 | 0             ; Offset 1: Typical values of 1 for head load time
    140                                     ;           DMA used (although it actually is not, but is more restrctive)
    141     db      25h                     ; Offset 2: Inactiviy motor turn-off delay,
     140                                    ;           DMA used (although it actually is not, but is more restrictive)
     141    db      25h                     ; Offset 2: Inactivity motor turn-off delay,
    142142                                    ;           Typical value of 25h for 2 second delay
    143143    db      02h                     ; Offset 3: Sector size, always 512
     
    161161    db      0f6h                    ; Offset 8: Fill byte for format
    162162    db      0fh                     ; Offset 9: Head setting time
    163     db      08h                     ; Offset A: Wait for motor startpu time
     163    db      08h                     ; Offset A: Wait for motor startup time
    164164
    165165%ifdef USE_AT
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm

    r279 r294  
    1515;   Returns with INTPACK:
    1616;       AH:     Int 13h return status
    17 ;       CF:     0 if succesfull, 1 if error
     17;       CF:     0 if successful, 1 if error
    1818;--------------------------------------------------------------------
    1919AH9h_HandlerForInitializeDriveParameters:
     
    3636;   Returns:
    3737;       AH:     Int 13h return status
    38 ;       CF:     0 if succesfull, 1 if error
     38;       CF:     0 if successful, 1 if error
    3939;   Corrupts registers:
    4040;       AL, BX, DX
     
    4545
    4646%ifdef MODULE_SERIAL
    47     ; 
    48     ; no need to do this for serial deveices, and we use the DPT_RESET flag bits
     47    ;
     48    ; no need to do this for serial devices, and we use the DPT_RESET flag bits
    4949    ; to store the drive type for serial floppy drives (MODULE_SERIAL_FLOPPY)
    5050    ;
    5151    xor     ah, ah
    5252    test    byte [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE    ; Clears CF
    53     jnz     .ReturnNotSuccessfull
     53    jnz     .ReturnNotSuccessful
    5454%endif
    55        
     55
    5656    ; Try to select drive and wait until ready
    5757    or      BYTE [di+DPT.bFlagsHigh], MASKH_DPT_RESET       ; Everything uninitialized
     
    5959    mov     [bp+IDEPACK.bDrvAndHead], al
    6060    call    Device_SelectDrive
    61     jc      SHORT .ReturnNotSuccessfull
     61    jc      SHORT .ReturnNotSuccessful
    6262    and     BYTE [di+DPT.bFlagsHigh], ~FLGH_DPT_RESET_nDRDY ; Clear since success
    6363
     
    8080.InitializeBlockMode:
    8181    call    InitializeBlockMode
    82     jc      SHORT .ReturnNotSuccessfull
     82    jc      SHORT .ReturnNotSuccessful
    8383    and     BYTE [di+DPT.bFlagsHigh], ~FLGH_DPT_RESET_nSETBLOCK ; Keeps CF clear
    8484
    85 .ReturnNotSuccessfull:
     85.ReturnNotSuccessful:
    8686    pop     cx
    8787    pop     si
     
    9696;   Returns:
    9797;       AH:     BIOS Error code
    98 ;       CF:     Cleared if succesfull
     98;       CF:     Cleared if successful
    9999;               Set if any error
    100100;   Corrupts registers:
     
    121121;   Returns:
    122122;       AH:     BIOS Error code
    123 ;       CF:     Cleared if succesfull
     123;       CF:     Cleared if successful
    124124;               Set if any error
    125125;   Corrupts registers:
     
    146146;   Returns:
    147147;       AH:     BIOS Error code
    148 ;       CF:     Cleared if succesfull
     148;       CF:     Cleared if successful
    149149;               Set if any error
    150150;   Corrupts registers:
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AHCh_HSeek.asm

    r162 r294  
    2121;   Returns with INTPACK:
    2222;       AH:     BIOS Error code
    23 ;       CF:     0 if succesfull, 1 if error
     23;       CF:     0 if successful, 1 if error
    2424;--------------------------------------------------------------------
    2525ALIGN JUMP_ALIGN
     
    4444;   Returns:
    4545;       AH:     BIOS Error code
    46 ;       CF:     0 if succesfull, 1 if error
     46;       CF:     0 if successful, 1 if error
    4747;   Corrupts registers:
    4848;       AL, BX, CX, DX
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AHDh_HReset.asm

    r282 r294  
    1515;   Returns with INTPACK:
    1616;       AH:     Int 13h return status
    17 ;       CF:     0 if succesfull, 1 if error
     17;       CF:     0 if successful, 1 if error
    1818;--------------------------------------------------------------------
    1919ALIGN JUMP_ALIGN
     
    3737;   Returns:
    3838;       AH:     Int 13h return status
    39 ;       CF:     0 if succesfull, 1 if error
     39;       CF:     0 if successful, 1 if error
    4040;   Corrupts registers:
    4141;       AL, SI
     
    5353
    5454    ; Initialize Master and Slave drives
    55     mov     al, [di+DPT.bIdevarsOffset]         ; pointer to controller we are looking to reset
    56     mov     ah, 0                               ; initialize error code, assume success
    57        
     55    eMOVZX  ax, [di+DPT.bIdevarsOffset]         ; (AL) pointer to controller we are looking to reset
     56                                                ; (AH) initialize error code, assume success
     57
    5858    mov     si, IterateAndResetDrives
    5959    call    FindDPT_IterateAllDPTs
     
    7070; IterateAndResetDrives: Iteration routine for use with IterateAllDPTs.
    7171;
    72 ; When a drive on the controller is found, it is reset, and the error code 
     72; When a drive on the controller is found, it is reset, and the error code
    7373; merged into overall error code for this controller.  Master will be reset
    7474; first.  Note that the iteration will go until the end of the DPT list.
     
    7979    push    ax
    8080    call    AH9h_InitializeDriveForUse          ; Reset Master and Slave (Master will come first in DPT list)
    81     pop     ax     
     81    pop     ax
    8282    jnc     .done
    8383    or      ah, (RET_HD_RESETFAIL << 1) | 1     ; OR in Reset Failed error code and CF, will SHR into position later
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH41h_CheckIfExtensionsPresent.asm

    r167 r294  
    1919;       BX:     AA55h
    2020;       CX:     Support bits
    21 ;       CF:     0 if succesfull, 1 if error
     21;       CF:     0 if successful, 1 if error
    2222;--------------------------------------------------------------------
    2323ALIGN JUMP_ALIGN
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH42h_ExtendedReadSectors.asm

    r249 r294  
    1818;   Returns with INTPACK:
    1919;       AH:     Int 13h return status
    20 ;       CF:     0 if succesfull, 1 if error
     20;       CF:     0 if successful, 1 if error
    2121;   Return with Disk Address Packet in INTPACK:
    2222;       .wSectorCount   Number of sectors read successfully
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH43h_ExtendedWriteSectors.asm

    r249 r294  
    2020;   Returns with INTPACK:
    2121;       AH:     Int 13h return status
    22 ;       CF:     0 if succesfull, 1 if error
     22;       CF:     0 if successful, 1 if error
    2323;   Return with Disk Address Packet in INTPACK:
    2424;       .wSectorCount   Number of sectors written successfully
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH44h_ExtendedVerifySectors.asm

    r249 r294  
    1818;   Returns with INTPACK:
    1919;       AH:     Int 13h return status
    20 ;       CF:     0 if succesfull, 1 if error
     20;       CF:     0 if successful, 1 if error
    2121;   Return with Disk Address Packet in INTPACK:
    2222;       .wSectorCount   Number of sectors verified successfully
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH47h_ExtendedSeek.asm

    r249 r294  
    1818;   Returns with INTPACK:
    1919;       AH:     Int 13h return status
    20 ;       CF:     0 if succesfull, 1 if error
     20;       CF:     0 if successful, 1 if error
    2121;--------------------------------------------------------------------
    2222ALIGN JUMP_ALIGN
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm

    r230 r294  
    1919;       AH:     Int 13h return status
    2020;       DS:SI:  Ptr to Extended Drive Information Table
    21 ;       CF:     0 if succesfull, 1 if error
     21;       CF:     0 if successful, 1 if error
    2222;--------------------------------------------------------------------
    2323AH48h_HandlerForGetExtendedDriveParameters:
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Address.asm

    r230 r294  
    128128ConvertLCHStoLBARegisterValues:
    129129    ; cylToSeek*headsPerCyl (18-bit result)
    130     mov     ax, cx                  ; Copy Cylinder number to AX
    131     ; We could save a byte here by using CWD instead of the XOR DH, DH in eMOVZX
    132     ; but I'm not sure how that would affect speed.
     130    mov     ax, LBA_ASSIST_SPT      ; Load Sectors per Track
     131    xchg    cx, ax                  ; Cylinder number to AX, Sectors per Track to CX
    133132
    134     eMOVZX  dx, BYTE [di+DPT.bLbaHeads]
     133%ifdef USE_386
     134    movzx   dx, [di+DPT.bLbaHeads]
     135%else
     136    cwd
     137    mov     dl, [di+DPT.bLbaHeads]
     138%endif
    135139    mul     dx                      ; DX:AX = cylToSeek*headsPerCyl
    136140
     
    141145
    142146    ; *=sectPerTrack (18-bit by 6-bit multiplication with 24-bit result)
    143     mov     cx, LBA_ASSIST_SPT      ; Load Sectors per Track
    144147    xchg    ax, dx                  ; Hiword to AX, loword to DX
    145148    mul     cl                      ; AX = hiword * Sectors per Track
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Prepare.asm

    r221 r294  
    3434    cmp     ax, BYTE 127
    3535    ja      SHORT InvalidNumberOfSectorsRequested
    36     ; Fall to GetEbiosCommandIndexToBX
    3736
    38 ;--------------------------------------------------------------------
    39 ; GetEbiosCommandIndexToBX
    40 ;   Parameters:
    41 ;       DS:DI:  Ptr to DPT
    42 ;       ES:SI:  Ptr to DAP (Disk Address Packet)
    43 ;   Returns:
    44 ;       BX:     Index to command lookup table
    45 ;   Corrupts registers:
    46 ;       AX, DX
    47 ;--------------------------------------------------------------------
    48 GetEbiosCommandIndexToBX:
     37    ; Get EBIOS command index to BX
    4938    ; LBA28 or LBA48 command
    50     xor     dx, dx
     39    cwd
    5140    mov     al, [es:si+DAP.qwLBA+3] ; Load LBA48 byte 3 (bits 24...31)
    52     and     ax, 00F0h               ; Clear LBA28 bits 24...27
     41    and     al, 0F0h                ; Clear LBA28 bits 24...27
    5342    or      ax, [es:si+DAP.qwLBA+4] ; Set bits from LBA bytes 4 and 5
    5443    cmp     dx, ax                  ; Set CF if any of bits 28...47 set
Note: See TracChangeset for help on using the changeset viewer.