Changeset 233 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS_Configurator_v2
- Timestamp:
- Feb 4, 2012, 6:21:22 PM (13 years ago)
- google:author:
- gregli@hotmail.com
- Location:
- trunk/XTIDE_Universal_BIOS_Configurator_v2
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_SerialBaud.txt
r202 r233 1 Supported baud rates are 2400, 9600, 38.4K, and 115.2K. The server must also be set to this same speed. Older UARTs may only support 2400 and 9600 baud, but sometimes can be pushed to 38.4K. 115.2K will likely only be possible with a newer UART that inclues a FIFO. Some high speed serial ports include UART clock multipliers, allowing for speeds at 230.4K (2x multiplier) and 460.8K (4x multiplier). These high speeds are supported by these BIOS, even on original 4.77MHz 8088 systems. Note that UART clock multipliers are not detectable by the software and 115.2K will still be used during configuration for high speeds; but if a multiplier is used, the actual speed (including the multiplier) will need to be used onthe server.1 Supported baud rates are 2400, 4800, 9600, 19.2K, 28.8K, 38.4K, 57.6K, and 115.2K. The server must also be set to this same speed. Older UARTs may only support up to 9600 baud, but sometimes can be pushed to 38.4K. 115.2K will likely only be possible with a newer UART that inclues a FIFO. Some high speed serial ports include UART clock multipliers, allowing for speeds at 230.4K (2x multiplier) and 460.8K (4x multiplier) above 115.2K. These high speeds are supported by these BIOS, even on original 4.77MHz 8088 systems. Note that UART clock multipliers are not detectable by the software and 115.2K will still be used during configuration for high speeds; but if a multiplier is used, the actual speed (including the multiplier) will need to be used by the server. -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_SerialCOM.txt
r202 r233 1 Select a serial port by COM port number. COM1 through COM4 have well established I/O port assignments, COM5 and onward are less well established. "COMA" represents COM10, "COMB" represents COM11, and "COMC" represents COM12. Selecting COMxenables the manual selection of an I/O port address.1 Select a serial port by COM port number. COM1 through COM4 have well established I/O port assignments, COM5 and onward are less well established. "COMA" represents COM10, "COMB" represents COM11, and "COMC" represents COM12. Selecting "COMx" enables the manual selection of an I/O port address. -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_SerialPort.txt
r203 r233 1 Select a serial port by I/O address. Supported values are between 240h and 430h, and must be on an 8-byte boundary. If the entered value corresponds to one of the established COM port numbers, then the selection of serial port will use COM numbers instead.1 Select a serial port by I/O address. Any port address is supported up to 3f8h, but must be on an 8-byte boundary. If the entered value corresponds to one of the established COM port numbers, then the selection will snap to that COM port and "COMx" must be selected again for custom I/O address entry. -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/MenuStructs.inc
r199 r233 30 30 FLG_MENUITEM_BYTEVALUE EQU (1<<3) ; Item value is single byte 31 31 FLG_MENUITEM_PROGRAMVAR EQU (1<<4) ; Item is for configuring program, not BIOS 32 FLG_MENUITEM_CHOICESTRINGS EQU (1<<5) ; ChoiceToStringLookup table is 1-1 with ChoiceToValueLookup table, 33 ; ChoiceToStringLookup table must also NULL terminated 32 34 33 35 ; Values for MENUITEM.bType … … 47 49 .rgwChoiceToValueLookup resb 2 ; Ptr to lookup table for translating selected choice to actual value 48 50 .rgszValueToStringLookup: ; Ptr to lookup table for translating value to string 51 .rgszChoiceToStringLookup: 49 52 .wMinValue resb 2 ; Minimum allowed integer value 50 53 .wMaxValue: -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menuitem.asm
r199 r233 289 289 mov ax, [es:di] 290 290 291 test BYTE [si+MENUITEM.bFlags], FLG_MENUITEM_BYTEVALUE 292 jz SHORT .NoConvertWordToByteValue 293 xor ah, ah ; conversion needs to happen before call to the reader, 294 ; in case the reader unpacks the byte to a word 295 296 .NoConvertWordToByteValue: 291 297 mov bx, [si+MENUITEM.itemValue+ITEM_VALUE.fnValueReader] 292 298 test bx,bx … … 300 306 pop es 301 307 302 test BYTE [si+MENUITEM.bFlags], FLG_MENUITEM_BYTEVALUE303 jnz SHORT .ConvertWordToByteValue304 308 test BYTE [si+MENUITEM.bFlags], FLG_MENUITEM_FLAGVALUE 305 309 jz SHORT .Return … … 309 313 jnz SHORT .Return 310 314 xor ax, ax 311 ALIGN JUMP_ALIGN 312 .ConvertWordToByteValue: 313 xor ah, ah 315 314 316 ALIGN JUMP_ALIGN, ret 315 317 .Return: -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/MenuitemPrint.asm
r107 r233 156 156 ALIGN JUMP_ALIGN 157 157 MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI: 158 MenuitemPrint_WriteLookupValueStringToBufferInESDIfromRawItemInDSSI: 158 159 call Menuitem_GetValueToAXfromMenuitemInDSSI 159 160 ; Fall to PrintLookupValueFromAXtoBufferInESDI … … 173 174 PrintLookupValueFromAXtoBufferInESDI: 174 175 push si 176 test byte [si+MENUITEM.bFlags], FLG_MENUITEM_CHOICESTRINGS 177 jnz .lookupChoice 178 175 179 add ax, [si+MENUITEM.itemValue+ITEM_VALUE.rgszValueToStringLookup] 176 180 xchg bx, ax 181 .found: 177 182 mov si, [bx] 183 .errorReturn: 178 184 call String_CopyDSSItoESDIandGetLengthToCX 179 185 pop si 180 186 ret 181 187 188 ; 189 ; With FLG_MENUITEM_CHOICESTRINGS, the array at .rgszChoiceToStringLookup is based on the 190 ; Choice number (offset within .rgwChoiceToValueLookup) instead of the value stored. 191 ; Here, we scan the .rgwChoiceToValueLookup array until we find the value there, and then 192 ; use the same offset in .rgszChoiceToStringLookup. If we don't find the value, we 193 ; return an "Error!" string instead. 194 ; 195 ; Note that the pointer array at .rgszChoiceToStringLookup must be NULL terminated. Since the 196 ; value could be zero, we don't use the .rgwChoiceToValueLookup array to find the end. 197 ; 198 .lookupChoice: 199 mov bx,[si+MENUITEM.itemValue+ITEM_VALUE.rgszChoiceToStringLookup] 200 mov si,[si+MENUITEM.itemValue+ITEM_VALUE.rgwChoiceToValueLookup] 201 202 .wordLoop: 203 cmp ax,[si] 204 jz .found 205 inc si 206 inc si 207 inc bx 208 inc bx 209 cmp word [bx],0 210 jnz .wordLoop 211 212 mov si,g_szValueUnknownError 213 jmp .errorReturn 182 214 183 215 ;-------------------------------------------------------------------- -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/IdeControllerMenu.asm
r200 r233 46 46 istruc MENUITEM 47 47 at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI 48 at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfrom ShiftedItemInDSSI48 at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfromRawItemInDSSI 49 49 at MENUITEM.szName, dw g_szItemIdeDevice 50 50 at MENUITEM.szQuickInfo, dw g_szNfoIdeDevice … … 93 93 istruc MENUITEM 94 94 at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI 95 at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfrom UnshiftedItemInDSSI95 at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfromRawItemInDSSI 96 96 at MENUITEM.szName, dw g_szItemSerialCOM 97 97 at MENUITEM.szQuickInfo, dw g_szNfoIdeSerialCOM 98 98 at MENUITEM.szHelp, dw g_szHelpIdeSerialCOM 99 at MENUITEM.bFlags, db FLG_MENUITEM_MODIFY_MENU 99 at MENUITEM.bFlags, db FLG_MENUITEM_MODIFY_MENU | FLG_MENUITEM_BYTEVALUE | FLG_MENUITEM_CHOICESTRINGS 100 100 at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOICE 101 101 at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL 102 102 at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgDevice 103 103 at MENUITEM.itemValue + ITEM_VALUE.szMultichoice, dw g_szSerialCOMChoice 104 at MENUITEM.itemValue + ITEM_VALUE.rgwChoiceToValueLookup, dw NULL 105 at MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup, dw g_rgszValueToStringLookupForCOM 106 at MENUITEM.itemValue + ITEM_VALUE.fnValueReader, dw IdeControllerMenu_SerialReadCOM 104 at MENUITEM.itemValue + ITEM_VALUE.rgwChoiceToValueLookup, dw g_rgbChoiceToValueLookupForCOM 105 at MENUITEM.itemValue + ITEM_VALUE.rgszChoiceToStringLookup, dw g_rgszChoiceToStringLookupForCOM 107 106 at MENUITEM.itemValue + ITEM_VALUE.fnValueWriter, dw IdeControllerMenu_SerialWriteCOM 108 107 iend … … 115 114 at MENUITEM.szQuickInfo, dw g_szNfoIdeSerialPort 116 115 at MENUITEM.szHelp, dw g_szHelpIdeSerialPort 117 at MENUITEM.bFlags, db FLG_MENUITEM_MODIFY_MENU 116 at MENUITEM.bFlags, db FLG_MENUITEM_MODIFY_MENU | FLG_MENUITEM_BYTEVALUE 118 117 at MENUITEM.bType, db TYPE_MENUITEM_HEX 119 118 at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL 120 119 at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgIdeCmdPort 121 at MENUITEM.itemValue + ITEM_VALUE.wMinValue, dw DEVICE_SERIAL_PACKEDPORTANDBAUD_MINPORT122 at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw DEVICE_SERIAL_PACKEDPORTANDBAUD_MAXPORT120 at MENUITEM.itemValue + ITEM_VALUE.wMinValue, dw 8h 121 at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw 3f8h 123 122 at MENUITEM.itemValue + ITEM_VALUE.fnValueReader, dw IdeControllerMenu_SerialReadPort 124 123 at MENUITEM.itemValue + ITEM_VALUE.fnValueWriter, dw IdeControllerMenu_SerialWritePort … … 128 127 istruc MENUITEM 129 128 at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI 130 at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfrom UnshiftedItemInDSSI129 at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfromRawItemInDSSI 131 130 at MENUITEM.szName, dw g_szItemSerialBaud 132 131 at MENUITEM.szQuickInfo, dw g_szNfoIdeSerialBaud 133 132 at MENUITEM.szHelp, dw g_szHelpIdeSerialBaud 133 at MENUITEM.bFlags, db FLG_MENUITEM_BYTEVALUE | FLG_MENUITEM_CHOICESTRINGS 134 134 at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOICE 135 135 at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL 136 136 at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgDevice 137 137 at MENUITEM.itemValue + ITEM_VALUE.szMultichoice, dw g_szSerialBaudChoice 138 at MENUITEM.itemValue + ITEM_VALUE.rgwChoiceToValueLookup, dw NULL 139 at MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup, dw g_rgszValueToStringLookupForBaud 140 at MENUITEM.itemValue + ITEM_VALUE.fnValueReader, dw IdeControllerMenu_SerialReadBaud 141 at MENUITEM.itemValue + ITEM_VALUE.fnValueWriter, dw IdeControllerMenu_SerialWriteBaud 138 at MENUITEM.itemValue + ITEM_VALUE.rgwChoiceToValueLookup, dw g_rgbChoiceToValueLookupForBaud 139 at MENUITEM.itemValue + ITEM_VALUE.rgszChoiceToStringLookup, dw g_rgszChoiceToStringLookupForBaud 142 140 iend 143 141 … … 188 186 dw g_szValueCfgDeviceSerial 189 187 190 g_rgszValueToStringLookupForCOM: 188 g_rgbChoiceToValueLookupForCOM: 189 dw '1' 190 dw '2' 191 dw '3' 192 dw '4' 193 dw '5' 194 dw '6' 195 dw '7' 196 dw '8' 197 dw '9' 198 dw 'A' 199 dw 'B' 200 dw 'C' 201 dw 'x' ; must be last entry (see reader/write routines) 202 g_rgszChoiceToStringLookupForCOM: 191 203 dw g_szValueCfgCOM1 192 204 dw g_szValueCfgCOM2 … … 202 214 dw g_szValueCfgCOMC 203 215 dw g_szValueCfgCOMx 204 205 g_rgszValueToStringLookupForBaud: 206 dw g_szValueCfgBaud2400 207 dw g_szValueCfgBaud9600 208 dw g_szValueCfgBaud38_4 209 dw g_szValueCfgBaud115_2 210 211 g_wPrintBaud: 212 dw DEVICE_SERIAL_PRINTBAUD_2400 213 dw DEVICE_SERIAL_PRINTBAUD_9600 214 dw DEVICE_SERIAL_PRINTBAUD_38_4 215 dw DEVICE_SERIAL_PRINTBAUD_115_2 216 dw NULL 217 218 DEVICE_SERIAL_DEFAULT_CUSTOM_PORT EQU 300h ; can't be any of the pre-defined COM values 219 220 PackedCOMPortAddresses: ; COM1 - COMC (or COM12) 221 db DEVICE_SERIAL_COM1 >> 2 222 db DEVICE_SERIAL_COM2 >> 2 223 db DEVICE_SERIAL_COM3 >> 2 224 db DEVICE_SERIAL_COM4 >> 2 225 db DEVICE_SERIAL_COM5 >> 2 226 db DEVICE_SERIAL_COM6 >> 2 227 db DEVICE_SERIAL_COM7 >> 2 228 db DEVICE_SERIAL_COM8 >> 2 229 db DEVICE_SERIAL_COM9 >> 2 230 db DEVICE_SERIAL_COMA >> 2 231 db DEVICE_SERIAL_COMB >> 2 232 db DEVICE_SERIAL_COMC >> 2 233 db DEVICE_SERIAL_DEFAULT_CUSTOM_PORT >> 2 ; must be last entry (see reader/writer routines) 234 DEVICE_SERIAL_DEFAULT_COM EQU '1' 235 236 g_rgbChoiceToValueLookupForBaud: 237 dw (115200 / 115200) & 0xff 238 dw (115200 / 57600) & 0xff 239 dw (115200 / 38400) & 0xff 240 dw (115200 / 28800) & 0xff 241 dw (115200 / 19200) & 0xff 242 dw (115200 / 9600) & 0xff 243 dw (115200 / 4800) & 0xff 244 dw (115200 / 2400) & 0xff 245 g_rgszChoiceToStringLookupForBaud: 246 dw g_szValueCfgBaud115_2 247 dw g_szValueCfgBaud57_6 248 dw g_szValueCfgBaud38_4 249 dw g_szValueCfgBaud28_8 250 dw g_szValueCfgBaud19_2 251 dw g_szValueCfgBaud9600 252 dw g_szValueCfgBaud4800 253 dw g_szValueCfgBaud2400 254 dw NULL 255 DEVICE_SERIAL_DEFAULT_BAUD EQU ((115200 / 9600) & 0xff) 216 256 217 257 ; Section containing code … … 240 280 lea ax, [bx+IDEVARS.wPort] 241 281 mov [cs:g_MenuitemIdeControllerCommandBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 282 283 lea ax, [bx+IDEVARS.bSerialPort] 242 284 mov [cs:g_MenuitemIdeControllerSerialPort+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 243 mov [cs:g_MenuitemIdeControllerSerialCOM+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 285 286 lea ax, [bx+IDEVARS.bSerialBaud] 244 287 mov [cs:g_MenuitemIdeControllerSerialBaud+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 245 ;; baud also modifies the next two bytes (print chars in wPortCtrl), but it never reads them246 288 247 289 lea ax, [bx+IDEVARS.wPortCtrl] 248 290 mov [cs:g_MenuitemIdeControllerControlBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 291 292 lea ax, [bx+IDEVARS.bSerialCOMPortChar] 293 mov [cs:g_MenuitemIdeControllerSerialCOM+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 249 294 250 295 lea ax, [bx+IDEVARS.bIRQ] … … 382 427 ALIGN JUMP_ALIGN 383 428 DisplayMasterSlaveMenu: 429 ; 430 ; block mode is not supported on serial drives, disable/enable the option as appropriate 431 ; 432 push bx 433 mov bx, [cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset] 434 call Buffers_GetRomvarsValueToAXfromOffsetInBX 435 mov bx, g_MenuitemMasterSlaveBlockModeTransfers 436 cmp al,DEVICE_SERIAL_PORT 437 jz .isSerial 438 or BYTE [cs:bx+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE 439 jmp .isDone 440 .isSerial: 441 and BYTE [cs:bx+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE 442 .isDone: 443 pop bx 444 384 445 call MasterSlaveMenu_InitializeToDrvparamsOffsetInBX 385 446 jmp MasterSlaveMenu_EnterMenuOrModifyItemVisibility 386 387 PackedCOMPortAddresses: ; COM1 - COMC (or COM12)388 db (DEVICE_SERIAL_COM1 - DEVICE_SERIAL_PACKEDPORTANDBAUD_STARTINGPORT) >> 1389 db (DEVICE_SERIAL_COM2 - DEVICE_SERIAL_PACKEDPORTANDBAUD_STARTINGPORT) >> 1390 db (DEVICE_SERIAL_COM3 - DEVICE_SERIAL_PACKEDPORTANDBAUD_STARTINGPORT) >> 1391 db (DEVICE_SERIAL_COM4 - DEVICE_SERIAL_PACKEDPORTANDBAUD_STARTINGPORT) >> 1392 db (DEVICE_SERIAL_COM5 - DEVICE_SERIAL_PACKEDPORTANDBAUD_STARTINGPORT) >> 1393 db (DEVICE_SERIAL_COM6 - DEVICE_SERIAL_PACKEDPORTANDBAUD_STARTINGPORT) >> 1394 db (DEVICE_SERIAL_COM7 - DEVICE_SERIAL_PACKEDPORTANDBAUD_STARTINGPORT) >> 1395 db (DEVICE_SERIAL_COM8 - DEVICE_SERIAL_PACKEDPORTANDBAUD_STARTINGPORT) >> 1396 db (DEVICE_SERIAL_COM9 - DEVICE_SERIAL_PACKEDPORTANDBAUD_STARTINGPORT) >> 1397 db (DEVICE_SERIAL_COMA - DEVICE_SERIAL_PACKEDPORTANDBAUD_STARTINGPORT) >> 1398 db (DEVICE_SERIAL_COMB - DEVICE_SERIAL_PACKEDPORTANDBAUD_STARTINGPORT) >> 1399 db (DEVICE_SERIAL_COMC - DEVICE_SERIAL_PACKEDPORTANDBAUD_STARTINGPORT) >> 1400 db 0 ; null terminated401 447 402 448 ;------------------------------------------------------------------------------------------ … … 474 520 jz .done ; if we were already serial, nothing to do 475 521 476 mov ax,DEVICE_SERIAL_DEFAULT_COM 522 mov byte [es:di+IDEVARS.bSerialBaud-IDEVARS.wPort],DEVICE_SERIAL_DEFAULT_BAUD 523 524 mov al,DEVICE_SERIAL_DEFAULT_COM 525 add di,IDEVARS.bSerialCOMPortChar-IDEVARS.wPort 477 526 call IdeControllerMenu_SerialWriteCOM 478 mov [es:di],ax 479 480 mov ax,DEVICE_SERIAL_DEFAULT_BAUD 481 call IdeControllerMenu_SerialWriteBaud 482 mov [es:di],ax 527 mov [es:di],al 483 528 484 add di,IDEVARS.bIRQ - IDEVARS.wPort ; clear out the interrupt information, we don't use interrupts485 mov al,0486 mov [es:di],al487 488 529 .done: 489 530 pop di … … 494 535 495 536 ; 496 ; "COMn" ASCII characer -> Numeric COM number 497 ; 498 ALIGN JUMP_ALIGN 499 IdeControllerMenu_SerialReadCOM: 500 xor ah,ah ; clear out packedportbaud value 501 502 cmp al,'x' ; base this on the ASCII character used to print 503 jz .custom 504 505 cmp al,'A' 506 jae .over10 507 508 sub al, '0'+1 ; convert ASCII value '0'-'9' to numeric 537 ; Doesn't modify COM character (unless it is not recognized, which would be an error case), 538 ; But does update the port address based on COM port selection 539 ; 540 ALIGN JUMP_ALIGN 541 IdeControllerMenu_SerialWriteCOM: 542 push ax 543 push bx 544 push si 545 546 mov si,g_rgbChoiceToValueLookupForCOM 547 mov bx,PackedCOMPortAddresses 548 549 .loop: 550 mov ah,[bx] 551 552 cmp ah,(DEVICE_SERIAL_DEFAULT_CUSTOM_PORT >> 2) 553 jz .notFound 554 555 cmp al,[si] 556 jz .found 557 558 inc si 559 inc si 560 inc bx 561 562 jmp .loop 563 564 .notFound: 565 mov al, 'x' 566 567 .found: 568 mov [es:di+IDEVARS.bSerialPort-IDEVARS.bSerialCOMPortChar], ah 569 570 pop si 571 pop bx 572 pop ax 573 509 574 ret 510 511 .over10: 512 sub al, 'A'-10+1 ; convert ASCII value 'A'-'C' to numeric 575 576 577 ; 578 ; Packed Port (byte) -> Numeric Port (word) 579 ; 580 ALIGN JUMP_ALIGN 581 IdeControllerMenu_SerialReadPort: 582 xor ah,ah 583 shl ax,1 584 shl ax,1 513 585 ret 514 586 515 .custom: 516 mov al, 12 ; convert ASCII value 'x' (for custom) to numeric 517 ret 518 519 ; 520 ; Numeric COM number -> Packed port address, and update ASCII character for printing "COMn" 521 ; 522 ALIGN JUMP_ALIGN 523 IdeControllerMenu_SerialWriteCOM: 524 push bx 525 526 cmp al,12 ; custom? 527 jge .custom 528 529 mov bx,ax ; lookup packed port address based on COM address 530 mov ah,[cs:bx+PackedCOMPortAddresses] 531 532 cmp al,9 ; COMA or higher, but not custom 533 jge .atorabove10 534 535 add al, '0'+1 ; convert numeric to ASCII '1' to '9' 536 jmp IdeControllerMenu_SerialWriteCOM_PackAndRet 537 538 .custom: 539 mov al,'x' ; ASCII value 'x' for custom 540 mov ah,1 << DEVICE_SERIAL_PACKEDPORTANDBAUD_PORT_FIELD_POSITION ; 248h 541 jmp IdeControllerMenu_SerialWriteCOM_PackAndRet 542 543 .atorabove10: 544 add al, 'A'-10+1 ; convert numeric to ASCII 'A' to 'C' 545 546 IdeControllerMenu_SerialWriteCOM_PackAndRet: 547 mov bl,[es:di+1] ; read baud rate bits 548 and bl,DEVICE_SERIAL_PACKEDPORTANDBAUD_BAUDMASK 549 or ah,bl 550 551 pop bx 552 ret 553 554 ; 555 ; Packed Baud -> Numeric Baud 556 ; 557 ALIGN JUMP_ALIGN 558 IdeControllerMenu_SerialReadBaud: 559 xchg al,ah 560 and ax,DEVICE_SERIAL_PACKEDPORTANDBAUD_BAUDMASK ; also clears high order byte 561 ret 562 563 ; 564 ; Numeric Baud -> Packed Baud, also update ASCII printing characters for baud rate 565 ; 566 ALIGN JUMP_ALIGN 567 IdeControllerMenu_SerialWriteBaud: 568 and ax,DEVICE_SERIAL_PACKEDPORTANDBAUD_BAUDBITS ; ensure we only have the bits we want 569 570 push bx 571 572 mov bx,ax ; lookup printing word for wPortCtrl 573 shl bx,1 574 mov bx,[cs:bx+g_wPrintBaud] 575 mov [es:di+2],bx 576 577 xchg al,ah ; or in port bits 578 mov bx,[es:di] 579 and bh,DEVICE_SERIAL_PACKEDPORTANDBAUD_PORTMASK 580 or ax,bx 581 582 pop bx 583 ret 584 585 ; 586 ; Packed Port -> Numeric Port 587 ; 588 ALIGN JUMP_ALIGN 589 IdeControllerMenu_SerialReadPort: 590 mov al,ah 591 and ax,DEVICE_SERIAL_PACKEDPORTANDBAUD_PORTMASK ; note that this clears AH 592 shl ax,1 593 add ax,DEVICE_SERIAL_PACKEDPORTANDBAUD_STARTINGPORT 594 ret 595 596 ; 597 ; Numeric Port -> Packed Port, convert from Custom to a defined COM port if we match one 587 ; 588 ; Numeric Port (word) -> Packed Port (byte) 589 ; And convert from Custom to a defined COM port if we match one of the pre-defined COM port numbers 598 590 ; 599 591 ALIGN JUMP_ALIGN 600 592 IdeControllerMenu_SerialWritePort: 601 593 push bx 602 603 sub ax,DEVICE_SERIAL_PACKEDPORTANDBAUD_STARTINGPORT ; convert from numeric to packed port number 594 push si 595 604 596 shr ax,1 605 and al,DEVICE_SERIAL_PACKEDPORTANDBAUD_PORTMASK 606 607 mov bx,PackedCOMPortAddresses ; loop, looking for port address in known COM address list 608 .next: 609 mov ah,[cs:bx] 597 shr ax,1 598 and al,0feh ; force 8-byte boundary 599 600 mov si,g_rgbChoiceToValueLookupForCOM 601 mov bx,PackedCOMPortAddresses ; loop, looking for port address in known COM address list 602 603 .loop: 604 mov ah,[si] 605 cmp ah,'x' 606 jz .found 607 608 cmp al,[bx] 609 jz .found 610 611 inc si 612 inc si 610 613 inc bx 611 test ah,ah612 j z .notfound613 cmp al,ah 614 jnz .next 615 616 sub bx,PackedCOMPortAddresses + 1 ; FOUND!, +1 since we already incremented 617 mov ax,bx614 615 jmp .loop 616 617 .found: 618 mov [es:di+IDEVARS.bSerialCOMPortChar-IDEVARS.bSerialPort], ah 619 620 pop si 618 621 pop bx 619 jmp IdeControllerMenu_SerialWriteCOM ; if found, use that logic to get ASCII character 620 621 .notfound: 622 xchg ah,al 623 mov al,'x' 624 jmp IdeControllerMenu_SerialWriteCOM_PackAndRet 625 626 622 623 ret 624 625 626 627 628 629 630 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm
r203 r233 135 135 g_szNfoIdeSerialCOM: db "Select a COM port by number.",NULL 136 136 g_szNfoIdeSerialBaud: db "Select the COM port's Baud Rate. The server must match this speed. Note that UART clock multipliers may impact the actual speed.",NULL 137 g_szNfoIdeSerialPort: db "Select a COM port by custom I/O port address. A ddress must be in the range 248h to 430h andbe on an 8-byte boundary.", NULL137 g_szNfoIdeSerialPort: db "Select a COM port by custom I/O port address. Any address is valud up to 3f8h, but must be on an 8-byte boundary.", NULL 138 138 139 139 g_szHelpIdeCmdPort: incbin "IDE_CommandPort.txt" … … 161 161 162 162 g_szSerialCOMChoice: 163 db "COM1 - Port3f8h",LF164 db "COM2 - Port2f8h",LF165 db "COM3 - Port3e8h",LF166 db "COM4 - Port2e8h",LF167 db "COM5 - Port2f0h",LF168 db "COM6 - Port3e0h",LF169 db "COM7 - Port2e0h",LF170 db "COM8 - Port260h",LF171 db "COM9 - Port368h",LF172 db "COMA - Port268h",LF173 db "COMB - Port360h",LF174 db "COMC - Port270h",LF175 db "COMx - Custom Port",NULL163 db "COM1 - address 3f8h",LF 164 db "COM2 - address 2f8h",LF 165 db "COM3 - address 3e8h",LF 166 db "COM4 - address 2e8h",LF 167 db "COM5 - address 2f0h",LF 168 db "COM6 - address 3e0h",LF 169 db "COM7 - address 2e0h",LF 170 db "COM8 - address 260h",LF 171 db "COM9 - address 368h",LF 172 db "COMA - address 268h",LF 173 db "COMB - address 360h",LF 174 db "COMC - address 270h",LF 175 db "COMx - Custom address",NULL 176 176 177 177 g_szValueCfgCOM1: db "COM1",NULL … … 190 190 191 191 g_szSerialBaudChoice: 192 db "2400 baud",LF 192 db "115.2K baud",LF 193 db "57.6K baud",LF 194 db "38.4K baud",LF 195 db "28.8K baud",LF 196 db "19.2K baud",LF 193 197 db "9600 baud",LF 194 db "38.4K baud",LF 195 db "115.2K baud",NULL 196 198 db "4800 baud",LF 199 db "2400 baud",NULL 200 201 g_szValueCfgBaud115_2: db "115.2K",NULL 202 g_szValueCfgBaud57_6: db "57.6K",NULL 203 g_szValueCfgBaud38_4: db "38.4K",NULL 204 g_szValueCfgBaud28_8: db "28.8K",NULL 205 g_szValueCfgBaud19_2: db "19.2K",NULL 206 g_szValueCfgBaud9600: db "9600",NULL 207 g_szValueCfgBaud4800: db "4800",NULL 197 208 g_szValueCfgBaud2400: db "2400",NULL 198 g_szValueCfgBaud9600: db "9600",NULL 199 g_szValueCfgBaud38_4: db "38.4K",NULL 200 g_szValueCfgBaud115_2: db "115.2K",NULL 209 201 210 202 211 g_szValueCfgDeviceDual8b: db "XTIDE",NULL … … 363 372 364 373 g_szDashForZero: db "- ",NULL 374 375 g_szValueUnknownError: db "Error!",NULL 376 377 378
Note:
See TracChangeset
for help on using the changeset viewer.