Skip to main content

Posts

Showing posts with the label Device Driver

How to participate in the Linux kernel community

How to participate in the Linux kernel community? check out A GUIDE TO THE KERNEL DEVELOPMENT PROCESS Jonathan Corbet has written a very interesting article on "how to participate in the Linux kernel community" Section 1 is the executive summary. Section 2 introduces the development process, the kernel release cycle, and the mechanics of the merge window. Section 3 covers early-stage project planning, with an emphasis on involving the development community as soon as possible. Section 4 is about the coding process; several pitfalls which have been encountered by other developers are discussed. Section 5 talks about the process of posting patches for review. Section 6 covers what happens after posting patches; the job is far from done at that point. Section 7 introduces managing patches with git and reviewing patches posted by others. Section 8 concludes the document with pointers to sources for more information on kernel development. Please take a look at the complete documen...

debug macro in kernel - dbg() macro

Help ksymoops out mkdir /var/log/ksymoops Every time a module is loaded /proc/ksymsand /proc/modules is copied there. -k /var/log/ksymoops/ .ksyms -l /var/log/ksymoops/ .modules dbg() macro #if !defined(CONFIG_FOO_MODULE) #define MY_NAME "foo_driver" #else #define MY_NAME THIS_MODULE->name #endif #define dbg(fmt, arg...) do { if (debug) printk(KERN_DEBUG "%s: "__FUNCTION__": " fmt "\n" , MY_NAME , ## arg); } while (0) static int debug; MODULE_PARM(debug, "i"); Using dbg() dbg ("Added slot %d to the list", slot->physical_number); shows up as: hotplug_pci: pci_hp_register: Added slot 2 to the list dbg (""); shows up as: hotplug_pci: pci_hp_register: Other printk() macros #define err(fmt, arg...) printk(KERN_ERR "%s: " fmt "\n" , MY_NAME , ## arg) #define info(fmt, arg...) printk(KERN_INFO "%s: " fmt "\n"...