Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
linux_ws_20121201_pub.pdf
Search
DeepTokikane
December 08, 2012
0
22
linux_ws_20121201_pub.pdf
DeepTokikane
December 08, 2012
Tweet
Share
More Decks by DeepTokikane
See All by DeepTokikane
Raspberry pi のベンチマークでハマった話 ~Raspberry pi の設定とメモリ性能について~
deeptokikane
0
510
Featured
See All Featured
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
We Have a Design System, Now What?
morganepeng
51
7.3k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
The Cult of Friendly URLs
andyhume
78
6.1k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
Writing Fast Ruby
sferik
627
61k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Fireside Chat
paigeccino
34
3.1k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
1
150
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
900
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Designing Experiences People Love
moore
138
23k
Transcript
. .. . . . . LinuxΧʔωϧΛಡ͏(ಋೖฤ) DeepTokikane 2012 12݄
1 DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄ 1 1 / 47
͕LinuxΧʔωϧΛಡΈ࢝Ί͖͔͚ͨͬ େֶͰOS ͷݚڀ ಡΈ࢝Ίͨͷ4 ੜʹͳ͔ͬͯΒ (ͭ·Γࠓͷ4 ݄͔Β) DeepTokikane () Linux
ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄ 1 2 / 47
࣍ ͡Ίʹ Linux ͷιʔείʔυΛೖख ιʔείʔυΛಡΉͨΊͷπʔϧ Ϗϧυ&Πϯετʔϧ ࣮ࡍʹ৮ͬͯΈΔ printk ͷվ Φεεϝॻ੶
DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄ 1 3 / 47
࣍ ͡Ίʹ Linux ͷιʔείʔυΛೖख ιʔείʔυΛಡΉͨΊͷπʔϧ Ϗϧυ&Πϯετʔϧ ࣮ࡍʹ৮ͬͯΈΔ printk ͷվ Φεεϝॻ੶
DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄ 1 4 / 47
LinuxΧʔωϧΛಡΉϝϦοτ(1/2) Ұ͜ΜͳٙΛ࣋ͪ·͢ΑͶ? ίϯϐϡʔλͬͯͲ͏ͬͯಈ͘ͷ? Χʔωϧ = ίϯϐϡʔλΛಈ࡞ͤ͞ΔͨΊͷ ιϑτ ΣΞ DeepTokikane ()
Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄ 1 5 / 47
LinuxΧʔωϧΛಡΉϝϦοτ(2/2) ΧʔωϧͷιʔείʔυΛಡΉ ίϯϐϡʔλͷಈ࡞Λ࣮ࡍʹίʔυͰݟΕΔ DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012
12 ݄ 1 6 / 47
ඞཁͳࣝ C ݴޠ Linux Χʔωϧ C ݴޠͰॻ͔Ε͍ͯΔ Ξηϯϒϥ ϋʔυΣΞͷ༷ ӳޠ
DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄ 1 7 / 47
Linuxͷ։ൃঢ়گ Linux ͷ։ൃMain Line ͱStable ͰΘ͔Ε ͍ͯΔɽ Main Line ৽ػೳΛՃͯ͠ϦϦʔε͢Δ
Stable ϝΠϯϥΠϯͰϦϦʔε͞Εͨͷͷ҆ఆ൛Λ։ൃ όάमਖ਼ͳͲΛͯ͠ϦϦʔε DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄ 1 8 / 47
ϝΠϯϥΠϯͷϦϦʔε(1/2) 2.6.32 2009/12/03 2.6.33 2010/02/24 2.6.34 2010/05/16 2.6.35 2010/08/01 2.6.36
2010/10/20 2.6.37 2011/01/05 2.6.38 2011/03/15 2.6.39 2011/05/19 DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄ 1 9 / 47
ϝΠϯϥΠϯͷϦϦʔε(2/2) 3.0 2011/07/22 3.1 2011/10/24 3.2 2012/01/04 3.3 2012/03/18 3.4
2012/05/20 3.5 2012/07/21 3.6 2012/09/30 DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄ 1 10 / 47
࣍ ͡Ίʹ Linux ͷιʔείʔυΛೖख ιʔείʔυΛಡΉͨΊͷπʔϧ Ϗϧυ&Πϯετʔϧ ࣮ࡍʹ৮ͬͯΈΔ printk ͷվ Φεεϝॻ੶
DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄ 1 11 / 47
LinuxΧʔωϧͷιʔείʔυͷೖख Linux Χʔωϧͷιʔείʔυόʔδϣ ϯཧπʔϧͷ Git Ͱཧ͞Ε͍ͯΔɽ Git ΛͬͯɼιʔείʔυΛखʹೖΕΔɽ DeepTokikane ()
Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄ 1 12 / 47
GitͷΠϯετʔϧ Ubuntu ͷ߹ apt-get install git Mac ͷ߹ ݩ͔ΒೖͬͯΔ Widows
ͷ߹ Linux ΛΠϯετʔϧ͠·͠ΐ͏ (݁ߏେมͩͬͨ) DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄ 1 13 / 47
GitͰιʔείʔυΛೖख Ϋϩʔϯ git clone <ϦϙδτϦͷURL> νΣ οΫΞτ git checkout v3.6
(όʔδϣϯ3.6 ϦϦʔε࣌ͷιʔείʔ υʹ͢Δɽ) DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄ 1 14 / 47
࣍ ͡Ίʹ Linux ͷιʔείʔυΛೖख ιʔείʔυΛಡΉͨΊͷศརπʔϧ GNU Global Ϗϧυ&Πϯετʔϧ ࣮ࡍʹ৮ͬͯΈΔ printk
ͷվ Φεεϝॻ੶ DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄ 1 15 / 47
GNU Global ιʔείʔυղੳπʔϧ ରԠݴޠ C/C++ Yacc Java PHP4 Ξηϯϒϥ େنͳιϑτΣΞͷιʔείʔυΛ
ಡΉͱ͖ʹҖྗΛൃش HTML ܗࣜͰग़ྗͯ͠ɼϒϥβͰίʔ υΛಡΉ͜ͱՄೳ DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄ 1 16 / 47
GNU GlobalͷΠϯετʔϧ sudo apt-get install global DeepTokikane () Linux ΧʔωϧΛಡ͏
(ಋೖฤ) 2012 12 ݄ 1 17 / 47
Globalͷ͍ํ(ͬ͘͟Γ) GTAGS ϑΝΠϧΛ࡞Δɽ ͦͷޙGTAGS ϑΝΠϧΛղੳ͢Δ DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ)
2012 12 ݄ 1 18 / 47
GTAGSϑΝΠϧͷ࡞ ղੳ͍ͨ͠ιʔείʔυͷϧʔτσΟϨ ΫτϦͰҎԼͷίϚϯυ gtags -v ݁ߏ͔͔࣌ؒΔ ग़ྗϑΝΠϧͷ༰ྔେ͖͍ -v Φϓγϣϯ ్தܦաΛදࣔ͢ΔΦϓγϣϯ
DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄ 1 19 / 47
HTMLܗࣜͰग़ྗ ղੳ͢ΔιʔείʔυͷϧʔτσΟϨΫ τϦͰҎԼͷίϚϯυΛୟ͘ htags -afFnvsx ͔ͳΓ͕͔͔࣌ؒΔ ग़ྗϑΝΠϧͷ༰ྔ͔ͳΓେ͖͍ DeepTokikane () Linux
ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄ 1 20 / 47
Φϓγϣϯʹ͍ͭͯ -a ΞϧϑΝϕοτॱʹฒΔ -f ݕࡧϑΥʔϜΛ࡞Δ -F ϑϨʔϜΛ࡞Δ -n ߦ൪߸Λ͚ͭΔ -s
γϯϘϧʹϦϯΫΛషΔ -v ్தܦաΛදࣔ -x xml ܗࣜͰग़ྗ DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄ 1 21 / 47
ऴΘͬͨΒ HTML/index.html ΛϒϥβͰ։͘ ͜Μͳײ͡ DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012
12 ݄ 1 22 / 47
ݕࡧ͠Α͏ͱ͢Δͱ. . . DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012
12 ݄ 1 23 / 47
ݕࡧ͢Δʹ ݕࡧ͢ΔͨΊʹαʔόΛཱͯͯɼݕࡧ ༻ͷCGI Λಈ͔ͯ͠Βͳ͍ͱ͍͚ͳ͍ ࠓճCGI ͷಈ͔͠ํͷઆ໌ׂѪ DeepTokikane () Linux ΧʔωϧΛಡ͏
(ಋೖฤ) 2012 12 ݄ 1 24 / 47
CGIΛಈ͔͢ͱ. . . DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012
12 ݄ 1 25 / 47
Linux Cross Reference ࣮. . . Linux Cross Reference ͱ͍͏ϖʔδͰϒϥβͰ
ιʔείʔυಡΊΔ GNU Global ΑΓগ͍͠ਏ͍? ͙͢ಡΊΔ DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄ 1 26 / 47
࣍ ͡Ίʹ Linux ͷιʔείʔυΛೖख ιʔείʔυΛಡΉͨΊͷศརπʔϧ GNU Global Ϗϧυ&Πϯετʔϧ ࣮ࡍʹ৮ͬͯΈΔ printk
ͷվ Φεεϝॻ੶ DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄ 1 27 / 47
LinuxΧʔωϧͷϏϧυ ΧʔωϧͷϏϧυҎԼͷखॱͰߦ͏ . . . 1 ΧʔωϧͷઃఆϑΝΠϧΛฤू . . .
2 Ϗϧυ . . . 3 Πϯετʔϧ DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄ 1 28 / 47
ΧʔωϧͷઃఆϑΝΠϧΛฤू cp /boot/config-<όʔδϣϯ໊> . ݱࡏͷઃఆϑΝΠϧΛίϐʔ make menuconfig ઃఆը໘Λ༻͍ͯઃఆ͢Δɽ (libncursu5-lib ͷΠϯετʔϧ͕ඞཁ)
DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄ 1 29 / 47
menucong DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄
1 30 / 47
Ϗϧυ & Πϯετʔϧ make -j8 bzImage #ΧʔωϧͷϏϧυ make modules #ϞδϡʔϧͷϏϧυ
sudo make modules_install #ϞδϡʔϧͷΠϯετʔϧ sudo make install #ΧʔωϧͷΠϯετʔϧ DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄ 1 31 / 47
ىಈ ϒʔτϝχϡʔ͔ΒΠϯετʔϧͨ͠ ΧʔωϧΛબͯ͠ىಈ ىಈͨ͠ޙʹ uname -a ίϚϯυͰόʔ δϣϯΛ֬ೝͰ͖Δɽ DeepTokikane ()
Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄ 1 32 / 47
࣍ ͡Ίʹ Linux ͷιʔείʔυΛೖख ιʔείʔυΛಡΉͨΊͷπʔϧ Ϗϧυ&Πϯετʔϧ ࣮ࡍʹ৮ͬͯΈΔ printk ͷվ Φεεϝॻ੶
DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄ 1 33 / 47
Χʔωϧϝοηʔδ Χʔωϧϝοηʔδ Χʔωϧ͕ग़ྗ͢Δϝοηʔδ (ͦͷ··) ΧʔωϧϝοηʔδΛݟΕΧʔωϧ͕ԿΛͬͯΔ ͷ͔গ͠Θ͔Δ ΧʔωϧϝοηʔδΛݟΔ dmesg ݱࡏͷىಈ͔࣌Βͷϝοηʔδ ͔ׅ͗ހͷதىಈ͔ͯ͠Βͷ࣌ؒ
DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄ 1 34 / 47
ศརͳؔ ΧʔωϧΛվม͢Δ࣌ͷσόοάʹ༗ޮ printk () dump_stack () DeepTokikane () Linux ΧʔωϧΛಡ͏
(ಋೖฤ) 2012 12 ݄ 1 35 / 47
printk () ΧʔωϧϝοηʔδΛग़ྗ Χʔωϧ൛ͷprintf () σόοάϝοηʔδσόοάͷجຊ DeepTokikane () Linux ΧʔωϧΛಡ͏
(ಋೖฤ) 2012 12 ݄ 1 36 / 47
dump_stack () dump_stack () Λݺͼग़͕ͨؔ͠ɼͲͷ ͔ؔΒݺͼग़͞Ε͍ͯΔͷ͔Λελο ΫܗࣜͰදࣔͯ͘͠ΕΔɽ DeepTokikane () Linux
ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄ 1 37 / 47
Linuxͷվ(printkͷվ) ʻඪʼ printk ͷදࣔdeepOS Λ͚Ճ͑Δ DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ)
2012 12 ݄ 1 38 / 47
վม͢ΔॴΛ୳͢ GNU Global Ͱ printk () ͷఆٛΛ୳͢ ݕࡧ͢Δͱෳώοτ͢Δ ্ͷํx86 ܥͰͳ͍ͷແؔ
DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄ 1 39 / 47
ݕࡧ݁Ռ ͜Μͳײ͡ Ұ൪ԼͬΆ͍ DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012
12 ݄ 1 40 / 47
printk ()ͷιʔείʔυ ͜ͷதͰग़ྗॲཧΛͯͦ͠͏ͳؔ vprintf () DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ)
2012 12 ݄ 1 41 / 47
vprintf ()ͷఆٛҰཡ ԼͬΆ͍ DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012
12 ݄ 1 42 / 47
vprintf ()ͷத printk ͰݟΔ࣌ؒදࣔΒ͖͠ϑΥʔϚοτ ͕͋Δ DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ)
2012 12 ݄ 1 43 / 47
Φεεϝॻ੶(1/3) ৄղ Linux Χʔωϧ(ಷث) DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012
12 ݄ 1 44 / 47
Φεεϝॻ੶(2/3) Linux Χʔωϧ2.6 ղಡࣨ DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012
12 ݄ 1 45 / 47
Φεεϝॻ੶(3/3) Linux Χʔωϧղੳೖ DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012
12 ݄ 1 46 / 47
͋Γ͕ͱ͏͍͟͝·ͨ͠ɽ DeepTokikane () Linux ΧʔωϧΛಡ͏ (ಋೖฤ) 2012 12 ݄
1 47 / 47