如:
write
write —> fd
tty_write()
do_tty_write()
1
struct tty_struct *tty
struct tty_ldisc *ldisc;
struct tty_ldisc_ops *ops;
// n_tty_write()
write)(struct tty_struct *tty, struct file *file, const unsigned char *buf, size_t nr) -----------------------------------------ldisc层
|
|
|
|
struct tty_struct *tty |
const struct tty_operations *ops; |
//uart_write() |
int (*write)(struct tty_struct * tty,const unsigned char *buf, int count); -------------------------------------core层
//将数据存储到 |
struct uart_state |
struct circ_buf xmit; |
|
|
|
|
struct tty_struct |
struct uart_state |
struct uart_port *uart_port |
const struct uart_ops *ops; |
(*start_tx)(struct uart_port *); -------+ -------------------------------- uart层
写流程:

读流程

本文详细探讨了终端设备的数据写入流程,从内核的tty_write到底层的uart_write,逐层剖析了控制结构和关键函数,揭示了通信协议栈的运作机制。
8164

被折叠的 条评论
为什么被折叠?



