linux kernel development: getting started kernel... · 2015-09-14 · kernel announcements:...

Download Linux Kernel Development: Getting Started Kernel... · 2015-09-14 · Kernel announcements: linux­kernel­announce@vger.kernel.org…

Post on 12-Dec-2018

212 views

Category:

Documents

0 download

Embed Size (px)

TRANSCRIPT

Copyright2005RandyDunlap,Allrightsreserved.

LinuxKernelDevelopment:GettingStarted

LinuxKernelDeveloper,Mentor,andJanitor

IEEENorthconMay19,2005

RandyDunlap

Copyright2005RandyDunlap,Allrightsreserved.2

Agenda

Timetable:10:00am3:00pmwith15minutebreakeveryhour,pluslunch

Lotsoftimeforquestionsanddiscussion

Abstract: Linuxdevelopmentisfastpacedand[astheysayinOregon]things

aredifferenthere.ThistutorialintroducessomeoftheLinuxcultureandhowtogetthingsdonewell.

Copyright2005RandyDunlap,Allrightsreserved.3

Topics Opensourcedevelopmentstyle,values,culture Linuxrapiddevelopmentcycle Linuxmaintainersandhierarchy Communicationsmethods Advantagesofhavingadriverinthemainlinekerneltree Codingstyle HowtosubmitLinuxkernelpatches Somebestknownpractices Legal/Licenses Testing WorkingintheLinuxkerneltree

Copyright2005RandyDunlap,Allrightsreserved.4

MajorGoals

Encouragenewdevicedriverdevelopmentandsupport

Drivercodemergedandmaintainedinmainline(GPL)

Copyright2005RandyDunlap,Allrightsreserved.5

DevelopmentStyle,Values,andCulture

Learningcurve,thingsaredifferent

Meritocracygoodideas&goodcodearerewarded

ChancetoworkonarealOSanypartsofitthatinterestyou

Massiveamountsofopencommunicationviaemail,IRC,etc.

Copyright2005RandyDunlap,Allrightsreserved.6

LinuxCulture Workinopen,notbehindcloseddoors(insmokefilledrooms)# Communityallegianceisveryhigh DowhatisrightforLinux Meritocracy:goodideasandgoodcodearerewarded Oftendrivenbyidealsandpragmatism,bottomupdevelopment Notdrivenbymarketingrequirements Don'tjusttake,givebacktoo:#

Modificationsare&remainGPL(ifdistributed) Paymentinkind,selfinterest Improvesoftwarequality,featuresused/understoodmore

Copyright2005RandyDunlap,Allrightsreserved.7

LinuxCulture(2) Committedtofollowingandusingstandards(e.g.,POSIX,IETF) Committedtocompatibilitywithothersystemsoftware Informaldesign/development:Notmuchexternalhighlevelproject

planningordesigndocs(maybesomeinternallyatcompanies);canappeartobechaotic

Newideasbestpresentedascode,notspecificationsorrequirements

RERO:ReleaseEarly,ReleaseOftenforcomments,help,testing,communityacceptance#

Possibledownsides:flames,embarrassment

Copyright2005RandyDunlap,Allrightsreserved.8

LinuxCulture(3)

Developmentcommunityishighlytechnical Motivatedandcommitted,butsincemanyarevolunteers,treatthem

withrespectandask/influencethem,don'ttell Continuouscodereview(includingsecurity) Continuousimprovement Havefun!!:)

Followtheculture

Copyright2005RandyDunlap,Allrightsreserved.9

LinuxDevelopmentValues Scratchyourownitch Weekenders>bigbusiness Code,nottalk Pragmatism,nottheory Thickskin Codeproducermakes[most]

decisions Pride,principles,ethics,

honesty Performance

Hardware&softwarevendorneutral

Technicalmerit,notpolitics,who,ormoney

Maintainability&aesthetics:cleanimplementation,notuglyhacks(codingsytle)

Peerreviewofpatches(technical&style)

Contributionsearnrespect

Copyright2005RandyDunlap,Allrightsreserved.10

SomeThingstoAvoid

Patents,binarymodules,NDA Proprietarybenchmarks Hugepatchfiles AddingmoreIOCTLs Marketing Designdocuments Mentionofaccomplishments

outsideoftheopensourceworld Nopatchrationale

HowdoIinterceptasystemcall(orreplaceasyscalltableentry)?

Makingdemandsinsteadofrequests

This{driver/feature}mustbemerged,it'simportanttoourcompany.

Dateorreleaseversionrequirements

Copyright2005RandyDunlap,Allrightsreserved.11

SomeGoodTermstoUse

Simpler DeletesNlinesofcode Faster(withdata) Smaller(withdata) Here'sthecode.... Seriesofsmallpatches....

Tested...(howmanyconfigs) Buildson8architectures

Copyright2005RandyDunlap,Allrightsreserved.12

WhenNewInfrastructureIsNeeded Ifadriverneedssomenewgeneralpurposesubsystem

infrastructure,don'ttrytomergeitintothedriverthatwillberejected

Workwithothers(onml)todefineandimplementnewinfrastructure MultipathI/O(MPIO) SCSItransportservices WirelessLANstack RAID?? FCStateoftheUnion:http://lwn.net/Articles/132579/

Driverdeveloperscanhaveanimpactonkernelinfrastructure

Copyright2005RandyDunlap,Allrightsreserved.13

DriversforNewHardware IfyourcompanywantstodevelopaGPLdriverandmergeitinto

Linuxmainline,that'sgreatnews.Workwiththedevelopmentcommunity(onpublicmailinglists)toaccomplishthatgoal.

Shortofthat,ifyourcompanycanmakehardwareinterfacespecspublicandhardwareavailable,there'sagoodprobabilitythatsomeoneinthedevelopmentcommunitywilldevelopaGPLdriverforit.

Shortofthat,makethehardwareinterfacespecsavailableprivatelytosomeone,butallowthemtodevelopandpublishaGPLdriver.

Copyright2005RandyDunlap,Allrightsreserved.14

NewDriverDevelopment

Requires1+dedicatedfulltimesoftwareengineertokeepupwithmailinglistsandkernelchanges,staycurrent,becomeapartofthedevelopmentcommunity

Thisisacontinuous,ongoingcommitment,notaninfrequentcameoappearance.

Submitdriversformainlineinclusionandacceptance,nottodistros.Majordistrosnowrequireprogresstowardmainlineacceptance.

REROfortestinginthewild(community),inyourlab,andatthedistros

Copyright2005RandyDunlap,Allrightsreserved.15

DevelopmentCycle Movedfromsplitstable(2.even)anddevelopment(2.odd)trees

causeddelayandbackportmania Nowacceptingdevelopmentpatchesintothemmpatchsetand

movingthemtothemainlinekerneltreeafterashakeoutperiod(e.g.,2.6.11mm3)

2.6.xkernelversioncycle:makepatchesagainstLinus'stree(unlesstheyonlyapplytosomeothertreeorpatchset)

Timebetween2.6.xreleases,intermediate2.6.xrcN Nightlysnapshots;automatedbuildsofreleases;commitsml 2.6.x.ystablekernelpatches

Copyright2005RandyDunlap,Allrightsreserved.16

Linux2.6KernelTree&Branches

mainline

mmpatchset:review/testherebeforemergeintomainline

stablepatchseries

2.6.112.6.12rc12.6.12rc22.6.12rc32.6.12rc4.....2.6.12

mm1mm1mm1mm1mm1mm2mm2mm22.6.12rc3mm3

2.6.11.12.6.11.22.6.11.32.6.11.4.....2.6.11.9

Copyright2005RandyDunlap,Allrightsreserved.17

MergestoMainline(withexceptions)Mainlinekernel.org(Torvalds)

mmpatchset(Morton)Subsystemmaintainers

SCSI Block USB PPC XFS

Contributors(100s)

Copyright2005RandyDunlap,Allrightsreserved.18

DevelopmentCycles Rapiddevelopmentcycle,notimelines/schedules Onlyonlinedocumentationhasachanceofbeinguptodate Accommodatelargechangesandhighrateofchangewithout

regressions Opendiscussion(mailinglists,archives,notprivate)# RERO,facilitatestestingonalargevarietyofplatforms# Maintainersavailableandaccessible,don'tdisappearforlong

periodsoftime Testsuites Bugtracking

Copyright2005RandyDunlap,Allrightsreserved.19

RatesofKernelChange

firstsixmonthsof2.4devel:220,000lines,+600,000lines firstsixmonthsof2.6devel:600,000lines,+900,000lines

1.5Mlineschangedina6.2Mlinetree 64MBdiffinsixmonthsandthat'sthestablekernel

Current2.6.11>2.6.12rc4(10weeks):729Klines,22MBdiff Current2.6.12rc4mm1patchset:414Klines,13MBdiff

Copyright2005RandyDunlap,Allrightsreserved.20

Topics Opensourcedevelopmentstyle,values,culture Linuxrapiddevelopmentcycle Linuxmaintainersandhierarchy Communicationsmethods Advantagesofhavingadriverinthemainlinekerneltree Codingstyle HowtosubmitLinuxkernelpatches Somebestknownpractices Legal/Licenses Testing WorkingintheLinuxkerneltree

Copyright2005RandyDunlap,Allrightsreserved.21

MaintainersandHierarchy

Loosehierarchywithbenevolentdictator Kernelseriesmaintainers(2.6)LinusandAndrewMorton Patch(stable)maintainers(2.6.x.y)GregKroahHartmanand

ChrisWright Toplevelmaintainersaregatekeepers,integrators,tiebreakersor

overrulerswhenneeded Delegatetolieutenantsandindividualmaintainers;sharetheload Strongtrustsystem>beginwithsmallpatchesforcredibility Maintainersdon'thaveabsoluteauthority

Copyright2005RandyDunlap,Allrightsreserved.22

Maintainers&Hierarchy(2)

KernelJanitors,securitykernels,someembeddedsupport Archandsubsystemmaintainers:coordinatesubsystemsand

maintainconsistency Drivermaintainers:coverallcurrentmainlinekernelsandupdateto

newkernelAPIs,evendevelopmentAPIs Seefiles:linux/MAINTAINERSandlinux/CREDITS

Copyright2005RandyDunlap,Allrightsreserved.23

Communications Communicatingishard,let'sgoshopping Writingideas/thoughtsdownisgood(buttoowordymaybeignored) Participateconstructively Mailinglists&archives(newsgroups) Workinginopen/public(technicalreaders/writers)vs.

embarrassment Discussionanddecisionsonlists,nomeetingsrequired Workthroughconcensus(withexceptions) Projectwebpages,IRCchannels Developerconferences

Copyright2005RandyDunlap,Allrightsreserved.24

MailingListEtiquette UseReplytoAll,threaded(MessageID,References)

>>TryAorB. >IpreferA,soundOK? yes

Bepromptwithreplies(beingresponsiveisimportant) Noencodedorzippedattachments(inlinepreferred,text/plain

attachmentsOK);othersareoftenignored NoHTMLorcommercialemail,noautoreplies(OOO/vacation) ALLCAPS==SHOUTING Use

Copyright2005RandyDunlap,Allrightsreserved.25

MailingListEtiquette(2)

Keepittechnicalandprofessional.Ifattacked(flamed),stickwithtechnicalpoints,don'tgetinvolvedwithattacks,&moveon.

Trimreplies(body)torelevantbits(don'tmodifyrecipientlist). Don'tcrossposttoclosedmailinglists. NonEnglishspeakers http://www.arm.linux.org.uk/armlinux/mletiquette.php RFC1855:NetiquetteGuidelines:http://www.ietf.org/rfc/rfc1855.txt

Copyright2005