18
How and Why You Should Become a Kernel Hacker James Morris [email protected] FOSS.IN/2007 – Bengaluru, India

How and Why You Should Become a Kernel Hacker - FOSS.IN/2007

Embed Size (px)

DESCRIPTION

How and Why You Should Become a Kernel Hacker - FOSS.IN/2007 Presentation given in Bangalore, India.

Citation preview

Page 1: How and Why You Should Become a Kernel Hacker - FOSS.IN/2007

How and Why You Should Become a Kernel Hacker

James [email protected]

FOSS.IN/2007 – Bengaluru, India

Page 2: How and Why You Should Become a Kernel Hacker - FOSS.IN/2007

Introduction

Page 3: How and Why You Should Become a Kernel Hacker - FOSS.IN/2007

Only Three Essential Requirements

● Genuine interest

● Common sense

● Willing to work hard

Page 4: How and Why You Should Become a Kernel Hacker - FOSS.IN/2007

Kernel Hacking Myths

Myth: Kernel hacking is bizarrely difficult and mysterious.

Reality: It’s just software.

Page 5: How and Why You Should Become a Kernel Hacker - FOSS.IN/2007

Kernel Hacking Myths

Myth: Kernel hackers are mutant super geniuses.

Reality: There are a few of those, but most are just good engineers.

Page 6: How and Why You Should Become a Kernel Hacker - FOSS.IN/2007

How – Getting Started

● Dreaded mailing list: lkml

● Books

● Online resources

Page 7: How and Why You Should Become a Kernel Hacker - FOSS.IN/2007

How – Getting Started

● Learn C

● Become familiar with kernel build environment

● Test and submit bug reports

Page 8: How and Why You Should Become a Kernel Hacker - FOSS.IN/2007

How – Getting Started

● Fix bugs

● Scratch an itch

● Try many ideas

Page 9: How and Why You Should Become a Kernel Hacker - FOSS.IN/2007

How – Getting Started

● Get the Basics Right!

● Coding Style

● Patch Submission

Page 10: How and Why You Should Become a Kernel Hacker - FOSS.IN/2007

How – Getting Started

● Seek Mentors

● Follow Your Interests

● Initial learning curve is steep: be persistent!

Page 11: How and Why You Should Become a Kernel Hacker - FOSS.IN/2007

How – Technical Tips

● Keep it simple

● Read the code of good programmers

● Review others’ code

“I always listen for what I can leave out” -- Miles Davis

Page 12: How and Why You Should Become a Kernel Hacker - FOSS.IN/2007

How – Technical Tips

Study Kernel Primitives

● Locking● Modes, contexts● Timers● Data structures● Library code

Page 13: How and Why You Should Become a Kernel Hacker - FOSS.IN/2007

How - Process Tips

● Don’t defend bad code

● Show, don’t tell

“Talk is cheap. Show me the code.” -- Linus

Page 14: How and Why You Should Become a Kernel Hacker - FOSS.IN/2007

How - Process Tips

● Incremental changes

● Small, logically contained patches

● Release early and often

● Respond to feedback

Page 15: How and Why You Should Become a Kernel Hacker - FOSS.IN/2007

How - Process Tips

● Respect maintainer decisions

● Encourage contributions

● Mentor & delegate

Page 16: How and Why You Should Become a Kernel Hacker - FOSS.IN/2007

How - Social Tips

● Kernel community is a relic of USENET culture

● Getting flamed is an occupational hazard

● No excuse to do it to others

● Majority are professional

Page 17: How and Why You Should Become a Kernel Hacker - FOSS.IN/2007

How - Social Tips

● If you find yourself arguing with Alan Cox, you’re probably wrong

● Demonstrate your ideas and politely defend them if needed

● When you’re wrong, admit it and move on

Page 18: How and Why You Should Become a Kernel Hacker - FOSS.IN/2007

Resources

● “Being a Moron on linux-kernel”● LWN● KernelTrap● Documentation directory● Online books (“ldd3”)● The perfect patch● GIT for kernel hackers● Kernel Mentors● Kernel Newbies● LXR