Changeset 227 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS


Ignore:
Timestamp:
Jan 29, 2012, 1:33:44 PM (12 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
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc

    r226 r227  
    1212    .bFlagsHigh                 resb    1
    1313    .bIdevarsOffset             resb    1   ; Offset to IDEVARS for this drive
    14                                 resb    1   ; alignment byte
    1514
    1615    ; IDE Drive related
    17     .dwCylinders                resb    4   ; Number of Cylinders
    18     .wHeadsAndSectors:
    19     .bHeads                     resb    1   ; Number of Heads (1...255)
    20     .bSectors                   resb    1   ; Number of Sectors per Track (1...63)
     16    ; .twLbaSectors is used for LBA addressing only.
     17    ; .wPchsCylinders and .bPchsSectors are used for CHS addressing only.
     18    .bLbaHeads:                             ; Number of LBA assisted heads (1...255)
     19    .twLbaSectors               resb    2   ; 48-bit sector count for LBA addressing
     20    .wPchsCylinders             resb    2   ; Number of P-CHS Cylinders (1...16383)
     21    .wPchsHeadsAndSectors:
     22    .bPchsHeads                 resb    1   ; Number of P-CHS heads (1...16)
     23    .bPchsSectors               resb    1   ; Number of P-CHS Sectors per Track (1...63)
    2124endstruc
    2225
  • trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc

    r203 r227  
    8383struc DRVPARAMS
    8484    .wFlags         resb    2   ; Drive flags
     85    .dwMaximumLBA:              ; User specified maximum number of sectors
    8586    .wCylinders     resb    2   ; User specified cylinders (1...16383)
    8687    .wHeadsAndSectors:
     
    9293FLG_DRVPARAMS_USERCHS   EQU (1<<0)  ; User specified P-CHS values
    9394FLG_DRVPARAMS_BLOCKMODE EQU (1<<1)  ; Enable Block mode transfers
     95FLG_DRVPARAMS_USERLBA   EQU (1<<2)  ; User specified LBA values
    9496
    9597
  • 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
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm

    r200 r227  
    4040    ret
    4141
    42        
     42
    4343;--------------------------------------------------------------------
    44 ; AccessDPT_GetLCHS
     44; AccessDPT_GetLCHStoAXBLBH
    4545;   Parameters:
    4646;       DS:DI:  Ptr to Disk Parameter Table
    4747;   Returns:
    48 ;       AX:     Number of L-CHS sectors per track
    49 ;       BX:     Number of L-CHS cylinders
    50 ;       DX:     Number of L-CHS heads
     48;       AX:     Number of L-CHS cylinders
     49;       BL:     Number of L-CHS heads
     50;       BH:     Number of L-CHS sectors per track
    5151;   Corrupts registers:
    52 ;       CX
     52;       CX, DX
    5353;--------------------------------------------------------------------
    54 AccessDPT_GetLCHS:
    55     ; Load CHS from DPT
    56     eMOVZX  ax, BYTE [di+DPT.bSectors]
    57     mov     bx, [di+DPT.dwCylinders]
    58     cwd
    59     mov     dl, [di+DPT.bHeads]
     54AccessDPT_GetLCHStoAXBLBH:
     55    ; Return LBA-assisted CHS if LBA addressing used
     56    test    BYTE [di+DPT.bFlagsLow], FLG_DRVNHEAD_LBA
     57    jz      SHORT .ConvertPchsToLchs
    6058
    61     ; Only need to limit sectors for LBA assist
    62     test    BYTE [di+DPT.bFlagsLow], FLG_DRVNHEAD_LBA
    63     jz      SHORT AccessDPT_ShiftPCHinBXDXtoLCH
     59    call    AccessDPT_GetLbaSectorCountToBXDXAX
     60    call    AtaID_GetLbaAssistedCHStoDXAXBLBH
     61    test    dx, dx
     62    jnz     SHORT .LimitAXtoMaxLCHScylinders
     63    cmp     ax, MAX_LCHS_CYLINDERS
     64    jbe     SHORT .returnLCHS
     65.LimitAXtoMaxLCHScylinders:
     66    mov     ax, MAX_LCHS_CYLINDERS
     67.returnLCHS:
     68    ret
    6469
    65     cmp     WORD [di+DPT.dwCylinders+2], BYTE 0
    66     jnz     SHORT .Return_MAX_LCHS_CYLINDERS
     70.ConvertPchsToLchs:
     71    mov     ax, [di+DPT.wPchsCylinders]
     72    mov     bx, [di+DPT.wPchsHeadsAndSectors]
     73    jmp     SHORT AccessDPT_ShiftPCHinAXBLtoLCH
    6774
    68     ; Limit cylinders to 1024
    69     cmp     bx, MAX_LCHS_CYLINDERS
    70     jb      SHORT .Return
    71 ALIGN JUMP_ALIGN
    72 .Return_MAX_LCHS_CYLINDERS:
    73     mov     bx, MAX_LCHS_CYLINDERS
    74 ALIGN JUMP_ALIGN, ret
    75 .Return:
     75
     76;--------------------------------------------------------------------
     77; AccessDPT_GetLbaSectorCountToBXDXAX
     78;   Parameters:
     79;       DS:DI:  Ptr to Disk Parameter Table
     80;   Returns:
     81;       BX:DX:AX:   48-bit sector count
     82;   Corrupts registers:
     83;       Nothing
     84;--------------------------------------------------------------------
     85AccessDPT_GetLbaSectorCountToBXDXAX:
     86    mov     ax, [di+DPT.twLbaSectors]
     87    mov     dx, [di+DPT.twLbaSectors+2]
     88    mov     bx, [di+DPT.twLbaSectors+4]
    7689    ret
    7790
    7891
    7992;--------------------------------------------------------------------
    80 ; AccessDPT_ShiftPCHinBXDXtoLCH
     93; AccessDPT_ShiftPCHinAXBLtoLCH
    8194;   Parameters:
    82 ;       BX:     P-CHS cylinders (1...16383)
    83 ;       DX:     P-CHS heads (1...16)
     95;       AX:     P-CHS cylinders (1...16383)
     96;       BL:     P-CHS heads (1...16)
    8497;   Returns:
    85 ;       BX:     Number of L-CHS cylinders (1...1024)
    86 ;       DX:     Number of L-CHS heads (1...255)
     98;       AX:     Number of L-CHS cylinders (1...1024)
     99;       BL:     Number of L-CHS heads (1...255)
    87100;       CX:     Number of bits shifted
    88101;   Corrupts registers:
    89102;       Nothing
    90103;--------------------------------------------------------------------
    91 AccessDPT_ShiftPCHinBXDXtoLCH:
     104AccessDPT_ShiftPCHinAXBLtoLCH:
    92105    xor     cx, cx
    93106.ShiftLoop:
    94     cmp     bx, MAX_LCHS_CYLINDERS      ; Need to shift?
     107    cmp     ax, MAX_LCHS_CYLINDERS      ; Need to shift?
    95108    jbe     SHORT .LimitHeadsTo255      ;  If not, return
    96109    inc     cx                          ; Increment shift count
    97     shr     bx, 1                       ; Halve cylinders
    98     shl     dx, 1                       ; Double heads
     110    shr     ax, 1                       ; Halve cylinders
     111    shl     bl, 1                       ; Double heads
    99112    jmp     SHORT .ShiftLoop
    100113.LimitHeadsTo255:                       ; DOS does not support drives with 256 heads
    101     sub     dl, dh                      ; DH set only when 256 logical heads
    102     xor     dh, dh
     114    cmp     bl, cl                      ; Set CF if BL is zero
     115    sbb     bl, ch                      ; If BL=0 then BL=255
    103116    ret
    104117
    105        
     118
    106119;--------------------------------------------------------------------
    107120; Returns pointer to DRVPARAMS for master or slave drive.
     
    144157    and     al, MASKL_DPT_ADDRESSING_MODE
    145158%endmacro
    146 
    147        
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm

    r193 r227  
    7878;       CS:BP:  Ptr to IDEVARS for the controller
    7979;   Returns:
    80 ;       DX:AX or AX:    Number of cylinders
    81 ;       BH:             Number of sectors per track
    82 ;       BL:             Number of heads
    83 ;   Corrupts registers:
    84 ;       CX, (DX)
     80;       Nothing
     81;   Corrupts registers:
     82;       AX, BX, CX, DX
    8583;--------------------------------------------------------------------
    8684.StoreAddressing:
     
    8886    call    AccessDPT_GetPointerToDRVPARAMStoCSBX
    8987    test    byte [cs:bx+DRVPARAMS.wFlags], FLG_DRVPARAMS_USERCHS    ; User specified CHS?
    90     jnz     SHORT .StoreUserDefinedCHSaddressing
     88    jnz     SHORT .StoreUserDefinedPCHS
    9189
    9290    ; Check if LBA supported
    9391    call    AtaID_GetPCHStoAXBLBHfromAtaInfoInESSI
    9492    test    BYTE [es:si+ATA1.wCaps+1], A1_wCaps_LBA>>8
    95     jz      SHORT .StoreCHSaddressing
     93    jz      SHORT .StoreCHSfromAXBHBL       ; Small old drive with CHS addressing only
    9694
    9795    ; Check if 48-bit LBA supported
     
    102100    or      BYTE [di+DPT.bFlagsLow], ADDRESSING_MODE_LBA28<<ADDRESSING_MODE_FIELD_POSITION
    103101    call    AtaID_GetTotalSectorCountToBXDXAXfromAtaInfoInESSI
     102    mov     [di+DPT.twLbaSectors], ax
     103    mov     [di+DPT.twLbaSectors+2], dx
     104    mov     [di+DPT.twLbaSectors+4], bx
    104105    call    AtaID_GetLbaAssistedCHStoDXAXBLBH
    105     jmp     SHORT .StoreChsFromDXAXBX
    106 
    107     ; Check if P-CHS to L-CHS translation required
    108 .StoreUserDefinedCHSaddressing:
     106    mov     [di+DPT.bLbaHeads], bl
     107    jmp     SHORT .StoreBlockMode
     108
     109;--------------------------------------------------------------------
     110; .StoreUserDefinedPCHS
     111;   Parameters:
     112;       DS:DI:  Ptr to Disk Parameter Table
     113;       ES:SI:  Ptr to 512-byte ATA information read from the drive
     114;       CS:BP:  Ptr to IDEVARS for the controller
     115;   Returns:
     116;       AX:     Number of P-CHS cylinders
     117;       BH:     Number of P-CHS sectors per track
     118;       BL:     Number of P-CHS heads
     119;   Corrupts registers:
     120;       Nothing
     121;--------------------------------------------------------------------
     122.StoreUserDefinedPCHS:
    109123    call    AccessDPT_GetPointerToDRVPARAMStoCSBX
    110124    mov     ax, [cs:bx+DRVPARAMS.wCylinders]
    111125    mov     bx, [cs:bx+DRVPARAMS.wHeadsAndSectors]
    112 .StoreCHSaddressing:
    113     cmp     ax, MAX_LCHS_CYLINDERS
    114     jbe     SHORT .StoreChsFromAXBX     ; No translation required
    115 
    116     ; We need to get number of bits to shift for translation
     126    ; Fall to .StoreCHSfromAXBHBL
     127
     128;--------------------------------------------------------------------
     129; .StoreCHSfromAXBHBL
     130;   Parameters:
     131;       AX:     Number of P-CHS cylinders
     132;       BH:     Number of P-CHS sectors per track
     133;       BL:     Number of P-CHS heads
     134;       DS:DI:  Ptr to Disk Parameter Table
     135;       ES:SI:  Ptr to 512-byte ATA information read from the drive
     136;       CS:BP:  Ptr to IDEVARS for the controller
     137;   Returns:
     138;       AX:     Number of P-CHS cylinders
     139;       BH:     Number of P-CHS sectors per track
     140;       BL:     Number of P-CHS heads
     141;   Corrupts registers:
     142;       CX
     143;--------------------------------------------------------------------
     144.StoreCHSfromAXBHBL:
    117145    push    ax
    118     eMOVZX  dx, bl                      ; Heads now in DX
    119     xchg    bx, ax                      ; Cylinders now in BX
    120     call    AccessDPT_ShiftPCHinBXDXtoLCH   ; Leaves AX untouched
    121     xchg    bx, ax                      ; Restore HeadsAndSectors to BX
     146    push    bx
     147    call    AccessDPT_ShiftPCHinAXBLtoLCH   ; Get number of bits to shift
     148    pop     bx
     149    pop     ax
     150    jcxz    .StorePCHSfromAXDX              ; Small drive so use L-CHS addressing
     151
     152    ; Store P-CHS addressing mode and number of bits to shift in L-CHS to P-CHS translation
    122153    or      cl, ADDRESSING_MODE_PCHS<<ADDRESSING_MODE_FIELD_POSITION
    123     or      [di+DPT.bFlagsLow], cl      ; Store bits to shift
    124     pop     ax
    125     ; Fall to .StoreChsFromAXBX
    126 
    127 ;--------------------------------------------------------------------
    128 ; .StoreChsFromAXBX
    129 ; .StoreChsFromDXAXBX
    130 ;   Parameters:
    131 ;       DX:AX or AX:    Number of cylinders
    132 ;       BH:     Number of sectors per track
    133 ;       BL:     Number of heads
    134 ;       DS:DI:  Ptr to Disk Parameter Table
    135 ;       ES:SI:  Ptr to 512-byte ATA information read from the drive
    136 ;       CS:BP:  Ptr to IDEVARS for the controller
    137 ;   Returns:
    138 ;       Nothing
    139 ;   Corrupts registers:
    140 ;       DX
    141 ;--------------------------------------------------------------------
    142 .StoreChsFromAXBX:
    143     xor     dx, dx
    144 .StoreChsFromDXAXBX:
    145     mov     [di+DPT.dwCylinders], ax
    146     mov     [di+DPT.dwCylinders+2], dx
    147     mov     [di+DPT.wHeadsAndSectors], bx
     154    or      [di+DPT.bFlagsLow], cl
     155    ; Fall to .StoreChsFromAXBLBH
     156
     157;--------------------------------------------------------------------
     158; .StoreChsFromAXBLBH
     159;   Parameters:
     160;       AX:     Number of P-CHS cylinders
     161;       BH:     Number of P-CHS sectors per track
     162;       BL:     Number of P-CHS heads
     163;       DS:DI:  Ptr to Disk Parameter Table
     164;       ES:SI:  Ptr to 512-byte ATA information read from the drive
     165;       CS:BP:  Ptr to IDEVARS for the controller
     166;   Returns:
     167;       Nothing
     168;   Corrupts registers:
     169;       Nothing
     170;--------------------------------------------------------------------
     171.StorePCHSfromAXDX:
     172    mov     [di+DPT.wPchsCylinders], ax
     173    mov     [di+DPT.wPchsHeadsAndSectors], bx
    148174    ; Fall to .StoreBlockMode
    149175
Note: See TracChangeset for help on using the changeset viewer.