ubuntu

Usb serial console 能够把下电时打印输出到串口上,可以记录,而netconsole只能输出下电到disk 之前的打印

  1. Usb串口线,ftdi或pl2303都可以
  2. 如果是ubuntu,需要重新编译内核,CONFIG_USB_SERIAL_CONSOLE=y

CONFIG_USB_SERIAL=y,其他可以把ftdi或pl2303编译进内核。注2

  1. 编辑/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的更多相关文章

  1. 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 ...

  2. install usb serial

    Install driver for USB-UART bridge converter on Linux Ubuntu12.04 Ubuntu下USB转串口芯片驱动程序安装,支持cp210x,pl2 ...

  3. Linux usb子系统(一) _写一个usb鼠标驱动

    USB总线是一种典型的热插拔的总线标准,由于其优异的性能几乎成为了当下大小设备中的标配. USB的驱动可以分为3类:SoC的USB控制器的驱动,主机端USB设备的驱动,设备上的USB Gadget驱动 ...

  4. 《网蜂A8实战演练》——8.Linux USB 主机控制器和设备驱动

    USB 的全称是 Universal Serial Bus,顾名思义:通用串行总线. 提到总线,联想一下,在你心目中总线总是用来干嘛的?还记得 I2C 总线? I2C 总线上挂有二条信号线,一条是 S ...

  5. Hi3559AV100外接UVC/MJPEG相机实时采图设计(一):Linux USB摄像头驱动分析

    下面将给出Hi3559AV100外接UVC/MJPEG相机实时采图设计的整体流程,主要实现是通过V4L2接口将UVC/MJPEG相机采集的数据送入至MPP平台,经过VDEC.VPSS.VO最后通过HD ...

  6. Linux USB Project

    转自:http://www.linux-usb.org/ Welcome to the home of the Linux USB Project This web site was created ...

  7. Linux USB驱动

    linux usb 驱动详解 一 http://blog.163.com/cl2006ky@126/blog/static/87195173201131245557340/ USB设备驱动开发-USB ...

  8. usb serial for android

    /******************************************************************** * usb serial for android * 说明: ...

  9. Linux usb子系统(二):USB设备驱动usb-skeleton.c

    usb驱动分为通过usbfs操作设备的用户空间驱动,内核空间的内核驱动.两者不能同时进行,否则容易引发对共享资源访问的问题,死锁!使用了内核驱动,就不能在usbfs里驱动该设备. 下面转载的一篇分析u ...

  10. Linux usb子系统(一):子系统架构

    一.USB协议基础知识   前序:USB概念概述 USB1.0版本速度1.5Mbps(低速USB) USB1.1版本速度12Mbps(全速USB)  USB2.0版本速度480Mbps(高速USB). ...

随机推荐

  1. 使用ts二次封装storage(sessionStorage/localStorage)

    export class LocalCache { setCache<T = any>(key: string, value: T): boolean; setCache<T = a ...

  2. zookeeper在关闭服务时报could not find file /opt/module/zookeeper-3.5.10/zkData/zookeeper_server.pid

    遇到了个问题,zookeeper在执行 bin/zkServer.sh stop时 会报题目中的错误,我搜了一下博客,好像是因为第一次启动的不是zkServer.sh中的服务 我先 kill -9 加 ...

  3. win10系统解决启动虚拟机蓝屏问题

    1.查看电脑是否开启了虚拟化,如果没起开开启 CTR+SHIFT+Esc 2.是否开启了虚拟化选项 win+r 输入 OptionalFeatures

  4. postman脚本语法大全,不包括插件语法

    官方语法例子:https://learning.postman.com/docs/writing-scripts/script-references/test-examples/ 官方语法库:http ...

  5. 学习- vue 中 API $attr 用法

    2.4.0新增 定义:包含了父作用域不作为 prop 被识别(且获取)的 attribute 绑定( class 和 style 除外).当一个组件没有声明任何 prop 时,这里会包含所有父作用域的 ...

  6. idea的小tip

    1. 校验正则表达式 String类型的matches方法中键入option+return选择 check regexp可以测试正则的正确性

  7. list.size() = 1 但显示 All elements are null

    https://blog.csdn.net/weixin_43899069/article/details/124668722 if (CollectionUtils.isNotEmpty(list) ...

  8. C# string的2个特殊方法

    1. Strings.Join 方法:用指定的连接符连接一个数组中包含的若干子字符串创建的字符串.e.g List<string> list = new List<string> ...

  9. iOS新建项目基础设置

    我们新建项目工程的时候一般都需要配置些基本设置,以下是我整理的一些基础配置 一:  pch文件的设置     pch:预编译头文件,这个文件会被编译存储在一个缓存空间,并自动有且只有一次包含在每个文件 ...

  10. mac 查看本机ip

    创建 ip.sh 文件,文件内容为 ifconfig -a | grep -e "inet[^6]" |\ sed -e "s/.*inet[^6][^0-9]*\([0 ...