Changeset 262 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Initialization


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.

Location:
trunk/XTIDE_Universal_BIOS/Src/Initialization
Files:
3 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
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm

    r254 r262  
    4343    mov     dx, [cs:bp+IDEVARS.bDevice-1]   ; for Serial: AL=port address>>2, AH=baud rate
    4444                                            ;             DL=COM number character, DH=.bDevice
    45 
     45       
     46    mov     si, g_szDetectOuter             ; Load SI with default wrapper string "IDE %s at %s: "
     47       
    4648    push    bp                              ; setup stack for call to
    4749    mov     bp, sp                          ; BootMenuPrint_FormatCSSIfromParamsInSSBP
     
    7274
    7375    test    dl, dl                          ; Check if serial port "Auto"
    74     jz      .pushAndPrint                   ; CX = string to print, AX and DX won't be used
     76    jz      .pushAndPrintSerial             ; CX = string to print, AX and DX won't be used
    7577
    7678    mov     cl, (g_szDetectCOMLarge-$$) & 0xff  ; Setup secondary print string for "COMn/xx.yK"
     
    8890
    8991    cmp     ax,si                           ; < 10: "2400", "9600", etc.; >= 10: "19.2K", "38.4K", etc.
    90     jae     .pushAndPrint
     92    jae     .pushAndPrintSerial
    9193
    9294    mov     cl, (g_szDetectCOMSmall-$$) & 0xff  ; Setup secondary print string for "COMn/XXy00"
     95
     96.pushAndPrintSerial:   
     97    mov     si, g_szDetectOuterSerial       ; Finally load SI with wrapper string "Serial %s on %s: "       
    9398
    9499.pushAndPrint:
     
    96101    push    ax                              ; Push high order digits, or port address, or N/A
    97102    push    dx                              ; Push low order digit, or N/A
    98 
    99     mov     si, g_szDetectOuter             ; Finally load SI with wrapper string "IDE %s at %s: "
    100103
    101104    jmp     short DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm

    r259 r262  
    7272.StoreDptPointersToIntVectors:
    7373    mov     dl, 80h
    74     call    RamVars_IsDriveHandledByThisBIOS_And_FindDPT_ForDriveNumber   ; DPT to DS:DI
     74    call    FindDPT_ForDriveNumberInDL   ; DPT to DS:DI
    7575    jc      SHORT .FindForDrive81h  ; Store nothing if not our drive
    7676    mov     [es:HD0_DPT_POINTER_41h*4], di
     
    7878.FindForDrive81h:
    7979    inc     dx
    80     call    RamVars_IsDriveHandledByThisBIOS_And_FindDPT_ForDriveNumber
     80    call    FindDPT_ForDriveNumberInDL
    8181    jc      SHORT .ResetDetectedDrives
    8282    mov     [es:HD1_DPT_POINTER_46h*4], di
Note: See TracChangeset for help on using the changeset viewer.