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


Ignore:
Timestamp:
Feb 10, 2012, 3:12:40 AM (12 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes:

  • Optimizations (both for size and speed) in IdeTransfer.asm and MemIdeTransfer.asm
  • Fixed a bug where the SingleByteRead/Write functions in IdeTransfer.asm would fail on 128 sector transfers.
  • Fixed some typos and errors in general, comments etc.
Location:
trunk/XTIDE_Universal_BIOS/Src/Initialization
Files:
2 edited

Legend:

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

    r233 r242  
    2929
    3030    mov     cx, g_szDetectSlave
    31     mov     bh, MASK_DRVNHEAD_SET | FLG_DRVNHEAD_DRV 
     31    mov     bh, MASK_DRVNHEAD_SET | FLG_DRVNHEAD_DRV
    3232    call    StartDetectionWithDriveSelectByteInBHandStringInAX
    33        
     33
    3434    pop     cx
    3535
    3636    add     bp, BYTE IDEVARS_size           ; Point to next IDEVARS
    3737
    38 %ifdef MODULE_SERIAL       
     38%ifdef MODULE_SERIAL
    3939    jcxz    .done                           ; Set to zero on .ideVarsSerialAuto iteration (if any)
    4040%endif
    41        
     41
    4242    loop    .DriveDetectLoop
    4343
    44 %ifdef MODULE_SERIAL       
     44%ifdef MODULE_SERIAL
    4545;
    4646; if serial drive detected, do not scan (avoids duplicate drives and isn't needed - we already have a connection)
     
    4949    jc      .done
    5050
    51     mov     bp, ROMVARS.ideVarsSerialAuto   ; Point to our special IDEVARS sructure, just for serial scans     
    52                
     51    mov     bp, ROMVARS.ideVarsSerialAuto   ; Point to our special IDEVARS structure, just for serial scans
     52
    5353    mov     al,[cs:ROMVARS.wFlags]          ; Configurator set to always scan?
    5454    or      al,[es:BDA.bKBFlgs1]            ; Or, did the user hold down the ALT key?
    5555    and     al,8                            ; 8 = alt key depressed, same as FLG_ROMVARS_SERIAL_ALWAYSDETECT
    56     jnz     .DriveDetectLoop                           
     56    jnz     .DriveDetectLoop
    5757%endif
    5858
     
    6161
    6262%if FLG_ROMVARS_SERIAL_SCANDETECT != 8
    63 %error "DetectDrives is currently coded to assume that FLG_ROMVARS_SERIAL_SCANDETECT is the same bit as the ALT key code in the BDA.  Changes in the code will be needed if these values are no longer the same."
     63    %error "DetectDrives is currently coded to assume that FLG_ROMVARS_SERIAL_SCANDETECT is the same bit as the ALT key code in the BDA.  Changes in the code will be needed if these values are no longer the same."
    6464%endif
    6565
    66        
     66
    6767;--------------------------------------------------------------------
    6868; StartDetectionWithDriveSelectByteInBHandStringInAX
     
    110110    ;call   ReadAtapiInfoFromDrive      ; Assume CD-ROM
    111111    ;jnc    SHORT _CreateBiosTablesForCDROM
    112    
     112
    113113    ;jmp    short DetectDrives_DriveNotFound
    114114;;; fall-through instead of previous jmp instruction
     
    122122;       AX, SI
    123123;--------------------------------------------------------------------
    124 DetectDrives_DriveNotFound:     
     124DetectDrives_DriveNotFound:
    125125    mov     si, g_szNotFound
    126     jmp     BootMenuPrint_NullTerminatedStringFromCSSIandSetCF     
     126    jmp     BootMenuPrint_NullTerminatedStringFromCSSIandSetCF
    127127
    128128
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm

    r235 r242  
    2222    ePUSH_T ax, ROMVARS.szTitle         ; Bios title string
    2323    push    cs                          ; BIOS segment
    24        
    25 DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay:     
     24
     25DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay:
    2626    jmp     BootMenuPrint_FormatCSSIfromParamsInSSBP
    2727
     
    3232;       CS:CX:  Ptr to "Master" or "Slave" string
    3333;       CS:BP:  Ptr to IDEVARS
    34 ;       SI:     Ptr to template string 
     34;       SI:     Ptr to template string
    3535;   Returns:
    3636;       Nothing
     
    4444                                            ;             DL=COM number character, DH=.bDevice
    4545
    46     push    bp                              ; setup stack for call to 
     46    push    bp                              ; setup stack for call to
    4747    mov     bp, sp                          ; BootMenuPrint_FormatCSSIfromParamsInSSBP
    4848
    4949    push    cx                              ; Push "Master" or "Slave"
    50        
     50
    5151    mov     cl, (g_szDetectPort-$$) & 0xff  ; Setup print string for standard IDE
    5252                                            ; Note that we modify only the low order bits of CX a lot here,
     
    5555                                            ; on the same 256 byte page, which is checked in strings.asm.
    5656
    57     cmp     dx, DEVICE_SERIAL_PORT << 8     ; Check if this is a serial device, 
     57    cmp     dx, DEVICE_SERIAL_PORT << 8     ; Check if this is a serial device,
    5858                                            ; And also check if DL is zero, check with the jz below
    59                                             ; This optimization requires that DEVICE_SERIAL_PORT be 
     59                                            ; This optimization requires that DEVICE_SERIAL_PORT be
    6060                                            ; the highest value in the DEVICE_* series, ensuring that
    6161                                            ; anything less in the high order bits is a different device.
    6262
    63     jl      .pushAndPrint                   ; CX = string to print, AX = port address, DX won't be used
     63    jb      .pushAndPrint                   ; CX = string to print, AX = port address, DX won't be used
    6464
    6565    mov     cl, (g_szDetectCOM-$$) & 0xff   ; Setup print string for COM ports
     
    6868
    6969    push    dx                              ; Push COM number character
    70                                             ; If the strnig is going to be "Auto", we will push a NULL (zero)
    71                                             ; here for the COM port number, which will be eaten by the 
    72                                             ; print routine (DisplayPrint_CharacterFromAL), resulting in 
     70                                            ; If the string is going to be "Auto", we will push a NULL (zero)
     71                                            ; here for the COM port number, which will be eaten by the
     72                                            ; print routine (DisplayPrint_CharacterFromAL), resulting in
    7373                                            ; just "COM" being printed without a character after it.
    74                
     74
    7575    mov     cl, (g_szDetectCOMAuto-$$) & 0xff   ; Setup secondary print string for "Auto"
    76        
     76
    7777    jz      .pushAndPrint                   ; CX = string to print, AX and DX won't be used
    78        
     78
    7979    mov     cl, (g_szDetectCOMLarge-$$) & 0xff  ; Setup secondary print string for "COMn/xx.yK"
    8080
     
    8282    cbw                                     ; clear AH, AL will always be less than 128
    8383    xchg    si,ax                           ; move AX to SI for divide
    84     mov     ax,1152                         ; baud rate to displa is 115200/divisor, the "00" is handled
     84    mov     ax,1152                         ; baud rate to display is 115200/divisor, the "00" is handled
    8585                                            ; in the print strings
    86     xor     dx,dx                           ; clear top 16-bits of dividend
     86    cwd                                     ; clear top 16-bits of dividend
    8787    div     si                              ; and divide...  Now AX = baud rate/100, DX = 0 (always a clean divide)
    88        
     88
    8989    mov     si,10                           ; Now separate the whole portion from the fractional for "K" display
    9090    div     si                              ; and divide...  Now AX = baud rate/1000, DX = low order digit
    91        
    92     cmp     ax,si                           ; <= 10: "2400", "9600", etc.; >10: "19.2K", "38.4K", etc.
     91
     92    cmp     ax,si                           ; < 10: "2400", "9600", etc.; >= 10: "19.2K", "38.4K", etc.
    9393    jae     .pushAndPrint
    9494
    9595    mov     cl, (g_szDetectCOMSmall-$$) & 0xff  ; Setup secondary print string for "COMn/XXy00"
    96        
    97 .pushAndPrint: 
     96
     97.pushAndPrint:
    9898    push    cx                              ; Push print string
    9999    push    ax                              ; Push high order digits, or port address, or N/A
     
    102102    mov     si, g_szDetectOuter             ; Finally load SI with wrapper string "IDE %s at %s: "
    103103
    104     jmp     short DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay   
     104    jmp     short DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay
    105105
    106106
     
    127127    ret
    128128
    129 
    130 
    131 
Note: See TracChangeset for help on using the changeset viewer.