红联Linux门户
Linux帮助

How to hackle the linux kernel

发布时间:2008-07-04 16:10:11来源:红联作者:beainm
I suggest the following steps:

Decide which part of the Linux kernel to explore (e.g., filesystem, networking, etc.)

Have in mind why you want to explore and decide what to look for (e.g., how to create a networking suite from scratch)

Get a source code browser application (e.g., cscope)

Start navigating from the simplest available code for the part that you want to explore (e.g., IPX code instead of INET code for the networking part)

Navigate the code through a particular flow that you want to know (e.g., in the networking part, how the IPX code send data from the user-space applications down to the wire)

Keep in mind that the Linux kernel is multi-threaded and you have to be aware about the context-of-execution as well as the locking mechanisms used (see Rusty's Guides, particularly Unreliable Guide To Hacking The Linux Kernel and Unreliable Guide To Locking, for details)

Keep in mind that some functions are registered as callback functions so that sometimes you will find the the chain of processing is cut short somewhere during the navigation of the process flow (e.g., you cannot find the definition of a particular function with cscope because it calls the registered callback function)
文章评论

共有 0 条评论