Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux...
Transcript of Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux...
![Page 1: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/1.jpg)
2014
Linux Kernel Hacking 101
Kelley Nielsen
Salticidoftheearth.com
For the Linux Foundation
Oct 8, 2014
#GHC14
2014
![Page 2: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/2.jpg)
2014
![Page 3: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/3.jpg)
2014
The process of kernel hacking is a
CYCLE
![Page 4: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/4.jpg)
2014
The Creative Cycle
Code your changes
Send in your patch
Gather feedback
Repeat
![Page 5: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/5.jpg)
2014
The Creative Cycle
Find a contribution to make
− Read stored communications
− Gain experience
− Ask
![Page 6: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/6.jpg)
2014
The Creative Cycle
Find a contribution to make
− Read stored communications
− Gain experience
− Ask
![Page 7: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/7.jpg)
2014
The Creative Cycle
Find a contribution to make
− Read stored communications
− Gain experience
− Ask
![Page 8: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/8.jpg)
2014
The Creative Cycle
Find a contribution to make
− Read stored communications
− Gain experience
− Ask
![Page 9: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/9.jpg)
2014
The Creative Cycle
Code your contribution
Prepare and send the patchset
![Page 10: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/10.jpg)
2014
The Creative Cycle
Gather feedback
− Testing results
− Mentoring and guidance
− Discussion of strategies
− General suggestions
![Page 11: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/11.jpg)
2014
The Creative Cycle
Gather feedback
− Testing results
− Mentoring and guidance
− Discussion of strategies
− General suggestions
![Page 12: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/12.jpg)
2014
The Creative Cycle
Gather feedback
− Testing results
− Mentoring and guidance
− Discussion of strategies
− General suggestions
![Page 13: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/13.jpg)
2014
The Creative Cycle
Gather feedback
− Testing results
− Mentoring and guidance
− Discussion of strategies
− General suggestions
![Page 14: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/14.jpg)
2014
The Creative Cycle
Gather feedback
− Testing results
− Mentoring and guidance
− Discussion of strategies
− General suggestions
![Page 15: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/15.jpg)
2014
The Creative Cycle
Incorporate changes
− Use feedback to improve
− If your contribution is rejected, find another
Regenerate and resend your patchset
![Page 16: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/16.jpg)
2014
Repeat the previous two slides untilYour patchset is accepted…Then repeat with a new patchset…
![Page 17: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/17.jpg)
2014
Communicating with team membersand community
![Page 18: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/18.jpg)
2014
Communicating
Mailing lists
Private email
Conferences
Linux Weekly News
![Page 19: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/19.jpg)
2014
Communicating
Mailing lists
Private email
Conferences
Linux Weekly News
![Page 20: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/20.jpg)
2014
Communicating
Mailing lists
Private email
Conferences
Linux Weekly News
![Page 21: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/21.jpg)
2014
Communicating
Mailing lists
Private email
Conferences
Linux Weekly News
![Page 22: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/22.jpg)
2014
Communicating
Internet Relay Chat (IRC)− Looks like multi-way text messaging
− Use a dedicated client (not a web client)
− Connect to a network
− Once on the network, join a channel
![Page 23: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/23.jpg)
2014
Communicating
Internet Relay Chat (IRC)− Looks like multi-way text messaging
− Use a dedicated client (not a web client)
− Connect to a network
− Once on the network, join a channel
![Page 24: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/24.jpg)
2014
Communicating
Internet Relay Chat (IRC)− Looks like multi-way text messaging
− Use a dedicated client (not a web client)
− Connect to a network
− Once on the network, join a channel
![Page 25: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/25.jpg)
2014
Communicating
Internet Relay Chat (IRC)− Looks like multi-way text messaging
− Use a dedicated client (not a web client)
− Connect to a network
− Once on the network, join a channel
![Page 26: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/26.jpg)
2014
Communicating
Internet Relay Chat (IRC)− Looks like multi-way text messaging
− Use a dedicated client (not a web client)
− Connect to a network
− Once on the network, join a channel
![Page 27: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/27.jpg)
2014
![Page 28: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/28.jpg)
2014
Coding your changes
![Page 29: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/29.jpg)
2014
Coding your changes
Plan
Code
Compile & run
Test & debug
![Page 30: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/30.jpg)
2014
Coding your changes
Plan− Trace existing paths of execution
− Find examples similar to your goal
− Learn which lines are relevant
− Your friends are grep and the lxr ident search
![Page 31: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/31.jpg)
2014
Coding your changes
Plan− Trace existing paths of execution
− Find examples similar to your goal
− Learn which lines are relevant
− Your friends are grep and the lxr ident search
![Page 32: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/32.jpg)
2014
Coding your changes
Plan− Trace existing paths of execution
− Find examples similar to your goal
− Learn which lines are relevant
− Your friends are grep and the lxr ident search
![Page 33: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/33.jpg)
2014
Coding your changes
Plan− Trace existing paths of execution
− Find examples similar to your goal
− Learn which lines are relevant
− Your friends are grep and the lxr ident search
![Page 34: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/34.jpg)
2014
Coding your changes
Hack your code− Language is C
− Follow kernel coding style
− Gain skill with your editor
![Page 35: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/35.jpg)
2014
Coding your changes
Compile and run− This involves installation and rebooting!
− Use a virtual machine or dedicated machine
− Maintain a known working and a test kernel
![Page 36: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/36.jpg)
2014
Coding your changes
Compile and run− This involves installation and rebooting!
− Use a virtual machine or dedicated machine
− Maintain a known working and a test kernel
![Page 37: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/37.jpg)
2014
Coding your changes
Compile and run− This involves installation and rebooting!
− Use a virtual machine or dedicated machine
− Maintain a known working and a test kernel
![Page 38: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/38.jpg)
2014
Coding your changes
Test and debug− Your friend is printk()
− Find messages in /var/log/kern.log
− Create testing scenarios
![Page 39: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/39.jpg)
2014
Coding your changes
Test and debug− Your friend is printk()
− Find messages in /var/log/kern.log
− Create testing scenarios
![Page 40: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/40.jpg)
2014
Coding your changes
Test and debug− Your friend is printk()
− Find messages in /var/log/kern.log
− Create testing scenarios
![Page 41: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/41.jpg)
2014
Generating and Delivering Your Patch
![Page 42: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/42.jpg)
2014
Delivering Your Patch
Git commit strategy
Git branching strategy
Composing the commit message
The patch
![Page 43: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/43.jpg)
2014
Delivering Your Patch
Git commit strategy− Make small incremental changes− Make changes in logical order− Each change should be encapsulated− Be prepared to alter previous commits− Be prepared for upstream changes as you
update your sources
![Page 44: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/44.jpg)
2014
Delivering Your Patch
Git commit strategy− Make small incremental changes− Make changes in logical order− Each change should be encapsulated− Be prepared to alter previous commits− Be prepared for upstream changes as you
update your sources
![Page 45: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/45.jpg)
2014
Delivering Your Patch
Git commit strategy− Make small incremental changes− Make changes in logical order− Each change should be encapsulated− Be prepared to alter previous commits− Be prepared for upstream changes as you
update your sources
![Page 46: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/46.jpg)
2014
Delivering Your Patch
Git commit strategy− Make small incremental changes− Make changes in logical order− Each change should be encapsulated− Be prepared to alter previous commits− Be prepared for upstream changes as you
update your sources
![Page 47: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/47.jpg)
2014
Delivering Your Patch
Git commit strategy− Make small incremental changes− Make changes in logical order− Each change should be encapsulated− Be prepared to alter previous commits− Be prepared for upstream changes as you
update your sources
![Page 48: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/48.jpg)
2014
Delivering Your Patch
Git branching strategy− Keep master branch unmodified
− Create a working branch
− Use a throwaway branch to squash commits
− If this method doesn’t work for you, try another
![Page 49: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/49.jpg)
2014
Delivering Your Patch
Git branching strategy− Keep master branch unmodified
− Create a working branch
− Use a throwaway branch to squash commits
− If this method doesn’t work for you, try another
![Page 50: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/50.jpg)
2014
Delivering Your Patch
Git branching strategy− Keep master branch unmodified
− Create a working branch
− Use a throwaway branch to squash commits
− If this method doesn’t work for you, try another
![Page 51: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/51.jpg)
2014
Delivering Your Patch
Git branching strategy− Keep master branch unmodified
− Create a working branch
− Use a throwaway branch to squash commits
− If this method doesn’t work for you, try another
![Page 52: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/52.jpg)
2014
Delivering Your Patch
Composing the commit message− Work as hard on this as you do on coding!
− Read existing examples
− Be concise, yet thorough
− Use imperative language
![Page 53: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/53.jpg)
2014
Delivering Your Patch
Composing the commit message− Work as hard on this as you do on coding!
− Read existing examples
− Be concise, yet thorough
− Use imperative language
![Page 54: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/54.jpg)
2014
Delivering Your Patch
Composing the commit message− Work as hard on this as you do on coding!
− Read existing examples
− Be concise, yet thorough
− Use imperative language
![Page 55: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/55.jpg)
2014
Delivering Your Patch
Composing the commit message− Work as hard on this as you do on coding!
− Read existing examples
− Be concise, yet thorough
− Use imperative language
![Page 56: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/56.jpg)
2014
Delivering Your Patch
The patch itself− Run checkpatch.pl on the files you change
− Generate patch with a git command
− Cc everyone involved with the code
− Send using plain text mail
![Page 57: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/57.jpg)
2014
Delivering Your Patch
The patch itself− Run checkpatch.pl on the files you change
− Generate patch with a git command
− Cc everyone involved with the code
− Send using plain text mail
![Page 58: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/58.jpg)
2014
Delivering Your Patch
The patch itself− Run checkpatch.pl on the files you change
− Generate patch with a git command
− Cc everyone involved with the code
− Send using plain text mail
![Page 59: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/59.jpg)
2014
Delivering Your Patch
The patch itself− Run checkpatch.pl on the files you change
− Generate patch with a git command
− Cc everyone involved with the code
− Send using plain text mail
![Page 60: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/60.jpg)
2014
Delivering Your Patch
Why plain text?− Email formatting will break your code
− Team members will apply your patch as is
− Commit message will become subject line and content
− Use a specific mail client such as mutt
(no gmail!)
![Page 61: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/61.jpg)
2014
Delivering Your Patch
Why plain text?− Email formatting will break your code
− Team members will apply your patch as is
− Commit message will become subject line and content
− Use a specific mail client such as mutt
(no gmail!)
![Page 62: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/62.jpg)
2014
Delivering Your Patch
Why plain text?− Email formatting will break your code
− Team members will apply your patch as is
− Commit message will become subject line and content
− Use a specific mail client such as mutt
(no gmail!)
![Page 63: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/63.jpg)
2014
Delivering Your Patch
Why plain text?− Email formatting will break your code
− Team members will apply your patch as is
− Commit message will become subject line and content
− Use a specific mail client such as mutt
(no gmail!)
![Page 64: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/64.jpg)
2014
Now wait for your feedback,And do it all again…
![Page 65: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/65.jpg)
2014
Happy Hacking!
![Page 66: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/66.jpg)
2014
Got Feedback?
Rate and Review the session using the GHC Mobile App
To download visit www.gracehopper.org
![Page 67: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/67.jpg)
2014
Resources Gnome Outreach Program for Women https://wiki.gnome.org/OutreachProgramForWomen Kernel.org git repositories https://git.kernel.org/cgit/ Linux Kernel Newbies http://kernelnewbies.org/ OPW Intro page http://kernelnewbies.org/OPWIntro The Eudyptula Challenge http://eudyptula-challenge.org/ KVM Installation https://help.ubuntu.com/community/KVM/Installation Linux Kernel Mailing List https://lkml.org/ Various Linux related mailing lists at Gmane http://gmane.org/find.php?list=kernel Linux Foundation events http://events.linuxfoundation.org/ Linux Weekly News http://lwn.net/ #irchelp http://www.irchelp.org/ Irssi – The Client of the Future http://www.irssi.org/ Wikipedia entry for the grep command http://en.wikipedia.org/wiki/Grep Linux Cross Reference at Free Electrons http://lxr.free-electrons.com/ Linux Kernel Coding Style (pdf) https://computing.llnl.gov/linux/slurm/coding_style.pdf Vim the editor http://www.vim.org/ Pro Git http://git-scm.com/book https://www.gitbook.io/book/gitbookio/progit The Mutt E-Mail Client http://www.mutt.org/
![Page 68: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/68.jpg)
2014
Image Credits
Arrows Circle by Freepik CC BY 3.0 Communication shannon-weaver2 by Einar Faanes CC BY-SA 3.0 Xaric screen shot by Triddle BSD License
http://commons.wikimedia.org/wiki/File:Xaric_screen_shot.jpg Coding All Night Long by Snatcherdudette http://
snatcherdudette.deviantart.com/art/Coding-all-night-long-183815498 Music present by Marta Crowe Creative Commons Attribution 2.0 Generic Linux Foundation Logo is in the public domain Linux “Tux” Logo is in the public domain
![Page 69: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/69.jpg)
2014
![Page 70: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/70.jpg)
2014
![Page 71: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/71.jpg)
2014
Title Goes Here
The first point− Sub-points
• Down one more• And again
o Once more
![Page 72: Linux Kernel Hacking...Linux Kernel Hacking 101 Kelley Nielsen Salticidoftheearth.com For the Linux Foundation Oct 8, 2014 #GHC14 2014 2014 2014 The process of kernel hacking is a](https://reader034.fdocuments.us/reader034/viewer/2022052303/5f0832ac7e708231d420d2b8/html5/thumbnails/72.jpg)
2014
Title Goes Here
The first point− Sub-points
• Down one more• And again
o Once more