Ignore:
Timestamp:
Apr 29, 2011, 7:04:13 PM (13 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Changes to XTIDE Universal BIOS:

  • Redesigned Disk Parameter Tables.
  • Code generalizations for supporting non-IDE devices in the future.
File:
1 edited

Legend:

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

    r148 r150  
    1414;       DL:     Translated Drive number
    1515;       DS:DI:  Ptr to DPT (in RAMVARS segment)
    16 ;       SS:BP:  Ptr to INTPACK
    17 ;   Parameters on INTPACK in SS:BP:
     16;       SS:BP:  Ptr to IDEPACK
     17;   Parameters on INTPACK:
    1818;       AL:     Feature Number (parameter to Features Register = subcommand)
    19 ;   (Parameter registers are undocumented, there are specific for this BIOS):
    20 ;       BH:     Parameter to Sector Count Register (subcommand specific)
    21 ;       BL:     Parameter to Sector Number Register (subcommand specific)
    22 ;       CL:     Parameter to Low Cylinder Register (subcommand specific)
    23 ;       CH:     Parameter to High Cylinder Register (subcommand specific)
    24 ;   Returns with INTPACK in SS:BP:
     19;   (Parameter registers are undocumented, these are specific for this BIOS):
     20;       BL:     Parameter to Sector Count Register (subcommand specific)
     21;       BH:     Parameter to LBA Low / Sector Number Register (subcommand specific)
     22;       CL:     Parameter to LBA Middle / Cylinder Low Register (subcommand specific)
     23;       CH:     Parameter to LBA High / Cylinder High Register (subcommand specific)
     24;   Returns with INTPACK:
    2525;       AH:     Int 13h return status
    2626;       CF:     0 if succesfull, 1 if error
     
    2828ALIGN JUMP_ALIGN
    2929AH23h_HandlerForSetControllerFeatures:
     30    xchg    si, ax      ; SI = Feature Number
     31    mov     dx, [bp+IDEPACK.intpack+INTPACK.bx]
    3032%ifndef USE_186
    3133    call    AH23h_SetControllerFeatures
     
    4042; AH23h_SetControllerFeatures
    4143;   Parameters:
    42 ;       AL:     Feature Number (parameter to Features Register = subcommand)
    43 ;       BH:     Parameter to Sector Count Register (subcommand specific)
    44 ;       BL:     Parameter to Sector Number Register (subcommand specific)
    45 ;       CL:     Parameter to Low Cylinder Register (subcommand specific)
    46 ;       CH:     Parameter to High Cylinder Register (subcommand specific)
     44;       DL:     Parameter to Sector Count Register (subcommand specific)
     45;       DH:     Parameter to LBA Low / Sector Number Register (subcommand specific)
     46;       CL:     Parameter to LBA Middle / Cylinder Low Register (subcommand specific)
     47;       CH:     Parameter to LBA High / Cylinder High Register (subcommand specific)
     48;       SI:     Feature Number (parameter to Features Register = subcommand)
    4749;       DS:DI:  Ptr to DPT (in RAMVARS segment)
     50;       SS:BP:  Ptr to IDEPACK
    4851;   Returns:
    4952;       AH:     Int 13h return status
    5053;       CF:     0 if succesfull, 1 if error
    5154;   Corrupts registers:
    52 ;       AX, BX, CX, DX, SI
     55;       AL, BX, CX, DX
    5356;--------------------------------------------------------------------
    5457ALIGN JUMP_ALIGN
    5558AH23h_SetControllerFeatures:
    56     ; Backup AL and BH to SI
    57     mov     ah, bh
    58     xchg    si, ax
    59 
    60     ; Select Master or Slave and wait until ready
    61     call    HDrvSel_SelectDriveAndDisableIRQ
    62     jc      SHORT .ReturnWithErrorCodeInAH
    63 
    64     ; Output Feature Number
    65     mov     ax, si                      ; Feature number to AL
    66     mov     dx, [RAMVARS.wIdeBase]      ; Load base port address
    67     inc     dx                          ; REGW_IDE_FEAT
    68     out     dx, al
    69 
    70     ; Output parameters to Sector Number Register and Cylinder Registers
    71     xor     bh, bh                      ; Zero head number
    72     dec     dx                          ; Back to base port address
    73     call    HCommand_OutputTranslatedLCHSaddress
    74 
    75     ; Output parameter to Sector Count Register and command
    76     xchg    ax, si                      ; Sector Count Reg param to AH
    77     mov     al, ah                      ; Sector Count Reg param to AL
    78     mov     ah, HCMD_SET_FEAT           ; Load Set Features command to AH
    79     call    HCommand_OutputSectorCountAndCommand
    80 
    81     jmp     HStatus_WaitBsyDefTime      ; Wait until drive ready
    82 .ReturnWithErrorCodeInAH:
    83     ret
     59    mov     al, COMMAND_SET_FEATURES
     60    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_BSY, FLG_STATUS_BSY)
     61    jmp     Idepack_StoreNonExtParametersAndIssueCommandFromAL
Note: See TracChangeset for help on using the changeset viewer.