Changeset 589 in xtideuniversalbios for trunk/Assembly_Library/Src/Serial
- Timestamp:
- May 22, 2016, 12:26:57 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Src/Serial/SerialServerScan.asm
r567 r589 46 46 47 47 test dx, dx 48 jnz shortSerialServerScan_CheckForServer_PortAndBaudInDX48 jnz SHORT SerialServerScan_CheckForServer_PortAndBaudInDX 49 49 50 mov di, .scanPortAddresses-151 mov ch, 1 ; tell server that we are scanning50 mov di, .scanPortAddresses-1 51 mov ch, 1 ; tell server that we are scanning 52 52 53 53 .nextPort: 54 54 inc di ; load next port address 55 xor dh, dh56 mov dl, [cs:di]55 mov dh, 40h ; Clear DH and make sure CF is set if error 56 mov dl, [cs:di] 57 57 eSHL_IM dx, 2 ; shift from one byte to two 58 stc ; setup error code for exit 59 jz .error 58 jz SHORT .error 60 59 61 60 ; … … 63 62 ; 64 63 push dx 65 add dl, Serial_UART_lineControl66 mov al, 09ah64 add dl, Serial_UART_lineControl 65 mov al, 9Ah 67 66 out dx, al 68 67 in al, dx 69 68 pop dx 70 cmp al, 09ah71 jn z.nextPort69 cmp al, 9Ah 70 jne SHORT .nextPort 72 71 73 mov al, 0 ch72 mov al, 0Ch 74 73 out dx, al 75 74 in al, dx 76 cmp al, 0 ch77 jn z.nextPort75 cmp al, 0Ch 76 jne SHORT .nextPort 78 77 79 78 ; … … 84 83 ; *on the server side* if the client side had a 4x clock multiplier, a 2x clock multiplier, or no clock multiplier. 85 84 ; 86 ; Starting with 30h, that means 30h (2400 baud), 18h (4800 baud), 0 ch (9600 baud), and85 ; Starting with 30h, that means 30h (2400 baud), 18h (4800 baud), 0Ch (9600 baud), and 87 86 ; 04h (28800 baud), 02h (57600 baud), 01h (115200 baud) 88 87 ; 89 ; Note: hardware baud multipliers (2x, 4x ) will impact the final baud rate and are not known at this level88 ; Note: hardware baud multipliers (2x, 4x, 8x) will impact the final baud rate and are not known at this level 90 89 ; 91 mov dh, 030h * 2 ; multiply by 2 since we are about to divide by 292 mov dl, [cs:di] ; restore single byte port address for scan90 mov dh, 30h * 2 ; multiply by 2 since we are about to divide by 2 91 mov dl, [cs:di] ; restore single byte port address for scan 93 92 94 93 .nextBaud: 95 shr dh, 196 jz .nextPort97 cmp dh, 6 ; skip from 6 to 4, to move from the top of the 9600 baud range98 jn z .testBaud; to the bottom of the 115200 baud range99 mov dh, 494 shr dh, 1 95 jz SHORT .nextPort 96 cmp dh, 6 ; skip from 6 to 4, to move from the top of the 9600 baud range 97 jne SHORT .testBaud ; to the bottom of the 115200 baud range 98 mov dh, 4 100 99 101 100 .testBaud: 102 101 call SerialServerScan_CheckForServer_PortAndBaudInDX 103 jc .nextBaud102 jc SHORT .nextBaud 104 103 105 104 .error: … … 135 134 SerialServerScan_CheckForServer_PortAndBaudInDX: 136 135 push bp ; setup fake SerialServer_Command 137 138 136 push dx ; send port baud and rate, returned in inquire packet 139 137 ; (and possibly returned in the drive identification string) 140 141 138 push cx ; send number of sectors, and if it is on a scan or not 142 143 mov bl,SerialServer_Command_Inquire ; protocol command onto stack with bh 139 mov bl, SerialServer_Command_Inquire ; protocol command onto stack with bh 144 140 push bx 145 141 146 mov bp,sp 147 142 mov bp, sp 148 143 call SerialServer_SendReceive 149 144
Note:
See TracChangeset
for help on using the changeset viewer.