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/AH15h_HSize.asm

    r148 r150  
    1212;       DL:     Translated Drive number
    1313;       DS:DI:  Ptr to DPT (in RAMVARS segment)
    14 ;       SS:BP:  Ptr to INTPACK
    15 ;   Returns with INTPACK in SS:BP:
     14;       SS:BP:  Ptr to IDEPACK
     15;   Returns with INTPACK:
    1616;       If succesfull:
    1717;           AH:     3 (Hard disk accessible)
     
    2525ALIGN JUMP_ALIGN
    2626AH15h_HandlerForReadDiskDriveSize:
    27     call    HCapacity_GetSectorCountFromOurAH08h        ; Sector count to DX:AX
    28     mov     [bp+INTPACK.cx], dx                         ; HIWORD to CX
    29     mov     [bp+INTPACK.dx], ax                         ; LOWORD to DX
     27    call    AH15h_GetSectorCountToDXAX
     28    mov     [bp+IDEPACK.intpack+INTPACK.cx], dx         ; HIWORD to CX
     29    mov     [bp+IDEPACK.intpack+INTPACK.dx], ax         ; LOWORD to DX
    3030
    3131    xor     ah, ah
    32     call    HError_SetErrorCodeToIntpackInSSBPfromAH    ; Store success to BDA and CF
    33     mov     BYTE [bp+INTPACK.ah], 3                     ; Type code = Hard disk
     32    call    Int13h_SetErrorCodeToIntpackInSSBPfromAH    ; Store success to BDA and CF
     33    mov     BYTE [bp+IDEPACK.intpack+INTPACK.ah], 3     ; Type code = Hard disk
    3434    jmp     Int13h_ReturnFromHandlerWithoutStoringErrorCode
     35
     36
     37;--------------------------------------------------------------------
     38; AH15h_GetSectorCountFromForeignDriveToDXAX:
     39; AH15h_GetSectorCountToDXAX:
     40;   Parameters:
     41;       DL:     Drive number
     42;       DS:     RAMVARS segment
     43;       DS:DI:  Ptr to DPT (AH15h_GetSectorCount only)
     44;   Returns:
     45;       DX:AX:  Total sector count
     46;       BX:     Zero
     47;   Corrupts registers:
     48;       CX
     49;--------------------------------------------------------------------
     50AH15h_GetSectorCountFromForeignDriveToDXAX:
     51    mov     ah, GET_DRIVE_PARAMETERS
     52    call    Int13h_CallPreviousInt13hHandler
     53    jmp     SHORT ConvertAH08hReturnValuesToSectorCount
     54
     55ALIGN JUMP_ALIGN
     56AH15h_GetSectorCountToDXAX:
     57    call    AH8h_GetDriveParameters
     58    ; Fall to ConvertAH08hReturnValuesToSectorCount
     59
     60ConvertAH08hReturnValuesToSectorCount:
     61    call    HAddress_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)
     69    ret
Note: See TracChangeset for help on using the changeset viewer.