- 线路规程的作用就是将数据进行用户空间和内核空间之间的传输。
- 而一些底层驱动和终端驱动主要负责数据到硬件的传输。
- 往往不同的驱动对应着不同的线路规程,比如终端驱动对应着N_TTY ,点点通信对应着N_PPP等。
来源:http://www.itechtalk.com/thread290.html
Line disciplines provide an elegant mechanism that lets you use the same serial driver to run different technologies. The low-level physical driver and the tty driver handle the transfer of data to and from the hardware, while line disciplines are responsible
for processing the data and transferring it between kernel space and user space.
The serial subsystem supports 17 standard line disciplines. The default line discipline that gets attached when you open a serial port is N_TTY, which implements terminal I/O processing. N_TTY is responsible for "cooking" characters received from the keyboard.
Depending on user request, it maps the control character to newline, converts lowercase to uppercase, expands tabs, and echoes characters to the associated VT. N_TTY also supports a raw mode used by editors, which leaves all the preceding processing to user
applications. The example tty drivers listed at the end of the previous section, "TTY Drivers," use N_TTY by default.
Line disciplines also implement network interfaces over serial transport protocols. For example, line disciplines that are part of the Point-to-Point Protocol (N_PPP) and the Serial Line Internet Protocol (N_SLIP) subsystems, frame packets, allocate and populate
associated networking data structures, and pass the data on to the corresponding network protocol stack. Other line disciplines handle Infrared Data (N_IRDA) and the Bluetooth Host Control Interface (N_HCI).

本文介绍了线路规程在操作系统中的作用及其与串口驱动的关系。线路规程负责数据从内核空间到用户空间的传输,而串口驱动则处理数据与硬件间的交互。文章详细解释了默认线路规程N_TTY的工作原理及特性,并提到了其他几种线路规程如N_PPP和N_SLIP在网络通讯中的应用。
2520

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



