linux Usb serial console
ubuntu
Usb serial console 能够把下电时打印输出到串口上,可以记录,而netconsole只能输出下电到disk 之前的打印
- Usb串口线,ftdi或pl2303都可以
- 如果是ubuntu,需要重新编译内核,CONFIG_USB_SERIAL_CONSOLE=y
CONFIG_USB_SERIAL=y,其他可以把ftdi或pl2303编译进内核。注2
- 编辑/etc/default/grub
找到GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" 替换成 GRUB_CMDLINE_LINUX_DEFAULT="debug ignore_loglevel console=tty0 console=ttyUSB0,115200n8 ",注意Ubuntu需要加ignore_loglevel4. centos执行grub2-mkconfig –o /boot/grub2/grub.cfg (grub.cfg也可能在/boot/efi/里)。Ubuntu执行update-grub5. reboot6. Ubuntu会显示login,原因是systemd主动把ttyUSB0加到getty了,可以chmod a-x /lib/systemd/system-generators/system-getty-generator
附录参考
注1:
Serial Console
Serial console enables one to dump out console messages over a serial cable. Most modern PCs do not have legacy serial ports, so instead, one can use a USB serial dongle instead. A "null serial cable" or "universal file transfer cable" is needed to connect the target computer with the host. Most commonly this will be a DB9 female to DB9 female null serial cable. In addition, one needs to enable USB serial support as a kernel build configuration:
CONFIG_USB_SERIAL_CONSOLE=y
CONFIG_USB_SERIAL=y
and enable the appropriate driver, e.g.:
CONFIG_USB_SERIAL_PL2303=y
and boot this kernel with
console=ttyUSB0,9600n8
one may need to adjust the baud rate appropriately.
Note: Generally, there is NO hardware or software flow control on serial console drivers, which means one may get dropped characters when running very high speed tty baud rates, such as 115200 baud.
注2,ubuntu 内核编译
1.下载对应源码 apt-get source linux-image-$(uname -r)
2.安装编译工具略
https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel
centos8+ASUA B560M-Plus
centos8中的默认串口为ttyS0
首先连接串口线:如下图

修改grub配置:
打开/etc/default/grub,增加如下配置。
GRUB_TERMINAL="console serial"
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200"
更新grub
grub2-mkconfig -o /boot/grub2/grub.cfg
用其他电脑连接串口。
linux Usb serial console的更多相关文章
- Linux/drivers/usb/serial/ftdi_sio.c
Linux/drivers/usb/serial/ftdi_sio.h /* 2 * Driver definitions for the FTDI USB Single Port Serial Co ...
- install usb serial
Install driver for USB-UART bridge converter on Linux Ubuntu12.04 Ubuntu下USB转串口芯片驱动程序安装,支持cp210x,pl2 ...
- Linux usb子系统(一) _写一个usb鼠标驱动
USB总线是一种典型的热插拔的总线标准,由于其优异的性能几乎成为了当下大小设备中的标配. USB的驱动可以分为3类:SoC的USB控制器的驱动,主机端USB设备的驱动,设备上的USB Gadget驱动 ...
- 《网蜂A8实战演练》——8.Linux USB 主机控制器和设备驱动
USB 的全称是 Universal Serial Bus,顾名思义:通用串行总线. 提到总线,联想一下,在你心目中总线总是用来干嘛的?还记得 I2C 总线? I2C 总线上挂有二条信号线,一条是 S ...
- Hi3559AV100外接UVC/MJPEG相机实时采图设计(一):Linux USB摄像头驱动分析
下面将给出Hi3559AV100外接UVC/MJPEG相机实时采图设计的整体流程,主要实现是通过V4L2接口将UVC/MJPEG相机采集的数据送入至MPP平台,经过VDEC.VPSS.VO最后通过HD ...
- Linux USB Project
转自:http://www.linux-usb.org/ Welcome to the home of the Linux USB Project This web site was created ...
- Linux USB驱动
linux usb 驱动详解 一 http://blog.163.com/cl2006ky@126/blog/static/87195173201131245557340/ USB设备驱动开发-USB ...
- usb serial for android
/******************************************************************** * usb serial for android * 说明: ...
- Linux usb子系统(二):USB设备驱动usb-skeleton.c
usb驱动分为通过usbfs操作设备的用户空间驱动,内核空间的内核驱动.两者不能同时进行,否则容易引发对共享资源访问的问题,死锁!使用了内核驱动,就不能在usbfs里驱动该设备. 下面转载的一篇分析u ...
- Linux usb子系统(一):子系统架构
一.USB协议基础知识 前序:USB概念概述 USB1.0版本速度1.5Mbps(低速USB) USB1.1版本速度12Mbps(全速USB) USB2.0版本速度480Mbps(高速USB). ...
随机推荐
- 解决elementplus carousel固定高度问题/ResizeObserverAPI介绍
"element-plus": "^2.2.26", "@vueuse/components": "^9.7.0", 引 ...
- Java-Collectors.groupingBy
Java中的Collectors类的groupingBy()方法用于按某些属性对对象进行分组并将结果存储在Map实例中. 当我我们想利用它的特性,我们需要指定一个属性来执行分组.此方法提供的函数类似于 ...
- python桌面应用自动化,uiautomation模块的Depth和searchDepth心得
最近在学习yinkaisheng大神写的uiautomation模块,Depth和searchDepth一直使用不好,明明Depth=3,居然可以用searchDepth=1找到,网上也没找到答案,就 ...
- macOS NSView改变frame后会出现黑色残留,应付的办法是不在drawRect上修改重新initWithFrame一下就行
黑色部分就是残留.是因为绘制后保留了轨迹. 解决办法是不在drawRect中做处理重新写NSView,新增方法 initWithFrame - (void)drawRect:(NSRect)dirty ...
- 邮件合并 :处理ACCESS中批量查询语句的运行
利用邮件合并,制作批量查询语句,一条一条的复制粘贴并运行. 有点笨但是想不出什么好办法,除非用模块的过程,但还是要手动输入参数.http://www.docin.com/p-695725657.htm ...
- wamp+phpstrom+Xdebuge helper(google)
一.软件安装两个软件的安装和第三个浏览器插件就不再赘述,网上有很多详细的教程,自行百度. 二.配置步骤1.wampwamp的优势在于自带xdebuge的dll文件,所以不需要在官网根据版本下载,具体位 ...
- android studio的一些辅助工具
目录配置 https://blog.csdn.net/Kideers/article/details/128233984 https://blog.csdn.net/hnjcxy/article/de ...
- uniapp 图片文件流
uni.request({ url: '*****', //仅为示例,并非真实接口地址. method: 'GET', responseType: 'arraybuffer', data: {}, h ...
- Spring事务注意事项 以及 遇到的坑
原创参考: https://www.cnblogs.com/yougewe/p/7466677.html (Spring,为内部方法新起一个事务,此处应有坑.) https://blog.csdn ...
- spring boot 导出数据到excel
手把手教你springboot中导出数据到excel中 问题来源: 前一段时间公司的项目有个导出数据的需求,要求能够实现全部导出也可以多选批量导出(虽然不是我负责的,我自己研究了研究),我们的项目是x ...