Changeset 259 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS


Ignore:
Timestamp:
Feb 23, 2012, 7:14:06 AM (12 years ago)
Author:
gregli@…
google:author:
gregli@hotmail.com
Message:

For function int13/0h, restored the code to only reset the floppy drives if a floppy drive was passed in for reset. Other minor optimizations. Better create new floppy support in Serial Server.

Location:
trunk/XTIDE_Universal_BIOS/Src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm

    r258 r259  
    2323    mov     bp, sp
    2424
    25     call    RamVars_IsDriveHandledByThisBIOS               
     25    call    RamVars_IsDriveHandledByThisBIOS_And_FindDPT_ForDriveNumber
    2626    jc      .notOurs
    2727
    28     call    FindDPT_ForDriveNumber                  ; if it is one of ours, print the string in bootnfo
    2928    call    BootMenuInfo_ConvertDPTtoBX
    3029    mov     si, g_szDriveNumBOOTNFO                 ; special g_szDriveNum that prints from BDA
     
    112111    mov     si, g_szCapacity                            ; Setup print string now, carries through to print call
    113112
    114     xor     di, di
    115     call    RamVars_IsDriveHandledByThisBIOS
    116     jc      SHORT .notours
    117     call    FindDPT_ForDriveNumber                      ; DS:DI to point DPT
    118 .notours:       
    119        
     113    xor     di, di                                      ; Zero DI for checks for our drive later on
     114    call    RamVars_IsDriveHandledByThisBIOS_And_FindDPT_ForDriveNumber
     115
    120116    test    dl, dl                                      ; are we a hard disk?
    121     js      BootMenuPrint_HardDiskRefreshInformation       
    122 
    123     test    di,di
    124     jnz     .ours
     117    js      BootMenuPrint_HardDiskRefreshInformation   
     118
     119    test    di, di
     120    jnz     .ours                                       ; Based on CF from RamVars_IsDriveHandledByThisBIOS above
    125121    call    FloppyDrive_GetType                         ; Get Floppy Drive type to BX
    126122    jmp     .around
     
    187183; BootMenuPrint_HardDiskMenuitemInformation
    188184;   Parameters:
    189 ;       DL:     Untranslated Hard Disk number
    190185;       DS:     RAMVARS segment
    191186;   Returns:
     
    196191ALIGN JUMP_ALIGN
    197192BootMenuPrint_HardDiskRefreshInformation:       
    198     test    di,di
     193    test    di, di
    199194    jz      .HardDiskMenuitemInfoForForeignDrive       
    200195
    201196.HardDiskMenuitemInfoForOurDrive:
    202     ePUSH_T ax, g_szInformation
    203 
    204     ; Get and push total LBA size
    205     call    BootMenuInfo_GetTotalSectorCount
     197    ePUSH_T ax, g_szInformation                     ; Add substring for our hard disk information
     198    call    BootMenuInfo_GetTotalSectorCount        ; Get Total LBA Size
    206199    jmp     .ConvertSectorCountInBXDXAXtoSizeAndPushForFormat
    207200       
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm

    r258 r259  
    2222    eMOVZX  bx, dl                      ; Copy requested drive to BL, zero BH to assume no errors
    2323    call    ResetFloppyDrivesWithInt40h
     24
     25%ifdef MODULE_SERIAL_FLOPPY
     26;
     27; "Reset" emulatd serial floppy drives, if any.  There is nothing to actually do for this reset,
     28; but record the proper error return code if one of these floppy drives is the drive requested.
     29;
     30    call    RamVars_UnpackFlopCntAndFirstToAL
     31    cbw                                                 ; Clears AH (there are flop drives) or ffh (there are not)
     32                                                        ; Either AH has success code (flop drives are present)
     33                                                        ; or it doesn't matter because we won't match drive ffh
     34
     35    cwd                                                 ; clears DX (there are flop drives) or ffffh (there are not)
     36
     37    adc     dl, al                                      ; second drive (CF set) if present
     38                                                        ; If no drive is present, this will result in ffh which
     39                                                        ; won't match a drive
     40    call    BackupErrorCodeFromTheRequestedDriveToBH
     41    mov     dl, al                                      ; We may end up doing the first drive twice (if there is
     42    call    BackupErrorCodeFromTheRequestedDriveToBH    ; only one drive), but doing it again is not harmful.
     43%endif
     44
     45    test    bl, bl                                      ; If we were called with a floppy disk, then we are done,
     46    jns     SHORT .SkipHardDiskReset                    ; don't do hard disks.
     47       
    2448    call    ResetForeignHardDisks
    2549    call    AH0h_ResetHardDisksHandledByOurBIOS
     
    129153    jb      SHORT .DriveResetLoop       ;  If not, reset next drive
    130154.AllDrivesReset:
    131 %ifdef MODULE_SERIAL_FLOPPY
    132 ;
    133 ; "Reset" emulatd serial floppy drives, if any.  There is nothing to actually do for this reset,
    134 ; but record the proper error return code if one of these floppy drives is the drive requested.
    135 ;
    136     call    RamVars_UnpackFlopCntAndFirstToAL
    137 
    138     cbw                                                 ; Clears AH (there are flop drives) or ffh (there are not)
    139                                                         ; Either AH has success code (flop drives are present)
    140                                                         ; or it doesn't matter because we won't match drive ffh
    141 
    142     cwd                                                 ; clears DX (there are flop drives) or ffffh (there are not)
    143 
    144     adc     dl, al                                      ; second drive (CF set) if present
    145                                                         ; If no drive is present, this will result in ffh which
    146                                                         ; won't match a drive
    147     call    BackupErrorCodeFromTheRequestedDriveToBH
    148     mov     dl, al                                      ; We may end up doing the first drive twice (if there is
    149     jmp     BackupErrorCodeFromTheRequestedDriveToBH    ; only one drive), but doing it again is not harmful.
    150 %else
    151     ret
    152 %endif
    153        
     155    ret
     156
     157               
    154158;--------------------------------------------------------------------
    155159; .BackupErrorCodeFromMasterOrSlaveToBH
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm

    r258 r259  
    7272.StoreDptPointersToIntVectors:
    7373    mov     dl, 80h
    74     call    RamVars_IsDriveHandledByThisBIOS
     74    call    RamVars_IsDriveHandledByThisBIOS_And_FindDPT_ForDriveNumber   ; DPT to DS:DI
    7575    jc      SHORT .FindForDrive81h  ; Store nothing if not our drive
    76     call    FindDPT_ForDriveNumber  ; DPT to DS:DI
    7776    mov     [es:HD0_DPT_POINTER_41h*4], di
    7877    mov     [es:HD0_DPT_POINTER_41h*4+2], ds
    7978.FindForDrive81h:
    8079    inc     dx
    81     call    RamVars_IsDriveHandledByThisBIOS
     80    call    RamVars_IsDriveHandledByThisBIOS_And_FindDPT_ForDriveNumber
    8281    jc      SHORT .ResetDetectedDrives
    83     call    FindDPT_ForDriveNumber
    8482    mov     [es:HD1_DPT_POINTER_46h*4], di
    8583    mov     [es:HD1_DPT_POINTER_46h*4+2], ds
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm

    r258 r259  
    2323    add     al, [RAMVARS.xlateVars+XLATEVARS.bFlopCreateCnt]
    2424%endif
    25     xchg    ax, dx     
    26     ; Fall to FindDPT_ForDriveNumber
    27 
     25    xchg    ax, dx
     26    ; fall-through to FindDPT_ForDriveNumber
    2827
    2928;--------------------------------------------------------------------
     
    6665    xchg    di, ax                      ; Restore AX and put result in DI
    6766    pop     dx
    68     ret
     67       
     68    ret
     69
     70;--------------------------------------------------------------------
     71; Consolidator for checking the result from RamVars_IsDriveHandledByThisBIOS
     72; and then if it is our drive, getting the DPT with FindDPT_ForDriveNumber
     73;
     74; RamVars_IsDriveHandledByThisBIOS_And_FindDPT_ForDriveNumber
     75;   Parameters:
     76;       DL:     Drive number
     77;       DS:     RAMVARS segment
     78;   Returns:
     79;       DS:DI:  Ptr to DPT, if it is our drive
     80;       CF:     Set if not our drive, clear if it is our drive
     81;   Corrupts registers:
     82;       Nothing
     83;--------------------------------------------------------------------
     84ALIGN JUMP_ALIGN
     85RamVars_IsDriveHandledByThisBIOS_And_FindDPT_ForDriveNumber:
     86    call    RamVars_IsDriveHandledByThisBIOS
     87    jnc     FindDPT_ForDriveNumber
     88    ret
     89
    6990
    7091;--------------------------------------------------------------------
     
    212233    push    cx
    213234
    214     mov     cl, [RAMVARS.bDrvCnt]       
    215     mov     ch, 0
    216        
    217235    mov     di, RAMVARS_size            ; Point DS:DI to first DPT
    218236       
    219     jcxz    .NotFound                   ; Return if no drives
     237    mov     cl, [RAMVARS.bDrvCnt]
     238    xor     ch, ch                      ; Clears CF 
     239       
     240    jcxz    .AllDptsIterated            ; Return if no drives, CF will be clear from xor above
    220241       
    221242ALIGN JUMP_ALIGN
     
    223244    call    si                          ; Is wanted DPT?
    224245    jc      SHORT .AllDptsIterated      ;  If so, return
    225     add     di, BYTE LARGEST_DPT_SIZE   ; Point to next DPT
     246    add     di, BYTE LARGEST_DPT_SIZE   ; Point to next DPT, clears CF
    226247    loop    .LoopWhileDPTsLeft
    227        
    228 .NotFound:     
    229     clc                                 ; Clear CF since DPT not found
     248   
     249    ; fall-through: DPT was not found, CF is already clear from ADD di inside the loop
    230250       
    231251ALIGN JUMP_ALIGN
     
    233253    pop     cx
    234254    ret
     255
Note: See TracChangeset for help on using the changeset viewer.