Changeset 223 in xtideuniversalbios


Ignore:
Timestamp:
Jan 25, 2012, 8:20:06 PM (11 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes:

  • Fixed what appears to be a mistake in EBIOS.inc
  • Added a 'release' option to the makefile of the Serial Server (invokes UPX)
  • Some very minor optimizations
  • Removed the eSEG macro and did some other cleanups (fixed typos etc)
Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Inc/Emulate.inc

    r181 r223  
    370370
    371371;--------------------------------------------------------------------
    372 ; Segment override prefix instruction.
    373 ;
    374 ; eSEG
    375 ;   Parameters:
    376 ;       %1:     Name of the segment (ES, CS, SS, DS, FS or GS)
    377 ;   Returns:
    378 ;       Nothing
    379 ;   Corrupts registers:
    380 ;       Nothing
    381 ;--------------------------------------------------------------------
    382 %macro eSEG 1
    383     %ifidni %1, es
    384         db  00100110b
    385     %elifidni %1, cs
    386         db  00101110b
    387     %elifidni %1, ss
    388         db  00110110b
    389     %elifidni %1, ds
    390         db  00111110b
    391     %elifidni %1, fs
    392         db  01100100b
    393     %elifidni %1, gs
    394         db  01100101b
    395     %else
    396         %error "Invalid segment override passed to eSEG!"
    397     %endif
    398 %endmacro
    399 
    400 
    401 ;--------------------------------------------------------------------
    402372; Repeats string instruction with segment override.
    403373; This macro prevents 8088/8086 restart bug.
     
    416386%macro eSEG_STR 3
    417387%ifndef USE_186 ; 8088/8086 has string instruction restart bug when more than one prefix
    418      %%Loop:
    419         %1                      ; REP is the prefix that can be lost
    420         eSEG    %2              ; SEG is the prefix that won't be lost
    421         %3                      ; String instruction
    422         jcxz    %%End           ; Jump to end if no repeats left (preserves FLAGS)
    423         jmp     SHORT %%Loop    ; Loop while repeats left
    424      %%End:
     388    %%Loop:
     389        %1                      ; REP is the prefix that can be lost
     390        %2                      ; SEG is the prefix that won't be lost
     391        %3                      ; String instruction
     392        jcxz    %%End           ; Jump to end if no repeats left (preserves FLAGS)
     393        jmp     SHORT %%Loop    ; Loop while repeats left
     394    %%End:
    425395%else   ; No bug on V20/V30 and later, don't know about 188/186
    426     eSEG    %2
    427     %1      %3
     396    %2
     397    %1 %3
    428398%endif
    429399%endmacro
  • trunk/Assembly_Library/Src/Display/CgaSnow.asm

    r162 r223  
    9999    cli             ; Interrupt request would mess up timing
    100100    WAIT_UNTIL_SAFE_CGA_WRITE
    101     eSEG    es
    102     movsb
     101    es movsb
    103102    sti
    104103    loop    .MovsbNextByte
  • trunk/Assembly_Library/Src/Display/DisplayFormat.asm

    r184 r223  
    9292ALIGN JUMP_ALIGN
    9393ReadCharacterAndTestForNull:
    94     eSEG    cs
    95     lodsb                                   ; Load from CS:SI to AL
     94    cs lodsb                                ; Load from CS:SI to AL
    9695    test    al, al                          ; NULL to end string?
    9796    ret
     
    321320%endif
    322321
    323 ALIGN JUMP_ALIGN       
     322ALIGN JUMP_ALIGN
    324323u_FormatUnsignedDecimalWord:
    325324    mov     ax, [bp]
     
    339338    mov     ax, [bp]
    340339    test    ax,ax
    341     jnz     u_FormatUnsignedDecimalWord     
     340    jnz     u_FormatUnsignedDecimalWord
    342341    mov     [bp], word g_szDashForZero
    343342;;; fall-through
    344        
     343
    345344ALIGN JUMP_ALIGN
    346345s_FormatStringFromSegmentCS:
  • trunk/Assembly_Library/Src/Display/DisplayFormatCompressed.asm

    r202 r223  
    157157
    158158.decode:
    159     eSEG    cs
    160     lodsb                       ; load next byte of the string
     159    cs lodsb                    ; load next byte of the string
    161160
    162161    mov     ch,al               ; save a copy for later processing of high order bits
  • trunk/Assembly_Library/Src/Display/DisplayPrint.asm

    r194 r223  
    55SECTION .text
    66
    7                
     7
    88;--------------------------------------------------------------------
    99; Supports following formatting types:
     
    104104;       AX, DX
    105105;--------------------------------------------------------------------
    106        
     106
    107107%ifndef MODULE_STRINGS_COMPRESSED
    108        
     108
    109109ALIGN JUMP_ALIGN
    110110DisplayPrint_WordFromAXWithBaseInBX:
     
    126126.PrintNextDigit:
    127127    pop     ax                  ; Pop digit
    128     eSEG    cs
    129     xlatb
     128    cs xlatb
    130129    call    DisplayPrint_CharacterFromAL
    131130    loop    .PrintNextDigit
     
    152151;--------------------------------------------------------------------
    153152%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    154        
    155153ALIGN JUMP_ALIGN
    156154DisplayPrint_CharacterBufferFromBXSIwithLengthInCX:
     
    167165    loop    .PrintNextCharacter
    168166
    169     ;mov        ds, cx  ; Restore DS to BDA. Not needed unless DisplayPrint_CharacterFromAL changes DS.
    170167    pop     cx
    171168    pop     si
     
    173170    ret
    174171%endif
    175 
    176 
    177172
    178173
     
    278273    pop     cx
    279274.NothingToRepeat:
    280 
    281     ret
     275    ret
     276
    282277
    283278;--------------------------------------------------------------------
     
    292287;       AX, DX
    293288;--------------------------------------------------------------------
    294 
    295289%ifndef MODULE_STRINGS_COMPRESSED
    296290;;;
    297291;;; Take care when using this routine with compressed strings (which is why it is disabled).
    298292;;; All strings in CSSI should go through the DisplayFormatCompressed code to be decoded.
    299 ;;; 
     293;;;
    300294ALIGN JUMP_ALIGN
    301295DisplayPrint_NullTerminatedStringFromCSSI:
     
    304298    call    DisplayPrint_NullTerminatedStringFromBXSI
    305299    pop     bx
    306 
    307     ret
    308 %endif
    309 
    310        
     300    ret
     301%endif
    311302
    312303
     
    314305;;; Note that the following routines need to be at the bottom of this file
    315306;;; to accomodate short jumps from the next file (DisplayFormat/DisplayFormatCompressed)
    316 ;;; 
     307;;;
    317308
    318309;--------------------------------------------------------------------
     
    329320ALIGN JUMP_ALIGN
    330321DisplayPrint_Newline_FormatAdjustBP:
    331     inc     bp                  ; we didn't need a parameter after all, readjust BP 
     322    inc     bp                  ; we didn't need a parameter after all, readjust BP
    332323    inc     bp
    333324    ; fall through to DisplayPrint_Newline
     
    335326
    336327ALIGN JUMP_ALIGN
    337        
    338328DisplayPrint_Newline:
    339329    mov     al, LF
     
    364354
    365355
    366        
    367356;--------------------------------------------------------------------
    368357; DisplayPrint_NullTerminatedStringFromBXSI
     
    396385    pop     cx
    397386    pop     si
    398        
    399 DisplayPrint_Ret:               ; random ret to jump to                 
    400     ret
    401 
    402 
     387
     388DisplayPrint_Ret:               ; random ret to jump to
     389    ret
     390
  • trunk/Assembly_Library/Src/Menu/MenuAttributes.asm

    r116 r223  
    6868    add     si, .rgcColorAttributes
    6969.LoadAttributeAndReturn:
    70     eSEG    cs
    71     lodsb                               ; Load from [CS:SI] to AL
     70    cs lodsb                            ; Load from [CS:SI] to AL
    7271
    7372    pop     ds
  • trunk/Assembly_Library/Src/Menu/MenuBorders.asm

    r194 r223  
    2222;       AX, BX, CX, DX, SI, DI
    2323;--------------------------------------------------------------------
    24 ALIGN JUMP_ALIGN   
     24ALIGN JUMP_ALIGN
    2525MenuBorders_RefreshAll:
     26%ifndef USE_186
    2627    call    MenuBorders_AdjustDisplayContextForDrawingBorders
    2728    call    MenuBorders_GetNumberOfMiddleCharactersToDX
     
    3132    call    DrawBottomBorderLine
    3233    jmp     DrawBottomShadowLine
     34%else
     35    push    DrawBottomShadowLine
     36    push    DrawBottomBorderLine
     37    push    RefreshInformationBorders
     38    push    RefreshItemBorders
     39    push    RefreshTitleBorders
     40    push    MenuBorders_GetNumberOfMiddleCharactersToDX
     41    jmp     MenuBorders_AdjustDisplayContextForDrawingBorders
     42%endif
    3343
    3444
     
    7181%endif
    7282
    73        
     83
    7484;--------------------------------------------------------------------
    7585; MenuBorders_AdjustDisplayContextForDrawingBorders
     
    315325ALIGN JUMP_ALIGN
    316326PrintBorderCharactersFromCSSI:
    317     eSEG    cs
    318     lodsb           ; Load from [cs:si+BORDER_CHARS.cLeft] to AL
     327    cs lodsb        ; Load from [cs:si+BORDER_CHARS.cLeft] to AL
    319328    call    MenuBorders_PrintSingleBorderCharacterFromAL
    320329
    321     eSEG    cs
    322     lodsb           ; Load from [cs:si+BORDER_CHARS.cMiddle] to AL
     330    cs lodsb        ; Load from [cs:si+BORDER_CHARS.cMiddle] to AL
    323331    call    MenuBorders_PrintMultipleBorderCharactersFromAL
    324332
    325     eSEG    cs
    326     lodsb           ; Load from [cs:si+BORDER_CHARS.cRight] to AL
     333    cs lodsb        ; Load from [cs:si+BORDER_CHARS.cRight] to AL
    327334    ; Fall to MenuBorders_PrintSingleBorderCharacterFromAL
    328335
  • trunk/Configurator/Inc/emulate.inc

    r162 r223  
    305305
    306306;--------------------------------------------------------------------
    307 ; Segment override prefix instruction.
    308 ;
    309 ; eSEG
    310 ;   Parameters:
    311 ;       %1:     Name of the segment (ES, CS, SS, DS, FS or GS)
    312 ;   Returns:
    313 ;       Nothing
    314 ;   Corrupts registers:
    315 ;       Nothing
    316 ;--------------------------------------------------------------------
    317 %macro eSEG 1
    318     %ifidni %1, es
    319         db  00100110b
    320     %elifidni %1, cs
    321         db  00101110b
    322     %elifidni %1, ss
    323         db  00110110b
    324     %elifidni %1, ds
    325         db  00111110b
    326     %elifidni %1, fs
    327         db  01100100b
    328     %elifidni %1, gs
    329         db  01100101b
    330     %else
    331         %error "Invalid segment override passed to eSEG!"
    332     %endif
    333 %endmacro
    334 
    335 
    336 ;--------------------------------------------------------------------
    337307; Repeats string instruction with segment override.
    338308; This macro prevents 8088/8086 restart bug.
     
    351321%macro eSEG_STR 3
    352322%ifndef USE_186 ; 8088/8086 has string instruction restart bug when more than one prefix
    353      %%Loop:
    354         %1                      ; REP is the prefix that can be lost
    355         eSEG    %2              ; SEG is the prefix that won't be lost
    356         %3                      ; String instruction
    357         jcxz    %%End           ; Jump to end if no repeats left (preserves FLAGS)
    358         jmp     SHORT %%Loop    ; Loop while repeats left
    359      %%End:
     323    %%Loop:
     324        %1                      ; REP is the prefix that can be lost
     325        %2                      ; SEG is the prefix that won't be lost
     326        %3                      ; String instruction
     327        jcxz    %%End           ; Jump to end if no repeats left (preserves FLAGS)
     328        jmp     SHORT %%Loop    ; Loop while repeats left
     329    %%End:
    360330%else   ; No bug on V20/V30 and later, don't know about 188/186
    361     eSEG    %2
    362     %1      %3
     331    %2
     332    %1 %3
    363333%endif
    364334%endmacro
  • trunk/Serial_Server/library/Library.h

    r219 r223  
    2222
    2323    virtual void writeSector( void *buff ) = 0;
    24    
     24
    2525    virtual void readSector( void *buff ) = 0;
    2626
     
    3535
    3636    unsigned long totallba;
    37    
     37
    3838    char *shortFileName;
    3939    int readOnly;
     
    5858#include "../win32/win32serial.h"
    5959#else
    60 // there is no standard way to read/write and configure the serial port, OS specifc only
     60// there is no standard way to read/write and configure the serial port, OS specific only
    6161#endif
    6262
  • trunk/Serial_Server/makefile

    r219 r223  
    77# Use with GNU Make and Microsoft Visual C++ 2010
    88#
     9# Also works with Open Watcom C/C++ Version 1.9
     10#
    911
    1012CL = cl
     
    1416
    1517build/serdrive.exe: $(WIN32OBJS)
    16     $(CL) /Febuild/serdrive.exe $(WIN32OBJS)
     18    @$(CL) /Febuild/serdrive.exe $(WIN32OBJS)
    1719
    1820build/%.obj:    win32/%.cpp
    19     $(CL) /c $(CLFLAGS) $< /Fo$@
     21    @$(CL) /c $(CLFLAGS) $< /Fo$@
    2022
    2123build/%.obj:    library/%.cpp
    22     $(CL) /c $(CLFLAGS) $< /Fo$@
     24    @$(CL) /c $(CLFLAGS) $< /Fo$@
    2325
    2426$(WIN32OBJS):   library/library.h win32/win32file.h win32/win32serial.h library/file.h library/flatimage.h
    2527
    2628build/checksum_test.exe:    library/checksum.cpp
    27     $(CL) /Febuild/checksum_test.exe /Ox library/checksum.cpp /Fobuild/checksum_test.obj -D CHECKSUM_TEST
     29    @$(CL) /Febuild/checksum_test.exe /Ox library/checksum.cpp /Fobuild/checksum_test.obj -D CHECKSUM_TEST
    2830
    29 clean: 
    30     del /q build\*.*
     31release:    build/serdrive.exe
     32    @echo Compressing with UPX...
     33    @upx -qq --ultra-brute build/serdrive.exe
     34    @echo Done!
    3135
     36clean:
     37    @del /q build\*.*
  • trunk/XTIDE_Universal_BIOS/Inc/EBIOS.inc

    r221 r223  
    4141    .bSize                  resb    1   ; 0, Size of this packet in bytes
    4242    .bReservedAt1           resb    1   ; 1, Currently unused, must be zero
    43     .wSectorCount           resb    1   ; 2, Number of sectors to process (0...127)
     43    .wSectorCount           resb    2   ; 2, Number of sectors to process (0...127)
    4444    .dwMemoryAddress:
    4545    .wOffset                resb    2   ; 4, Memory offset for transfer
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm

    r218 r223  
    88    .wWordsLeft             resb    2   ; 2, WORDs left to transfer
    99    .wWordsDone             resb    2   ; 4, Number of sectors xferred
    10                             resb    1   ; 6, 
     10                            resb    1   ; 6,
    1111                            resb    1   ; 7, IDEPACK.bDeviceControl
    1212    .wDataPort              resb    2   ; 8, IDE Data Port
     
    327327%ifdef USE_186  ; OUTS instruction available
    328328    shl     cx, 1       ; WORD count to BYTE count
    329     eSEG    es          ; Source is ES segment
     329    es                  ; Source is ES segment
    330330    rep outsb
    331331%else           ; If 8088/8086
     
    369369ALIGN JUMP_ALIGN
    370370WordWrite:
    371     eSEG    es          ; Source is ES segment
     371    es                  ; Source is ES segment
    372372    rep
    373373    db      6Fh         ; OUTSW (we want this in XT build)
     
    377377DWordWrite:
    378378    shr     cx, 1       ; WORD count to DWORD count
    379     eSEG    es          ; Source is ES segment
     379    es                  ; Source is ES segment
    380380    rep
    381381    db      66h         ; Override operand size to 32-bit
  • trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialCommand.asm

    r220 r223  
    151151;
    152152        mov     bl,dl           ; setup BL with proper values for read/write loops (BH comes later)
    153        
     153
    154154        mov     al,83h
    155155        add     dl,SerialCommand_UART_lineControl
     
    202202        mov     cx,4            ; writing 3 words (plus 1)
    203203
    204         cli                     ; interrupts off... 
     204        cli                     ; interrupts off...
    205205
    206206        call    SerialCommand_WriteProtocol.entry
     
    215215;;; more than 128 sectors (and for 128 specifically, the pointer must be segment aligned).
    216216;;; See comments below at the point this entry point was called for more details...
    217 .nextSectorNormalize:           
     217.nextSectorNormalize:
    218218        call    Registers_NormalizeESDI
    219219%endif
    220        
     220
    221221        pop     ax              ; load command byte (done before call to .nextSector on subsequent iterations)
    222222        push    ax
     
    249249.readTimeout:
    250250        push    ax              ; not only does this push preserve AX (which we need), but it also
    251                                 ; means the stack has the same number of bytes on it as when we are 
     251                                ; means the stack has the same number of bytes on it as when we are
    252252                                ; sending a packet, important for error cleanup and exit
    253253        mov     ah,1
     
    256256        test    dl,1
    257257        jz      .readByte1Ready
    258         jmp     .readByte2Ready     
     258        jmp     .readByte2Ready
    259259
    260260;----------------------------------------------------------------------------
     
    275275        adc     si, 0
    276276
    277 .readEntry:     
     277.readEntry:
    278278        mov     dl,bh
    279279        in      al,dx
     
    325325
    326326        pop     ax              ; sector count and command byte
    327         dec     al              ; decrememnt sector count
     327        dec     al              ; decrement sector count
    328328        push    ax              ; save
    329329        jz      SerialCommand_OutputWithParameters_ReturnCodeInALCF    ; CF=0 from "cmp ax,bp" returning Zero above
     
    336336;;; This code is no longer needed as we do not support more than 128 sectors, and for 128 the pointer
    337337;;; must be segment aligned.  If we ever do want to support more sectors, the code can help...
    338        
     338
    339339;
    340340; Normalize buffer pointer for next go round, if needed.
    341341;
    342 ; We need to re-nomrlize the pointer in ES:DI after processing every 7f sectors.  That number could
     342; We need to re-normalize the pointer in ES:DI after processing every 7f sectors.  That number could
    343343; have been 80 if we knew the offset was on a segment boundary, but this may not be the case.
    344344;
     
    347347;    b) on transitions from FF to FE, very rare case for writing 255 or 256 sectors
    348348;    c) on transitions from 80 to 7F, a large read/write
    349 ;    d) on transitions from 00 to FF, very, very rare case of writing 256 secotrs
    350 ;       We don't need to renormalize in this case, but it isn't worth the memory/effort to not do 
     349;    d) on transitions from 00 to FF, very, very rare case of writing 256 sectors
     350;       We don't need to renormalize in this case, but it isn't worth the memory/effort to not do
    351351;       the extra work, and it does no harm.
    352352;
     
    354354; for more than 127 sectors.  Back in the day, it appears that some BIOS could not support more than 127
    355355; sectors, so that may be the practical limit for OS and application developers.  The Extended BIOS
    356 ; function also appear to be capped at 127 sectors.  So although this can support the full 256 sectors 
     356; function also appear to be capped at 127 sectors.  So although this can support the full 256 sectors
    357357; if needed, we are optimized for that 1-127 range.
    358358;
     
    373373                                        ; (0-7e kicked out before we get here)
    374374                                        ; 7f moves to 81 and OF=1, so OF=SF
    375                                         ; fe moves to 0 and OF=0, SF=0, so OF=SF 
     375                                        ; fe moves to 0 and OF=0, SF=0, so OF=SF
    376376                                        ; ff moves to 1 and OF=0, SF=0, so OF=SF
    377377                                        ; 80-fd moves to 82-ff and OF=0, so OF<>SF
     
    387387
    388388%else
    389        
    390         jmp     short .nextSector       
    391        
     389
     390        jmp     short .nextSector
     391
    392392%endif
    393393
     
    425425        jc      .clearBuffer    ; note CF from shr above
    426426
    427 .clearBufferComplete:           
     427.clearBufferComplete:
    428428        stc
    429429        mov     al,1
     
    448448; SerialCommand_WriteProtocol
    449449;
    450 ; NOTE: As with its read counterpart, this loop is very time sensitive. 
    451 ; Although it will still function, adding additional instructions will 
    452 ; impact the write througput, especially on slower machines. 
     450; NOTE: As with its read counterpart, this loop is very time sensitive.
     451; Although it will still function, adding additional instructions will
     452; impact the write throughput, especially on slower machines.
    453453;
    454454;   Parameters:
     
    514514        mov     ah,dl
    515515        jmp     .writeByte2Ready
    516        
     516
    517517.writeTimeout1:
     518%ifndef USE_186
    518519        mov     ax,.writeByte1Ready
    519520        push    ax              ; return address for ret at end of SC_writeTimeout2
     521%else
     522        push    .writeByte1Ready
     523%endif
    520524;;; fall-through
    521525
     
    527531;               One entry point fills in AH with 20h for write
    528532;       DX:     Port address (OK if already incremented to UART_lineStatus)
    529 ;       BX:   
     533;       BX:
    530534;       Stack:  2 words on the stack below the command/count word
    531535;   Returns:
     
    553557        xor     cx,cx
    554558.readTimeoutLoop:
    555         mov     dl,bh               
     559        mov     dl,bh
    556560        in      al,dx
    557561        test    al,ah
     
    588592;   Returns:
    589593;       AH:     INT 13h Error Code
    590 ;               NOTE: Not set (or checked) during drive detection 
     594;               NOTE: Not set (or checked) during drive detection
    591595;       CF:     Cleared if success, Set if error
    592596;   Corrupts registers:
     
    596600SerialCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH:
    597601;
    598 ; To improve boot time, we do our best to avoid looking for slave serial drives when we already know the results 
    599 ; from the looking for a master.  This is particuarly true when doing a COM port scan, as we will end up running
    600 ; through all the COM ports and baud rates a second time. 
    601 ;
    602 ; But drive detection isn't the only case - we also need to get the right drive when called on int13h/25h. 
     602; To improve boot time, we do our best to avoid looking for slave serial drives when we already know the results
     603; from the looking for a master.  This is particularly true when doing a COM port scan, as we will end up running
     604; through all the COM ports and baud rates a second time.
     605;
     606; But drive detection isn't the only case - we also need to get the right drive when called on int13h/25h.
    603607;
    604608; The decision tree:
     
    606610;    Master:
    607611;          bSerialPackedPortAndBaud Non-Zero:   -> Continue with bSerialPackedAndBaud (1)
    608 ;          bSerialPackedPortAndBaud Zero: 
     612;          bSerialPackedPortAndBaud Zero:
    609613;                         bLastSerial Zero:     -> Scan (2)
    610614;                         bLastSerial Non-Zero: -> Continue with bLastSerial (3)
    611 ;                                   
     615;
    612616;    Slave:
    613 ;          bSerialPackedPortAndBaud Non-Zero: 
     617;          bSerialPackedPortAndBaud Non-Zero:
    614618;                         bLastSerial Zero:     -> Error - Not Found (4)
    615619;                         bLastSerial Non-Zero: -> Continue with bSerialPackedAndBaud (5)
    616 ;          bSerialPackedPortAndBaud Zero:     
     620;          bSerialPackedPortAndBaud Zero:
    617621;                         bLastSerial Zero:     -> Error - Not Found (4)
    618622;                         bLastSerial Non-Zero: -> Continue with bLastSerial (6)
    619623;
    620 ; (1) This was a port/baud that was explicilty set with the configurator.  In the drive detection case, as this
    621 ;     is the Master, we are checking out a new controller, and so don't care about the value of bLastSerial. 
     624; (1) This was a port/baud that was explicitly set with the configurator.  In the drive detection case, as this
     625;     is the Master, we are checking out a new controller, and so don't care about the value of bLastSerial.
    622626;     And as with the int13h/25h case, we just go off and get the needed information using the user's setting.
    623 ; (2) We are using the special .ideVarsSerialAuto strucutre.  During drive detection, we would only be here
     627; (2) We are using the special .ideVarsSerialAuto structure.  During drive detection, we would only be here
    624628;     if bLastSerial is zero (since we only scan if no explicit drives are set), so we go off to scan.
    625 ; (3) We are using the special .ideVarsSerialAuto strucutre.  We won't get here during drive detection, but
     629; (3) We are using the special .ideVarsSerialAuto structure.  We won't get here during drive detection, but
    626630;     we might get here on an int13h/25h call.  If we have scanned COM drives, they are the ONLY serial drives
    627631;     in use, and so bLastSerial will reflect the port/baud setting for the scanned COM drives.
    628 ; (4) No master has been found yet, therefore no slave should be found.  Avoiding the slave reduces boot time, 
     632; (4) No master has been found yet, therefore no slave should be found.  Avoiding the slave reduces boot time,
    629633;     especially in the full COM port scan case.  Note that this is different from the hardware IDE, where we
    630634;     will scan for a slave even if a master is not present.  Note that if ANY master had been previously found,
    631 ;     we will do the slave scan, which isn't harmful, it just wates time.  But the most common case (by a wide
     635;     we will do the slave scan, which isn't harmful, it just wastes time.  But the most common case (by a wide
    632636;     margin) will be just one serial controller.
    633637; (5) A COM port scan for a master had been previously completed, and a drive was found.  In a multiple serial
    634 ;     controller scenario being called with int13h/25h, we need to use the value in bSerialPackedPortAndBaud 
     638;     controller scenario being called with int13h/25h, we need to use the value in bSerialPackedPortAndBaud
    635639;     to make sure we get the proper drive.
    636 ; (6) A COM port scan for a master had been previously completed, and a drive was found.  We would only get here 
    637 ;     if no serial drive was explicitly set by the user in the configurator or that drive had not been found. 
    638 ;     Instead of performing the full COM port scan for the slave, use the port/baud value stored during the 
     640; (6) A COM port scan for a master had been previously completed, and a drive was found.  We would only get here
     641;     if no serial drive was explicitly set by the user in the configurator or that drive had not been found.
     642;     Instead of performing the full COM port scan for the slave, use the port/baud value stored during the
    639643;     master scan.
    640 ;       
    641         mov     dl,[cs:bp+IDEVARS.bSerialPackedPortAndBaud]     
     644;
     645        mov     dl,[cs:bp+IDEVARS.bSerialPackedPortAndBaud]
    642646        mov     al, byte [RAMVARS.xlateVars+XLATEVARS.bLastSerial]
    643                
     647
    644648        test    bh, FLG_DRVNHEAD_DRV
    645649        jz      .master
    646650
    647         test    al,al           ; Take care of the case that is different between master and slave. 
     651        test    al,al           ; Take care of the case that is different between master and slave.
    648652        jz      .error          ; Because we do this here, the jz after the "or" below will not be taken
    649653
    650654; fall-through
    651 .master:       
     655.master:
    652656        test    dl,dl
    653657        jnz     .identifyDeviceInDL
     
    655659        or      dl,al           ; Move bLast into position in dl, as well as test for zero
    656660        jz      .scanSerial
    657        
     661
    658662; fall-through
    659 .identifyDeviceInDL:   
     663.identifyDeviceInDL:
    660664
    661665        push    bp              ; setup fake IDEREGS_AND_INTPACK
     
    680684
    681685        pop     bp
    682 ; 
     686;
    683687; place packed port/baud in RAMVARS, read by FinalizeDPT and DetectDrives
    684688;
    685689; Note that this will be set during an int13h/25h call as well.  Which is OK since it is only used (at the
    686 ; top of this routine) for drives found during a COM scan, and we only COM scan if there were no other 
     690; top of this routine) for drives found during a COM scan, and we only COM scan if there were no other
    687691; COM drives found.  So we will only reaffirm the port/baud for the one COM port/baud that has a drive.
    688 ; 
     692;
    689693        jc      .notFound                                           ; only store bLastSerial if success
    690694        mov     byte [RAMVARS.xlateVars+XLATEVARS.bLastSerial], dl
    691695
    692 .notFound:     
     696.notFound:
    693697        ret
    694698
     
    715719.nextPort:
    716720        inc     di              ; load next port address
     721        xor     dh, dh
    717722        mov     dl,[cs:di]
    718 
    719         mov     dh,0            ; shift from one byte to two
    720         eSHL_IM dx, 2
     723        eSHL_IM dx, 2           ; shift from one byte to two
    721724        jz      .error
    722725
     
    762765        ret
    763766
    764 .error: 
     767.error:
    765768        stc
    766769%if 0
Note: See TracChangeset for help on using the changeset viewer.