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


Ignore:
Timestamp:
Jan 29, 2012, 1:33:44 PM (13 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • EBIOS functions now work in lite mode.
Location:
trunk/XTIDE_Universal_BIOS/Src/Handlers
Files:
6 edited

Legend:

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

    r181 r227  
    4747ALIGN JUMP_ALIGN
    4848.JumpToEbiosFunction:
    49     test    BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_FULLMODE
    50     jz      SHORT Int13h_UnsupportedFunction    ; No eINT 13h in lite mode
    5149    test    BYTE [di+DPT.bFlagsLow], FLG_DRVNHEAD_LBA
    5250    jz      SHORT Int13h_UnsupportedFunction    ; No eINT 13h for CHS drives
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH15h_HSize.asm

    r155 r227  
    5353    jmp     SHORT ConvertAH08hReturnValuesToSectorCount
    5454
    55 ALIGN JUMP_ALIGN
    5655AH15h_GetSectorCountToDXAX:
    5756    call    AH8h_GetDriveParameters
     
    6059ConvertAH08hReturnValuesToSectorCount:
    6160    call    Address_ExtractLCHSparametersFromOldInt13hAddress
    62     xor     ax, ax          ; Zero AX
    63     inc     cx              ; Max cylinder number to cylinder count
    64     xchg    al, bh          ; AX=Max head number, BX=Sectors per track
    65     inc     ax              ; AX=Head count
    66     mul     bx              ; AX=Head count * Sectors per track
    67     mul     cx              ; DX:AX = Total sector count
    68     xor     bx, bx          ; Zero BX for 48-bit sector count (and clear CF)
     61    xchg    ax, cx
     62    inc     ax              ; Max cylinder number to cylinder count
     63.MultiplyChsInAXBLBHtoBXDXAX:
     64    xchg    bx, ax
     65    mul     ah          ; Multiply heads and sectors
     66    mul     bx          ; Multiply with cylinders
     67    xor     bx, bx
    6968    ret
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH8h_HParams.asm

    r173 r227  
    2222;       CF:     0 if successfull, 1 if error
    2323;--------------------------------------------------------------------
    24 ALIGN JUMP_ALIGN
    2524AH8h_HandlerForReadDiskDriveParameters:
    2625    call    RamVars_IsDriveHandledByThisBIOS
     
    5655;       AX, BX
    5756;--------------------------------------------------------------------
    58 ALIGN JUMP_ALIGN
    5957AH8h_GetDriveParameters:
    60     call    AccessDPT_GetLCHS       ; AX=sectors, BX=cylinders, DX=heads
     58    call    AccessDPT_GetLCHStoAXBLBH
    6159    ; Fall to .PackReturnValues
    6260
     
    6664; .PackReturnValues
    6765;   Parameters:
    68 ;       AX:     Number of L-CHS sectors per track (1...63)
    69 ;       BX:     Number of L-CHS cylinders available (1...1024)
    70 ;       DX:     Number of L-CHS heads (1...256)
     66;       AX:     Number of L-CHS cylinders available (1...1024)
     67;       BL:     Number of L-CHS heads (1...256)
     68;       BH:     Number of L-CHS sectors per track (1...63)
    7169;       DS:     RAMVARS segment
    7270;   Returns:
     
    8078;--------------------------------------------------------------------
    8179.PackReturnValues:
    82     dec     bx                      ; Cylinder count to last cylinder
    83     dec     dx                      ; Head count to max head number
    84     mov     dh, dl                  ; Max head number to DH
    85     mov     ch, bl                  ; Cylinder bits 7...0 to CH
    86     mov     cl, bh                  ; Cylinder bits 9...8 to CL
    87     eROR_IM cl, 2                   ; Cylinder bits 9...8 to CL bits 7...6
    88     or      cl, al                  ; Sectors per track to CL bits 5...0
     80    dec     ax                      ; AX = Number of last cylinder
     81    dec     bx                      ; BL = Number of last head
     82    xchg    cx, ax
     83    xchg    cl, ch                  ; CH = Last cylinder bits 0...7
     84    eROR_IM cl, 2                   ; CL bits 6...7 = Last cylinder bits 8...9
     85    or      cl, bh                  ; CL bits 0...5 = Sectors per track
     86    mov     dh, bl                  ; DH = Maximum head number
    8987    jmp     RamVars_GetCountOfKnownDrivesToDL
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm

    r173 r227  
    1717;       CF:     0 if succesfull, 1 if error
    1818;--------------------------------------------------------------------
    19 ALIGN JUMP_ALIGN
    2019AH9h_HandlerForInitializeDriveParameters:
    2120%ifndef USE_186
     
    4140;       AL, BX, DX
    4241;--------------------------------------------------------------------
    43 ;ALIGN JUMP_ALIGN
    4442AH9h_InitializeDriveForUse:
    4543    push    cx
     
    8785;       AL, BX, CX, DX
    8886;--------------------------------------------------------------------
    89 ALIGN JUMP_ALIGN
    9087InitializeDeviceParameters:
    9188    ; No need to initialize CHS parameters if LBA mode enabled
     
    9491
    9592    ; Initialize Logical Sectors per Track and Max Head number
    96     mov     ah, [di+DPT.bHeads]
     93    mov     ah, [di+DPT.bPchsHeads]
    9794    dec     ah                          ; Max Head number
    98     mov     dl, [di+DPT.bSectors]       ; Sectors per Track
     95    mov     dl, [di+DPT.bPchsSectors]   ; Sectors per Track
    9996    mov     al, COMMAND_INITIALIZE_DEVICE_PARAMETERS
    10097    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_BSY, FLG_STATUS_BSY)
     
    113110;       AL, BX, CX, DX
    114111;--------------------------------------------------------------------
    115 ALIGN JUMP_ALIGN
    116112InitializeBlockMode:
    117113    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED ; Clear CF
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm

    r221 r227  
    2121;       CF:     0 if succesfull, 1 if error
    2222;--------------------------------------------------------------------
    23 ALIGN JUMP_ALIGN
    2423AH48h_HandlerForGetExtendedDriveParameters:
    25     ; Get our buffer to ES:SI
    26     push    di
    27     call    FindDPT_ForNewDriveToDSDI
    28     lea     si, [di+LARGEST_DPT_SIZE]   ; IdeCommand.asm required fake DPT
    29     pop     di
    30     push    ds
    31     pop     es
     24    call    AccessDPT_GetLbaSectorCountToBXDXAX
    3225
    33     ; Get Drive ID and total sector count from it
    34     call    AH25h_GetDriveInformationToBufferInESSI
    35     jc      SHORT .ReturnWithError
    36 
    37     ; Point DS:DI to Destination buffer
    38     mov     di, [bp+IDEPACK.intpack+INTPACK.si]
     26    ; Point DS:SI to Extended Drive Information Table to fill
    3927    mov     ds, [bp+IDEPACK.intpack+INTPACK.ds]
    40     mov     ax, MINIMUM_EDRIVEINFO_SIZE
    41     cmp     [di+EDRIVE_INFO.wSize], ax
     28    mov     cx, MINIMUM_EDRIVEINFO_SIZE
     29    cmp     [si+EDRIVE_INFO.wSize], cx
    4230    jb      SHORT Prepare_ReturnFromInt13hWithInvalidFunctionError
    4331    je      SHORT .SkipEddConfigurationParameters
    4432
    4533    ; We do not support EDD Configuration Parameters so set to FFFF:FFFFh
    46     mov     ax, -1      ; AX = FFFFh
    47     mov     [di+EDRIVE_INFO.fpEDDparams], ax
    48     mov     [di+EDRIVE_INFO.fpEDDparams+2], ax
    49     mov     ax, EDRIVE_INFO_size
     34    mov     cx, -1      ; FFFFh
     35    mov     [si+EDRIVE_INFO.fpEDDparams], cx
     36    mov     [si+EDRIVE_INFO.fpEDDparams+2], cx
     37    mov     cx, EDRIVE_INFO_size
    5038
    51     ; Fill Extended Drive Information Table in DS:DI
     39    ; Fill Extended Drive Information Table in DS:SI
    5240.SkipEddConfigurationParameters:
    53     mov     [di+EDRIVE_INFO.wSize], ax
    54     mov     WORD [di+EDRIVE_INFO.wFlags], FLG_DMA_BOUNDARY_ERRORS_HANDLED_BY_BIOS | FLG_CHS_INFORMATION_IS_VALID
     41    mov     [si+EDRIVE_INFO.wSize], cx
     42    mov     WORD [si+EDRIVE_INFO.wFlags], FLG_DMA_BOUNDARY_ERRORS_HANDLED_BY_BIOS
    5543
    56     call    AtaID_GetPCHStoAXBLBHfromAtaInfoInESSI
    57     xor     cx, cx
    58     mov     [di+EDRIVE_INFO.dwCylinders], ax
    59     mov     [di+EDRIVE_INFO.dwCylinders+2], cx
    60     eMOVZX  ax, bl
    61     mov     [di+EDRIVE_INFO.dwHeads], ax
    62     mov     [di+EDRIVE_INFO.dwHeads+2], cx
    63     mov     al, bh
    64     mov     [di+EDRIVE_INFO.dwSectorsPerTrack], ax
    65     mov     [di+EDRIVE_INFO.dwSectorsPerTrack+2], cx
    66 
    67     call    AtaID_GetTotalSectorCountToBXDXAXfromAtaInfoInESSI
    6844    mov     [di+EDRIVE_INFO.qwTotalSectors], ax
     45    xor     ax, ax                                  ; Return with success
    6946    mov     [di+EDRIVE_INFO.qwTotalSectors+2], dx
    7047    mov     [di+EDRIVE_INFO.qwTotalSectors+4], bx
    71     mov     [di+EDRIVE_INFO.qwTotalSectors+6], cx
    72 
     48    mov     [di+EDRIVE_INFO.qwTotalSectors+6], ax
    7349    mov     WORD [di+EDRIVE_INFO.wSectorSize], 512
    7450
    75     ; Return with success
    76     xor     ah, ah
    7751.ReturnWithError:
    7852    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Address.asm

    r200 r227  
    5353    ; LHead / PHeadCount and LHead % PHeadCount
    5454    eMOVZX  ax, bh                  ; Copy L-CHS Head number to AX
    55     div     BYTE [di+DPT.bHeads]    ; AL = LHead / PHeadCount, AH = LHead % PHeadCount
     55    div     BYTE [di+DPT.bPchsHeads]; AL = LHead / PHeadCount, AH = LHead % PHeadCount
    5656    mov     bh, ah                  ; Copy P-CHS Head number to BH
    5757    xor     ah, ah                  ; AX = LHead / PHeadCount
     
    129129    ; cylToSeek*headsPerCyl (18-bit result)
    130130    mov     ax, cx                  ; Copy Cylinder number to AX
    131     eMOVZX  dx, BYTE [di+DPT.bHeads]
     131    eMOVZX  dx, BYTE [di+DPT.bLbaHeads]
    132132    mul     dx                      ; DX:AX = cylToSeek*headsPerCyl
    133133
Note: See TracChangeset for help on using the changeset viewer.