I am a new user for Linux and am currently learning this. I studied the topic "Debugging the OS" and related topics, and as the main tool for debugging, it is recommended to print certain information about the state of the system.
This task can be performed by the mentioned functions printf() , as well as printk() , and found that "k" denotes the kernel and is a kind of "primitive" form of the print function. In addition, printf() is defined by the C library, not by the kernel (not completely sure about the meaning of this).
I was wondering if there is any other advantage to using any of them, except for the obvious one (which should use printk() in the early stages of loading, given that printf() is not yet available). Is it possible to get the same information when using two of them?
source share