What is the trip like? 这一趟像什么?
Your program only reaches the first window. Every layer below is handed the byte by the one above. 你的程序也只走到第一道窗口。往下每一层,都由上一层交给它。
It's like…就像……
With a parcel, you only reach the front desk. Every leg after that is one pair of hands passing to the next. 寄快递,你只走到前台。剩下的每一段,都是上一段的人交给下一段。
Your program hands it in 你的程序把它递进内核
A program cannot walk into the kernel; it hands the byte in at a window. 程序进不了内核,只能在窗口把字节递进去。
The tty layer finds the driver tty 层照名字找到驱动
The tty layer owns terminal devices and picks the driver. tty 层管的是终端这类设备,它挑出该由谁接手。
The driver writes the send register 驱动写进发送寄存器
The driver writes one byte to one address, and hands it over. Ordinary programs stop short of here; that takes a privileged door like /dev/mem, UIO or VFIO. 驱动往一个地址写一个字节,这个字节就交出去了。普通程序走不到这里,要 /dev/mem、UIO、VFIO 这类特权口子才行。