Whenever I use printk() to debug my kernel device driver, I have to be
on console mode (without X-windows).
The problem is I use xemacs to write my driver, xemacs needs to run
on X-windows. Every time I need to debug my driver using printk(), I
have to get out of KDE to see my printk() statements output. This is
not practical.
I understand that printk() is in kernel space, so printk can't output
to
a process in user land.
Is there a technical solution to get the printk() output to a
KDE console? Anyone ever tries to solve this problem?
Thanks
Actually, the klogd process shuffles the kernel log messages out to syslog,
which you can then configure to put all kernel messages to a specific file
you can monitor.
--
Frank Sweetser fs at wpi.edu, fs at suave.net | $ x 16
Full-time WPI Network Tech, Part time Linux/Perl guy |
"I'm an idiot.. At least this one [bug] took about 5 minutes to find.."
(Linus Torvalds in response to a bug report.)
Can't you log kernel messages using klogd and then do a tail -f on the
log file?
There isn't any way to make kernel output under X *synchronous*.
Output going to a terminal emulator travels through sockets. If your
driver crashes your system, you will not be able to see the crucial last
portions of your output, and any diagnostic messages about the crash.
>The problem is I use xemacs to write my driver, xemacs needs to run
>on X-windows.
Boo hoo! :(
why don't you just switch between x-windows on one terminal (maybe tty1)
and another virtual terminal (say, tty2)...? printk() will print to
a console. that would be a solution. or, better yet, just use regular
emacs or vi in a console. why do you need xemacs? just learn a few
basic open, save, copy, paste, etc.. commands for emacs, and you're good
to go. the latest version of emacs even has syntax highlighting for the
console.
--
J o s h u a J o n e s / www.intmain.net / jajones(at)cc.gatech.edu
__ .~.
College of Computing at the | / / _ _ _ _ _ __ __ /V\
Georgia Institue of Technology | / /__ / / / \// //_// \ \/ / // \\
Atlanta, Georgia, U.S. | /____/ /_/ /_/\/ /___/ /_/\_\ /( )\
*Debian GNU/Linux* ^^-^^
You can use xconsole to view the system console in X. Or run an xterm
with "tail -f /var/log/kern.log" running in it.
This isn't necessarily a good idea though. If you're kernel hacking
and something goes wrong, then if your in X, the system is likely to
die before you ever get to see any output, as it has to pass through
so many different processes before it gets onto the screen. If you're
in console mode, the kernel writes directly to the console, and you're
much more likely to see the final output of the kernel before things
grind to a halt.
>The problem is I use xemacs to write my driver, xemacs needs to run
>on X-windows. Every time I need to debug my driver using printk(), I
>have to get out of KDE to see my printk() statements output. This is
>not practical.
Why not use emacs in console mode? If you want syntax highlighting,
then both Xemacs and emacs will do so in the console. Note that the X
in Xemacs has nothing to do with X the graphical system; Xemacs will
run quite happily in a linux console.
cheers,
Phil
--
http://www.kantaka.co.uk/ .oOo. public key: http://www.kantaka.co.uk/gpg.txt
http://www.daimi.au.dk/~kasperd/comp.os.linux.development.faq.html
--
Kasper Dupont
For sending spam use mailto:razor-...@daimi.au.dk
Which distributions use /var/log/kern.log?