Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear note about term emulator vs virtual console, and journalctl and dmesg #171

Open
Aster89 opened this issue Oct 5, 2022 · 1 comment

Comments

@Aster89
Copy link

Aster89 commented Oct 5, 2022

The following note about term emulator vs. console seems to suggest that in a virtual console we always see the output of printk (or pr_info, or others) in the terminal. It doesn't seem to be the case. I always have to check sudo dmesg to find whatever I print from within the module.

Furthermore the note mention journalctl, but that shows the action of insmod and rmmod that I perform, not the output of the printing functions; again, that is shown in dmesg, which is unfortunately used but not presented first, just like journalctl.

I'm still at the beginning (I've read up to chapter 5.6 "Device Drivers"), but I think this is exactly what gives value to my comment.

Should I have better understanding in the future, I'll try to improve this wording myself, if somebody will not have done it yet.

lkmpg/lkmpg.tex

Lines 167 to 180 in 7b38f37

\item Using X Window System.
\label{sec:using_x}
It is highly recommended that you extract, compile and load all the examples this guide discusses from a console.
You should not be working on this stuff in X Window System.
Modules can not print to the screen like \cpp|printf()| can, but they can log information and warnings, which ends up being printed on your screen, but only on a console.
If you \sh|insmod| a module from an xterm, the information and warnings will be logged, but only to your systemd journal.
You will not see it unless you look through your \sh|journalctl| .
See \ref{sec:helloworld} for details.
To have immediate access to this information, do all your work from the console.
\end{enumerate}
\section{Headers}
\label{sec:headers}

@jserv
Copy link
Contributor

jserv commented Oct 14, 2022

Exactly, they are confusing. A pseudo{terminal,tty}, or PTY is a pair of pseudo-device endpoints which establish asynchronous, bidirectional communication IPC channel (with two ports) between two or more processes. An example using PTY is xterm-pty, which adds a PTY layer to xterm.js. For X11, xterm and rxvt are generally terminal emulators using tty, and current LKMPG does not distinguish from tty and pty though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants