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


Ignore:
Timestamp:
Apr 15, 2013, 4:03:33 PM (12 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Fixed a bug that allowed EBIOS functions for user defined CHS.
  • Simplified user defined CHS and LBA setup a little.
Location:
trunk/XTIDE_Universal_BIOS/Src/Handlers
Files:
4 edited

Legend:

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

    r540 r542  
    123123ALIGN JUMP_ALIGN
    124124.JumpToEbiosFunction:
    125     test    BYTE [di+DPT.bFlagsLow], FLGL_DPT_LBA_AND_EBIOS_SUPPORTED
     125    test    BYTE [di+DPT.bFlagsLow], FLGL_DPT_LBA
    126126    jz      SHORT UnsupportedFunction   ; No eINT 13h for CHS drives
    127127    sub     bl, 41h<<1                  ; BX = Offset to eINT 13h jump table
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm

    r526 r542  
    9999;;; SelectDrive
    100100    ; Try to select drive and wait until ready
    101     call    AccessDPT_GetDriveSelectByteForOldInt13hToAL
     101    call    AccessDPT_GetDriveSelectByteToAL
    102102    mov     [bp+IDEPACK.bDrvAndHead], al
    103103    call    Device_SelectDrive
     
    130130
    131131;;; InitializeDeviceParameters
    132     ; Initialize CHS parameters if LBA is not used and
    133     ; user has specified P-CHS parameters
    134     test    BYTE [di+DPT.bFlagsLow], FLGL_DPT_ASSISTED_LBA
    135     jnz     SHORT .SkipInitializeDeviceParameters       ; No need to initialize CHS parameters if LBA mode enabled
    136     call    AccessDPT_GetPointerToDRVPARAMStoCSBX
    137     test    BYTE [cs:bx+DRVPARAMS.wFlags], FLG_DRVPARAMS_USERCHS    ; User specified P-CHS?
    138     jz      SHORT .SkipInitializeDeviceParameters
    139 
    140132    ; Initialize Logical Sectors per Track and Max Head number
    141     mov     ax, [cs:bx+DRVPARAMS.wHeadsAndSectors]
     133    mov     ax, [di+DPT.wPchsHeadsAndSectors]
    142134    dec     ax                          ; Max Head number
    143     xchg    al, ah                      ; Heads now in AH
    144     mov     dx, ax                      ; Sectors per Track now in DL
     135    xchg    ah, al
     136    mov     dl, al                      ; Sectors per track
    145137    mov     al, COMMAND_INITIALIZE_DEVICE_PARAMETERS
    146138    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_BSY, FLG_STATUS_BSY)
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm

    r541 r542  
    5252;    AH=48h Total Sector Count: 11873* 16*63 = 11,967,984
    5353;
    54 ; Notice how AH=48h returns lesser total sector count than AH=8h! The only
     54; Notice how AH=48h returns lesser total sector count than AH=08h! The only
    5555; way I could think of to get 11873 cylinders is to divide AH=08h sector
    5656; count with P-CHS heads and sectors: (745*255*63) / (16*63) = 11873
    5757;
    58 ; I have no idea what is the reasoning behind it but at least there is one
    59 ; BIOS that does just that.
    60 ;
    61 ; I decided that we multiply P-CHS values and do not waste space like the
    62 ; Award BIOS does.
     58; The only reason I can think of is that the Award BIOS has a bug and
     59; uses L-CHS when it should use P-CHS values in the calculation.
    6360;
    6461;
     
    139136    ; Store P-CHS. Based on phoenix specification this is returned only if
    140137    ; total sector count is 15,482,880 or less.
    141     sub     ax, 4001h
    142     sbb     dx, 0ECh
     138    sub     ax, MAX_SECTOR_COUNT_TO_RETURN_PCHS & 0FFFFh
     139    sbb     dx, MAX_SECTOR_COUNT_TO_RETURN_PCHS >> 16
    143140    sbb     bx, cx      ; Zero
    144     jnc     SHORT .ReturnWithSuccess    ; More than EC4000h
    145     or      WORD [di+EDRIVE_INFO.wFlags], FLG_CHS_INFORMATION_IS_VALID
     141    ja      SHORT .ReturnWithSuccess
     142    or      BYTE [di+EDRIVE_INFO.wFlags], FLG_CHS_INFORMATION_IS_VALID
    146143
    147144    eMOVZX  dx, BYTE [es:si+DPT.bPchsHeads]
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Address.asm

    r526 r542  
    120120; Only 24-bits are used since LHCS to LBA28 conversion has 8.4GB limit.
    121121; LBA = ((cylToSeek*headsPerCyl+headToSeek)*sectPerTrack)+sectToSeek-1
     122; headsPerCyl and sectPerTrack are the current translation values (L-CHS).
    122123;
    123124; Returned address is in same registers that
Note: See TracChangeset for help on using the changeset viewer.