linux串口tty driver
user space调用read()读取标准输入kernel flow
tty_read
tty_read() if (ld->ops->read) i = ld->ops->read(tty, file, buf, count);
stacktrace for sh-198: n_tty_read+0x0/0x764 __vfs_read+0x60/0x1f8 vfs_read+0xbc/0x15c ksys_read+0x78/0xe4 __arm64_sys_read+0x1c/0x28 el0_svc_common+0xc8/0x1b8 el0_svc_handler+0x1c/0x28 el0_svc+0x8/0x100
上面ld->ops->read()即是n_tty_read
查看ttyS0是否有开启
cat /sys/devices/platform/uart_control/uart_switch_status
执行结果如下:
001110220330
上面第3个字元如果为0,表示ttyS0是关闭的
reference:https://www.cnblogs.com/sky-heaven/p/5603546.html
标签:tty,ops,read,串口,driver,ld,linux From: https://www.cnblogs.com/aspirs/p/16936807.html