虚拟控制台、shell 和 Xorg——它们如何交互?
Virtual consoles, shells and Xorg - how they interact?
维基百科 article 说:
usually the first six virtual consoles provide a text terminal with a login prompt to a Unix shell. The graphical X Window System starts in the seventh virtual console.
这是否意味着 Xorg 只是 terminal/console/shell 命令的 GUI 环绕?更准确地说,Xorg 是否将 GUI 命令(例如鼠标点击)转换为 shell 命令,然后将其作为系统调用传递给内核?
Does Xorg translate GUI commands (...) to shell commands?
不,一点也不。这只是 Linux 内核支持的一个小技巧,可以在切换回文本控制台时将键盘和鼠标移交给 X11,反之亦然。
我不知道细节,这可能是让这一切发生的黑客代码。基本上,当您按下 Alt-F7(或 X 处于 运行 的任何控制台)时,内核运行:"Oh yeah, there's this program called 'X' running here, go ahead and do your stuff"。当您按下 Ctrl-Alt-F1..6 切换回文本时,X 释放它在显卡上的保持状态并回调内核:"Yo, you should switch back to console 1..6!"
维基百科 article 说:
usually the first six virtual consoles provide a text terminal with a login prompt to a Unix shell. The graphical X Window System starts in the seventh virtual console.
这是否意味着 Xorg 只是 terminal/console/shell 命令的 GUI 环绕?更准确地说,Xorg 是否将 GUI 命令(例如鼠标点击)转换为 shell 命令,然后将其作为系统调用传递给内核?
Does Xorg translate GUI commands (...) to shell commands?
不,一点也不。这只是 Linux 内核支持的一个小技巧,可以在切换回文本控制台时将键盘和鼠标移交给 X11,反之亦然。
我不知道细节,这可能是让这一切发生的黑客代码。基本上,当您按下 Alt-F7(或 X 处于 运行 的任何控制台)时,内核运行:"Oh yeah, there's this program called 'X' running here, go ahead and do your stuff"。当您按下 Ctrl-Alt-F1..6 切换回文本时,X 释放它在显卡上的保持状态并回调内核:"Yo, you should switch back to console 1..6!"