~ Enjoy Today ~
Kernel Kernel undertakes the core Operating System job, which is the foundation of the current software ecosystem.
So, knowing more about how the kernel works will contribute to the construction of our user mode system.
The best method to learn software code is debugging while watching, software = code + data, know more about the runtime data while learning code can help us understand it better.
However the Kernel is not a normal software system, we can’t add breakpoint and debug it through IDE debug button like other normal software, though we can implement it by kgdb + QEMU, it’ still too heavy, and not available for online systems.
This article shares two lightweight kernel debugging tips, helps us observing it runtime status rapidly.
Kernel Module Usally, our codes are runing in user mode. In Linux operating systems, the instruction of user mode program will run in level Ring 3 , they do not have the permission to acces the data in level Ring 0 high memory address space, which means that they can’t snoop the data inside Kernel.
In that case, why not try to run our code inside the Kernel?
It’s possible to edit the source code of kernel, adding log to print the information we concerned, but it’s a long tedious step.......