Ignore:
Timestamp:
Aug 6, 2010, 7:11:04 AM (14 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Correct number of drives is now returned from AH=08h even when it is redirected to foreign BIOS.

File:
1 edited

Legend:

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

    r3 r32  
    22; Project name  :   IDE BIOS
    33; Created date  :   14.3.2010
    4 ; Last update   :   2.5.2010
     4; Last update   :   3.8.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Functions for accessings RAMVARS.
     
    130130RamVars_IsFunctionHandledByThisBIOS:
    131131    test    ah, ah          ; Reset for all floppy and hard disk drives?
    132     jnz     SHORT RamVars_IsDriveHandledByThisBIOS
     132    jz      SHORT .FunctionIsHandledByOurBIOS
     133    cmp     ah, 08h         ; Read Disk Drive Parameters?
     134    jne     SHORT RamVars_IsDriveHandledByThisBIOS
     135    test    dl, 80h         ; We dot not handle floppy drives
     136    jz      SHORT .FunctionIsNotHandledByOurBIOS
     137ALIGN JUMP_ALIGN
     138.FunctionIsHandledByOurBIOS:
    133139    stc
     140.FunctionIsNotHandledByOurBIOS:
    134141    ret
    135142
     
    190197
    191198;--------------------------------------------------------------------
    192 ; Return number of Hard Disks in system.
    193 ;
    194 ; RamVars_GetDriveCounts
    195 ;   Parameters:
    196 ;       DS:     RAMVARS segment
    197 ;   Returns:
    198 ;       AL:     Number of hard disks handled by our BIOS
    199 ;       CX:     Total number of hard disks in system
    200 ;   Corrupts registers:
    201 ;       AH
    202 ;--------------------------------------------------------------------
    203 ALIGN JUMP_ALIGN
    204 RamVars_GetDriveCounts:
     199; RamVars_GetHardDiskCountFromBDAtoCX
     200;   Parameters:
     201;       DS:     RAMVARS segment
     202;   Returns:
     203;       CX:     Total hard disk count
     204;   Corrupts registers:
     205;       Nothing
     206;--------------------------------------------------------------------   
     207ALIGN JUMP_ALIGN
     208RamVars_GetHardDiskCountFromBDAtoCX:
    205209    push    es
     210    push    dx
     211
    206212    LOAD_BDA_SEGMENT_TO es, cx          ; Zero CX
    207     mov     cl, [es:BDA.bHDCount]       ; Total hard drive count
    208     mov     al, [RAMVARS.bDrvCnt]       ; Our drive count
     213    call    RamVars_GetCountOfKnownDrivesToDL
     214    MAX_U   dl, [es:BDA.bHDCount]
     215    mov     cl, dl
     216
     217    pop     dx
    209218    pop     es
    210219    ret
     220
     221;--------------------------------------------------------------------
     222; RamVars_GetCountOfKnownDrivesToDL
     223;   Parameters:
     224;       DS:     RAMVARS segment
     225;   Returns:
     226;       DL:     Total hard disk count
     227;   Corrupts registers:
     228;       Nothing
     229;--------------------------------------------------------------------   
     230ALIGN JUMP_ALIGN
     231RamVars_GetCountOfKnownDrivesToDL:
     232    mov     dl, [RAMVARS.bFirstDrv]     ; Number for our first drive
     233    add     dl, [RAMVARS.bDrvCnt]       ; Our drives
     234    and     dl, 7Fh                     ; Clear HD bit for drive count
     235    ret
Note: See TracChangeset for help on using the changeset viewer.