使用 USB/串行电缆通过 Putty 串行端口访问 RS-232 控制台,显示双字符显示

使用 USB/串行电缆通过 Putty 串行端口访问 RS-232 控制台,显示双字符显示

我尝试通过 RS-232 接口访问 Matrix Sense 防火墙管理控制台,但使用 Putty 得到的显示很奇怪。硬件是PC 引擎 APU4B4母板。

我在 Windows 7 计算机上使用廉价的 USB 转 RS-232 转换器。该设备在 COM4 端口上被识别,无需在我这边安装任何驱动程序。

因此,使用这些参数:

  • 速度 115200 波特
  • 8 个数据位
  • 1 个停止位
  • 无奇偶校验
  • 流量控制 XON/XOFF

Putty 参数第 1 页

我还调整了一些其他参数以获得更好的显示效果:

  • 本地回声强制关闭
  • 本地行编辑强制开启

但它似乎没起多大​​作用。

Putty 参数第 2 页

最终我看到了这个奇怪的显示:

腻子展示

有些字符会显示两次,而其他字符则似乎是随机的。看起来我快要找到解决方案了,但我不明白这里出了什么问题。

答案1

我对这种硬件没有任何经验,但我发现此主题描述了 APU1D 上的类似症状。

回复:

您已启用 iPXE 自己的串行控制台支持(CONSOLE_SERIALconfig/console.h)以及 BIOS 的串行控制台重定向。

错误修复:

我没有意识到 PCBIOS 控制台已启用,因为该选项已被注释掉config/console.h

取消定义CONSOLE_PCBIOS解决config/console.h了我的问题。

解释为什么这是错误的:

CONSOLE_PCBIOS是写入屏幕并从键盘读取的“正常”控制台。

CONSOLE_SERIAL是iPXE自带的串口驱动。

BIOS 串行重定向是由 BIOS 实现的一项功能(可通过 BIOS 设置屏幕进行配置),其中写入屏幕的字符也将发送到串行端口。

问题在于您同时启用了CONSOLE_SERIAL和 BIOS 串行重定向。iPXE 将每个字符同时写入屏幕(由于CONSOLE_PCBIOS)和串行端口(由于CONSOLE_SERIAL)。然后,由于您启用了 BIOS 串行重定向,您的 BIOS 会将字符的额外副本写入串行端口。因此,您最终会在串行端口上获得每个字符的两个副本:一个由 iPXE 直接写入,一个由您的 BIOS 写入。

解决方案是禁用CONSOLE_SERIAL或禁用 BIOS 串行重定向(通过 BIOS 设置屏幕)。不要禁用CONSOLE_BIOS……

(可能意味着CONSOLE_PCBIOS

…除非您真的不想通过本地键盘和显示器进行交互。

您可能会发现 iPXECONSOLE_SERIAL比 BIOS 的串行重定向功能更强大,因此最好保持CONSOLE_SERIAL启用状态并禁用 BIOS 串行重定向(通过 BIOS 设置屏幕)。

提问者的反馈:

至少对于这个 alix 主板来说,iPXE 的串行驱动程序确实是首选(还没有尝试过其他串行设备),因为使用 BIOS 的重定向功能无法正确显示菜单。

不幸的是,这些设备附带的 BIOS 功能非常有限,实际上只有启动设置可以更改。

尽管如此,我还是找到了一个让我满意的解决方案。我修改了文件config/defaults/pcbios.h,将定义选项的行更改CONSOLE_PCBIOS为:

  #define CONSOLE_PCBIOS ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_TUI )

这样,至少菜单在我的串行设置中只打印一次,并且在正常情况下(非串行),iPXE 输出似乎也很好。

即使您的情况有所不同,我认为根本原因是相似的:两个软件向串行端口发送字符,其中一个是 BIOS。找到一种方法来使其中一个或另一个静音。

答案2

重启防火墙和机器后,我能够正确看到控制台。我先启动了 Putty,然后启动了防火墙。

以下是日志(我删除了一些关键点)。但你可以看到日志的某些部分仍然有“双字符问题”。第二点,即“垃圾字符”已经消失了。

感谢@Kamil Maciorowski 的宝贵帮助。

FreeBSD/amd64 (pfSense.localdomain) (ttyu0)

pfSense - Serial: ▒▒▒▒▒▒▒▒▒▒ - Netgate Device ID: ********************

*** Welcome to pfSense 2.4.3-RELEASE-p1 (amd64) on pfSense ***

 WAN (wan)       -> igb2       ->
 LAN (lan)       -> igb3       -> v4: 176.16.0.1/12
 OPT1 (opt1)     -> igb0       ->
 OPT2 (opt2)     -> igb1       ->
 ****** (opt3)   -> ovpnc1     ->

 0) Logout (SSH only)                  9) pfTop
 1) Assign Interfaces                 10) Filter Logs
 2) Set interface(s) IP address       11) Restart webConfigurator
 3) Reset webConfigurator password    12) PHP shell + pfSense tools
 4) Reset to factory defaults         13) Update from console
 5) Reboot system                     14) Disable Secure Shell (sshd)
 6) Halt system                       15) Restore recent configuration
 7) Ping host                         16) Restart PHP-FPM
 8) Shell

Enter an option: 4


You are about to reset the firewall to factory defaults.
The firewall will reboot afteruresetting the configuration.
All additional packages installed will be removed.
Booting from Hard Disk...|n]? y
H
F1  pfSenserebooting now.
Sep 15 06:33:20 ipsec_starter[38232]: charon stopped after 200 ms
F6 PXE 06:33:20 ipsec_starter[38232]: ipsec starter stopped
Boot:  F1 ax 60 seconds) for system process `vnlru' to stop... done
//bboooott//ccoonnffiigg::  --SS111155220000  --Daemon' to stop... done
Daiting (max 60 seconds) for system process `syncer' to stop...
//ncing disks, vnodes remaining... 0 0 done
All buffers synced.
 Coonnssoolleess::  iinntteerrnnaall  vviiddeeoo//kkeeyybbooaarrdd    sseerriia
uhub2: detached
 BIIOOSS  ddrriivvee  CC::  iiss  ddiisskk00
coreboot build 20171130
 BIIOOSS  663399kkBB//33440066445566kkBB  aavvaaiillaabbllee  mmeemmoorryy
4080 MB ECC DRAM

SeaBIOS (version rel-1.11.0.1-0-g90da88d)
 FrreeeeBBSSDD//xx8866  bboooottssttrraapp  llooaaddeerr,,  RReevviissiioonn  1
Press F10 key now for boot menn
 (MMoonn  MMaarr  1199  0066::5566::3311  CCDDTT  22001188  rroooott@@bbuuiilld

 Looaaddiinngg  //bboooott//ddeeffaauullttss//llooaaddeerr..ccoonnff

 |
 H                  ____
 H    __  ____    //  __||______    ______  __  ____    ______    ______
 H  ||  ''__  \\||  ||__//  ____||//  __  \\  ''__  \\//  ____||//  __  \\
 H  ||  ||__))  ||    __\\____  \\    ____//  ||  ||  \\____  \\    ____//
 H  ||  ..____/___//\\______||__||  ||__||______//\\______||
 H  ||__||
 H
                                             H
 H++=======================================H++==================================
 H||          HWWeellccoommee  ttoo  ppffSSeennssee
 H||                                       H||||
 H||HH..BBoooott  MMuullttii  UUsseerr  [[EEnntteerr]]                         |
 H||HH..BBoooott  [[SS]]iinnggllee  UUsseerr||||            __________________ |
 H||HH..[[EEsscc]]aappee  ttoo  llooaaddeerr  pprroommpptt``  ________      // |
 H||HH..RReebboooott                       H||||      //    //         //      |
 H||                                       H||||    //    //______//    //     |
 H||HOOppttiioonnss::                      H||||  //      ____________//       |
 H||HH..[[KK]]eerrnneell::  kkeerrnneell  ((11  ooff  22))                    /|
 H||HH..CCoonnffiigguurree  BBoooott  [[OO]]ppttiioonnss......              //_|
 H||                                       H||      //                         |
 H||                                       H||    //______________________    _
 H++=======================================H++==================================


// HAAuuttoobboooott  iinn  22  sseeccoonnddss..  [[SSppaaccee]]  ttoo  ppaauuse
   HAAuuttoobboooott  iinn  11  sseeccoonnddss..  [[SSppaaccee]]  ttoo  ppaauuse
   H

//bboooott//kkeerrnneell//kkeerrnn ddaattaa==00xxbb66ffaa ssyymmss==[[00xx8 ++08
 ++00xx1 ]] affeedd

 Boooottiinngg......

KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2017 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 11.1-RELEASE-p10 #13 r313908+293707af843(RELENG_2_4): Thu May 10 15:09:8
    [email protected]:/builder/ce-243/tmp/obj/builder/ce-243/tmp/FreeB4
FreeBSD clang version 5.0.1 (tags/RELEASE_501/final 320880) (based on LLVM 5.0.)
VT(vga): resolution 640x480
CPU: AMD GX-412TC SOC                                (998.15-MHz K8-class CPU)
  Origin="AuthenticAMD"  Id=0x******  Family=0x16  Model=0x30  Stepping=1
  Features=0x178bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,>
  Features2=0x3ed8220b<SSE3,PCLMULQDQ,MON,SSSE3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT>
  AMD Features=0x2e500800<SYSCALL,NX,MMX+,FFXSR,Page1GB,RDTSCP,LM>
  AMD Features2=0x1d4037ff<LAHF,CMP,SVM,ExtAPIC,CR8,ABM,SSE4A,MAS,Prefetch,OSVW>
  Structured Extended Features=0x8<BMI1>
  XSAVE Features=0x1<XSAVEOPT>
  SVM: NP,NRIP,AFlush,DAssist,NAsids=8
  TSC: P-state invariant, performance statistics
real memory  = 5083496448 (4848 MB)
avail memory = 4073701376 (3884 MB)
Event timer "LAPIC" quality 100
ACPI APIC Table: <CORE   COREBOOT>
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
FreeBSD/SMP: 1 package(s) x 4 core(s)
ioapic1: Changing APIC ID to 5
ioapic0 <Version 2.1> irqs 0-23 on motherboard
ioapic1 <Version 2.1> irqs 24-55 on motherboard
SMP: AP CPU #1 Launched!
SMP: AP CPU #3 Launched!
SMP: AP CPU #2 Launched!
Timecounter "TSC" frequency 998149043 Hz quality 1000
iwi_monitor: You need to read the LICENSE file in /usr/share/doc/legal/intel_iw.
iwi_monitor: If you agree with the license, set legal.intel_iwi.license_ack=1 i.
module_register_init: MOD_LOAD (iwi_monitor_fw, 0xffffffff80682e00, 0) error 1
random: entropy device external interface
wlan: mac acl policy registered
ipw_bss: You need to read the LICENSE file in /usr/share/doc/legal/intel_ipw.LI.
ipw_bss: If you agree with the license, set legal.intel_ipw.license_ack=1 in /b.
module_register_init: MOD_LOAD (ipw_bss_fw, 0xffffffff8065c140, 0) error 1
ipw_ibss: You need to read the LICENSE file in /usr/share/doc/legal/intel_ipw.L.
ipw_ibss: If you agree with the license, set legal.intel_ipw.license_ack=1 in /.
module_register_init: MOD_LOAD (ipw_ibss_fw, 0xffffffff8065c1f0, 0) error 1
ipw_monitor: You need to read the LICENSE file in /usr/share/doc/legal/intel_ip.
ipw_monitor: If you agree with the license, set legal.intel_ipw.license_ack=1 i.
module_register_init: MOD_LOAD (ipw_monitor_fw, 0xffffffff8065c2a0, 0) error 1
iwi_bss: You need to read the LICENSE file in /usr/share/doc/legal/intel_iwi.LI.
iwi_bss: If you agree with the license, set legal.intel_iwi.license_ack=1 in /b.
module_register_init: MOD_LOAD (iwi_bss_fw, 0xffffffff80682ca0, 0) error 1
iwi_ibss: You need to read the LICENSE file in /usr/share/doc/legal/intel_iwi.L.
iwi_ibss: If you agree with the license, set legal.intel_iwi.license_ack=1 in /.
module_register_init: MOD_LOAD (iwi_ibss_fw, 0xffffffff80682d50, 0) error 1
kbd0 at kbdmux0
netmap: loaded module
module_register_init: MOD_LOAD (vesa, 0xffffffff81162ce0, 0) error 19
nexus0
vtvga0: <VT VGA driver> on motherboard
cryptosoft0: <software crypto> on motherboard
padlock0: No ACE support.
acpi0: <CORE COREBOOT> on motherboard
acpi0: Power Button (fixed)
cpu0: <ACPI CPU> on acpi0
cpu1: <ACPI CPU> on acpi0
cpu2: <ACPI CPU> on acpi0
cpu3: <ACPI CPU> on acpi0
atrtc0: <AT realtime clock> port 0x70-0x71 irq 8 on acpi0
Event timer "RTC" frequency 32768 Hz quality 0
attimer0: <AT timer> port 0x40-0x43 irq 0 on acpi0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff on acpi0
Timecounter "HPET" frequency 14318180 Hz quality 950
Timecounter "ACPI-safe" frequency 3579545 Hz quality 850
acpi_timer0: <32-bit timer at 3.579545MHz> port 0x818-0x81b on acpi0
acpi_button0: <Power Button> on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
pcib1: <ACPI PCI-PCI bridge> irq 24 at device 2.1 on pci0
pcib1: failed to allocate initial I/O port window: 0x1000-0x1fff
pci1: <ACPI PCI bus> on pcib1
igb0: <Intel(R) PRO/1000 Network Connection, Version - 2.5.3-k> mem 0xf7900000-1
igb0: Using MSIX interrupts with 3 vectors
igb0: Ethernet address: **:**:**:**:**:**
igb0: Bound queue 0 to cpu 0
igb0: Bound queue 1 to cpu 1
igb0: netmap queues/slots: TX 2/1024, RX 2/1024
pcib2: <ACPI PCI-PCI bridge> irq 25 at device 2.2 on pci0
pci2: <ACPI PCI bus> on pcib2
igb1: <Intel(R) PRO/1000 Network Connection, Version - 2.5.3-k> port 0x2000-0x22
igb1: Using MSIX interrupts with 3 vectors
igb1: Ethernet address: **:**:**:**:**:**
igb1: Bound queue 0 to cpu 2
igb1: Bound queue 1 to cpu 3
igb1: netmap queues/slots: TX 2/1024, RX 2/1024
pcib3: <ACPI PCI-PCI bridge> irq 26 at device 2.3 on pci0
pci3: <ACPI PCI bus> on pcib3
igb2: <Intel(R) PRO/1000 Network Connection, Version - 2.5.3-k> port 0x3000-0x33
igb2: Using MSIX interrupts with 3 vectors
igb2: Ethernet address: **:**:**:**:**:**
igb2: Bound queue 0 to cpu 0
igb2: Bound queue 1 to cpu 1
igb2: netmap queues/slots: TX 2/1024, RX 2/1024
pcib4: <ACPI PCI-PCI bridge> at device 2.4 on pci0
pci4: <ACPI PCI bus> on pcib4
igb3: <Intel(R) PRO/1000 Network Connection, Version - 2.5.3-k> port 0x4000-0x44
igb3: Using MSIX interrupts with 3 vectors
igb3: Ethernet address: **:**:**:**:**:**
igb3: Bound queue 0 to cpu 2
igb3: Bound queue 1 to cpu 3
igb3: netmap queues/slots: TX 2/1024, RX 2/1024
pci0: <encrypt/decrypt> at device 8.0 (no driver attached)
xhci0: <AMD FCH USB 3.0 controller> mem 0xf7f22000-0xf7f23fff irq 18 at device 0
xhci0: 32 bytes context size, 64-bit DMA
xhci0: Unable to map MSI-X table
usbus0 on xhci0
usbus0: 5.0Gbps Super Speed USB v3.0
ahci0: <AMD Hudson-2 AHCI SATA controller> port 0x5010-0x5017,0x5020-0x5023,0x50
ahci0: AHCI v1.30 with 2 6Gbps ports, Port Multiplier supported with FBS
ahcich0: <AHCI channel> at channel 0 on ahci0
ahcich1: <AHCI channel> at channel 1 on ahci0
ehci0: <AMD FCH USB 2.0 controller> mem 0xf7f26000-0xf7f260ff irq 18 at device 0
usbus1: EHCI version 1.0
usbus1 on ehci0
usbus1: 480Mbps High Speed USB v2.0
isab0: <PCI-ISA bridge> at device 20.3 on pci0
isa0: <ISA bus> on isab0
sdhci_pci0: <Generic SD HCI> mem 0xf7f27000-0xf7f270ff at device 20.7 on pci0
sdhci_pci0: 1 slot(s) allocated
orm0: <ISA Option ROM> at iomem 0xef000-0xeffff on isa0
ppc0: cannot reserve I/O port range
uart0: <16550 or compatible> at port 0x3f8 irq 4 flags 0x10 on isa0
uart0: console (115200,n,8,1)
uart1: <16550 or compatible> at port 0x2f8 irq 3 on isa0
hwpstate0: <Cool`n'Quiet 2.0> on cpu0
Timecounters tick every 1.000 msec
nvme cam probe device init
ugen0.1: <0x1022 XHCI root HUB> at usbus0
ugen1.1: <AMD EHCI root HUB> at usbus1
uhub0: <0x1022 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0
uhub1: <AMD EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus1
uhub0: 4 ports with 4 removable, self powered
uhub1: 2 ports with 2 removable, self powered
ugen1.2: <vendor 0x0438 product 0x7900> at usbus1
uhub2 on uhub1
uhub2: <vendor 0x0438 product 0x7900, class 9/0, rev 2.00/0.18, addr 2> on usbu1
uhub2: 4 ports with 4 removable, self powered
ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
ada0: <T50S2STMLC-004G OHY06A S> ATA8-ACS SATA 2.x device
ada0: Serial Number *************
ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 512bytes)
ada0: 3831MB (7847280 512 byte sectors)
Trying to mount root from ufs:/dev/ufsid/**************** [rw]...
WARNING: /: TRIM flag on fs but disk does not support TRIM
Configuring crash dumps...
No suitable dump device was found.
/dev/ufsid/****************: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/ufsid/****************: clean, 669160 free (4136 frags, 83128 blocks, 0.4%)
Filesystems are clean, continuing...
Mounting filesystems...
random: unblocking device.

        __
 _ __  / _|___  ___ _ __  ___  ___
| '_ \| |_/ __|/ _ \ '_ \/ __|/ _ \
| |_) |  _\__ \  __/ | | \__ \  __/
| .__/|_| |___/\___|_| |_|___/\___|
|_|


Welcome to pfSense 2.4.3-RELEASE (Patch 1)...

...ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib /usr/local/lE
32-bit compatibility ldconfig path: /usr/lib32
done.
External config loader 1.0 is now starting... ada0s1 ada0s1a
Launching the init system...Updating CPU Microcode...
CPU: AMD GX-412TC SOC                                (998.15-MHz K8-class CPU)
  Origin="AuthenticAMD"  Id=0x******  Family=0x16  Model=0x30  Stepping=1
  Features=0x178bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,>
  Features2=0x3ed8220b<SSE3,PCLMULQDQ,MON,SSSE3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT>
  AMD Features=0x2e500800<SYSCALL,NX,MMX+,FFXSR,Page1GB,RDTSCP,LM>
  AMD Features2=0x1d4037ff<LAHF,CMP,SVM,ExtAPIC,CR8,ABM,SSE4A,MAS,Prefetch,OSVW>
  Structured Extended Features=0x8<BMI1>
  XSAVE Features=0x1<XSAVEOPT>
  SVM: NP,NRIP,AFlush,DAssist,NAsids=8
  TSC: P-state invariant, performance statistics
Done.
.... done.
Initializing.................. done.
Starting device manager (devd)...done.
Loading configuration......done.
..............................Updating configuration...done.
Checking config backups consistency...done.
Setting up extended sysctls...done.
Setting timezone...done.
Configuring loopback interface...done.
Starting syslog...done.
Starting Secure Shell Services...done.
Setting up interfaces microcode...done.
Configuring loopback interface...done.
Creating wireless clone interfaces...done.
Configuring LAGG interfaces...done.
Configuring VLAN interfaces...done.
Configuring QinQ interfaces...done.
Configuring WAN interface...done.
Configuring LAN interface...done.
Configuring CARP settings...done.
Syncing OpenVPN settings...done.
Configuring firewall......done.
Starting PFLOG...done.
Setting up gateway monitors...done.
Setting up static routes...done.
Setting up DNSs...Starting DNS Resolver...done.
done.
Synchronizing user settings...done.
Starting webConfigurator...done.
Configuring CRON...done.
Starting NTP time client...done.
Starting DHCP service...done.
Starting DHCPv6 service...done.
Configuring firewall......done.
Generating RRD graphs...done.
Starting syslog...done.
Starting CRON... done.
pfSense 2.4.3-RELEASE (Patch 1) amd64 Thu May 10 15:02:52 CDT 2018
Bootup complete

相关内容