Ignore:
Timestamp:
Feb 24, 2012, 10:28:31 AM (12 years ago)
Author:
gregli@…
google:author:
gregli@hotmail.com
Message:

More optimizations. Merged RamVars_IsFunction/DriveHandledByThisBIOS in with FindDPT_ForDriveNumber, since they are often used together, making a returned NULL DI pointer indicate a foreign drive in many places. Revamped the iteration done in the handlers for int13/0dh and int13h/0h. Added serial specific print string during drive detection.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm

    r261 r262  
    3737
    3838%ifdef MODULE_SERIAL
    39     jcxz    .done                           ; Set to zero on .ideVarsSerialAuto iteration (if any)
     39    jcxz    .AddHardDisks                   ; Set to zero on .ideVarsSerialAuto iteration (if any)
    4040%endif
    4141
     
    4848;
    4949    call    FindDPT_ToDSDIforSerialDevice
    50     jc      .done
     50    jnc     .AddHardDisks
    5151
    5252    mov     bp, ROMVARS.ideVarsSerialAuto   ; Point to our special IDEVARS structure, just for serial scans
     
    5858%endif
    5959
    60 .done: 
    61 %ifdef MODULE_SERIAL_FLOPPY
     60.AddHardDisks:
    6261;----------------------------------------------------------------------
    6362;
    64 ; Add in any emulated serial floppy drives.
    65 ;
    66     mov     al, [RAMVARS.xlateVars+XLATEVARS.bFlopCreateCnt]
    67     dec     al
    68     mov     cl, al
    69     js      .NoFloppies                     ; if no drives are present, we store 0ffh
     63; Add in hard disks to BDA, finalize our Count and First variables
     64;
     65    mov     cx, [RAMVARS.wDrvCntAndFlopCnt]     ; Our count of hard disks
     66    test    cl, cl
     67    jz      .AddFloppies                ; If none, nothing more to do
     68
     69    mov     al, [es:BDA.bHDCount]
     70    add     cl, al                      ; Add our drives to the system count
     71    mov     [es:BDA.bHDCount], cl       
     72    or      al, 80h                     ; Or in hard disk flag     
     73    mov     [RAMVARS.bFirstDrv], al     ; Store first drive number     
     74
     75
     76.AddFloppies:       
     77;%ifdef MODULE_SERIAL_FLOPPY       
     78;----------------------------------------------------------------------
     79;
     80; Add in any emulated serial floppy drives, finalize our packed Count and First variables
     81;
     82    dec     ch
     83    mov     al, ch
     84    js      .NoFloppies                     ; if no drives are present, we store 0ffh       
    7085
    7186    call    FloppyDrive_GetCountFromBIOS_or_BDA
     
    7388    push    ax
    7489
    75     add     al, cl                          ; Add our drives to existing drive count
     90    add     al, ch                          ; Add our drives to existing drive count
    7691    cmp     al, 3                           ; For BDA, max out at 4 drives (ours is zero based)
    7792    jl      .MaxBDAFloppiesExceeded
     
    92107    pop     ax
    93108
    94     shr     cl, 1                           ; number of drives, 1 or 2 only, to CF flag (clear=1, set=2)
     109    shr     ch, 1                           ; number of drives, 1 or 2 only, to CF flag (clear=1, set=2)
    95110    rcl     al, 1                           ; starting drive number in upper 7 bits, number of drives in low bit
    96111.NoFloppies:   
    97112    mov     [RAMVARS.xlateVars+XLATEVARS.bFlopCntAndFirst], al
    98 %endif
     113;%endif
    99114       
    100115    ret
Note: See TracChangeset for help on using the changeset viewer.