Ignore:
Timestamp:
Sep 18, 2011, 11:41:29 AM (13 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • L-CHS parameters are now generated differently for LBA enabled drives.
  • Booting to EBIOS partitions now seems to work (at least on one drive).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm

    r161 r173  
    5959
    6060;--------------------------------------------------------------------
    61 ; AccessDPT_GetLCHSfromPCHS
     61; AccessDPT_GetLCHS
    6262;   Parameters:
    6363;       DS:DI:  Ptr to Disk Parameter Table
     
    6767;       DX:     Number of L-CHS heads
    6868;   Corrupts registers:
     69;       CX
     70;--------------------------------------------------------------------
     71AccessDPT_GetLCHS:
     72    ; Load CHS from DPT
     73    eMOVZX  ax, BYTE [di+DPT.bSectors]
     74    mov     bx, [di+DPT.dwCylinders]
     75    cwd
     76    mov     dl, [di+DPT.bHeads]
     77
     78    ; Only need to limit sectors for LBA assist
     79    test    BYTE [di+DPT.bFlagsLow], FLG_DRVNHEAD_LBA
     80    jnz     SHORT .ReturnLbaAssistedLCHS
     81
     82    ; P-CHS to L-CHS translation when necessary
     83    jmp     SHORT AccessDPT_ShiftPCHinBXDXtoLCH
     84
     85.ReturnLbaAssistedLCHS:
     86    cmp     WORD [di+DPT.dwCylinders+2], BYTE 0
     87    jz      SHORT .LimitCylindersTo1024
     88    mov     bx, MAX_LCHS_CYLINDERS
     89.LimitCylindersTo1024:
     90    MIN_U   bx, MAX_LCHS_CYLINDERS
     91    ret
     92
     93
     94;--------------------------------------------------------------------
     95; AccessDPT_ShiftPCHinBXDXtoLCH
     96;   Parameters:
     97;       BX:     P-CHS cylinders (1...16383)
     98;       DX:     P-CHS heads (1...16)
     99;   Returns:
     100;       BX:     Number of L-CHS cylinders (1...1024)
     101;       DX:     Number of L-CHS heads (1...255)
     102;       CX:     Number of bits shifted
     103;   Corrupts registers:
    69104;       Nothing
    70105;--------------------------------------------------------------------
    71 ALIGN JUMP_ALIGN
    72 AccessDPT_GetLCHSfromPCHS:
    73     mov     al, [di+DPT.bFlagsLow]
    74     and     al, MASKL_DPT_CHS_SHIFT_COUNT   ; Load shift count
    75     xchg    cx, ax
    76     mov     bx, [di+DPT.wPchsCylinders]     ; Load P-CHS cylinders
    77     shr     bx, cl                          ; Shift to L-CHS cylinders
    78     xchg    cx, ax
    79     eMOVZX  ax, BYTE [di+DPT.bPchsSectors]  ; Load Sectors per track
    80     cwd
    81     mov     dl, [di+DPT.bLchsHeads]         ; Load L-CHS heads
     106AccessDPT_ShiftPCHinBXDXtoLCH:
     107    xor     cx, cx
     108.ShiftLoop:
     109    cmp     bx, MAX_LCHS_CYLINDERS      ; Need to shift?
     110    jbe     SHORT .LimitHeadsTo255      ;  If not, return
     111    inc     cx                          ; Increment shift count
     112    shr     bx, 1                       ; Halve cylinders
     113    shl     dx, 1                       ; Double heads
     114    jmp     SHORT .ShiftLoop
     115.LimitHeadsTo255:                       ; DOS does not support drives with 256 heads
     116    sub     dl, dh                      ; BH set only when 256 logical heads
     117    xor     dh, dh
    82118    ret
    83119
Note: See TracChangeset for help on using the changeset viewer.