Linux kernel debugging is considered by many to be difficult, and many people prefer to use the PRINTK function directly to output debugging information, and do not want to use a variety of commands to debug. For complex Linux drivers and programs like HAL, you need to test them in a variety of ways. The PRINTK function is similar to the printf function, while the PRINTK function runs in kernel space, and the printf function runs in user space.
Embedded Debugging methods:
1. Simulator. For example, Qtopia core can be used to provide qvfb,arm hardware simulations using the frame Buffer Simulation tool SkyEye open source projects.
2. Remote Debugging. The debugger is also on the PC, and the debugger communicates with the program being debugged over the network.
3. Post-mortem analysis using log and core dump files.
STDPRM Standard printer LPT1 port Stdaux standard serial device COM1 port stdin does not necessarily come from the keyboard, stdout and stderr are also not necessarily displayed on the screen and can be redirected to other devices or disk files. With fprintf (), the first parameter is recommended to use stderr instead of stdout, because stderr runs at a higher level, and the program stderr output when the exception exits, and StdOut does not. The kgdb contains two parts, the KGDB kernel and a set of connection interfaces. Although it is easy to write messages to the log file or console using the PRINTK function. However, the heavy use of the PRINTK function to frequently manipulate log files or console device files (/dev/console) can severely affect Linux drive performance (so that the speed of writing disks is much faster than reading and writing memory), so this requires the Linux driver to be used only during the development phase The PRINTK function outputs information and removes the PRINTK function that may affect performance when the Linux driver is officially released.
Embedded Linux Debugging Technology