Linux 中字符从键盘到应用程序的路径是什么?
20 世纪 80 年代的计算机杂志上有一篇文章(Kilobaud?创意计算?)描述了按键如何发出按键代码,如何通过设备驱动程序传递,转换为 ASCII 代码,通过事件处理程序发送,等等。等等,最终作为应用程序通过标准输入(或其他类似的东西)接收到的一个字节(或其他什么)。应用程序用它做什么超出了本文的范围。这篇文章很有趣,更多的是为了展示当时操作系统和设备驱动程序的复杂性,而不是技术实用性。
现在,在 2010 年,我们的 Linux 拥有非常大的内核、可加载模块、unixey tty 事物和管道层以及多处理……是否有类似的文章在任何地方发布,跟踪从键盘到某些应用程序的标准输入的字符,描述了方式?
寻找一些技术性的东西(不要淡化到流行科学杂志的水平),但可以被内核和低级 IO 工作的非专家理解。
(如果没有这样的文章,请继续写一篇,将其作为答案发布在这里!)
There was an article in a 1980s computer magazine (Kilobaud? Creative Computing?) that described how a key press emits a key code, how it gets passed through a device driver, translated to an ASCII code, send through an event handler, blah blah blah and ultimately ends up as a byte (or whatever) received by an application via stdin (or some equivalent). What the application did with it was outside the scope of the article. The article was interesting, more for showing the complexity of operating systems and device drivers of that time than for technical practicality.
Now in 2010 we have Linux with a very large kernel, loadable modules, layers of unixey tty thingies and pipes and multiprocessing... is there a similar article published anywhere that traces a character from keyboard to some app's stdin, describing every step of the way?
Looking for something technical (not watered down to pop science magazine level) but understandable by non-experts at kernels and low level IO workings.
(If there is no such article, go ahead and write one, post it as an answer here!)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
快速谷歌提出了这个:
http://www.linuxjournal.com/article/1080
它从 1995 年开始,但从你想要的角度来看并没有太大变化(不是在源代码级别)
A quick google brought up this:
http://www.linuxjournal.com/article/1080
Its from 1995, but not much has changed from the perspective you want (not at source code level)