SlideShare ist ein Scribd-Unternehmen logo
1 von 2
Downloaden Sie, um offline zu lesen
Linux Training
                                                     Lab Book



Kernel source code
Objective: Get familiar with the kernel source code.



After this lab, you will be able to
   Explore the sources in search for files, function headers or other
   kinds of information...
   Browse the kernel sources with tools like cscope and LXR.

Setup
Go to the /home/<user>/felabs/linux/sources directory.
Download the Linux 2.6.35 kernel sources from http://kernel.org.                 Please use this exact version, and not
                                                                                 2.6.35.x updates. Doing this will keep
Get familiar with the sources                                                    it easy to upgrade to 2.6.36 in the
                                                                                 next lab.
As a Linux kernel user, you will very often need to find which file
implements a given function. So, it is useful to be familiar with
exploring the kernel sources.
1. Find the Linux logo image in the sources                                      You may look for all files with logo in
                                                                                 their name.
2. Find who the maintainer of the 3C505 network driver is.
3. Find the declaration of the platform_device_register() 
   function.

Use a kernel source indexing tool
Now that you know how to do things in a manual way, let's use
more automated tools.
                                                                                 Of course, if your kernel has a
Try LXR (Linux Cross Reference) at http://lxr.free-electrons.com                 significant amount of custom code, or
and choose the Linux version closest to yours.                                   if you are not always connected to
                                                                                 the Internet, you can run LXR on
If you don't have Internet access, you can use cscope or Kscope                  your own computer.
instead.
As in the previous section, use this tool to find where the
platform_device_register() is declared, implemented and even
used.

Accessing kernel sources with git
Later this week, we will also see another way of accessing kernel
sources, with the git source control management tool used by
kernel developers.
To save time with the git lab on the last day, let's advance us by
cloning the Linus Torvalds' git tree.
First, install required software packages:
sudo apt­get install git­core gitk git­email
Then, go to the /home/<user>/felabs/linux/git directory, and
run the below command:
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux­2.6.git
                                                                                 Replace git:// by http:// if your
Now, just let this command run, from 30 minutes to several hours                 company firewall blocks the git
according to your workstation and network speed.                                 protocol.




              © 2004-2010 Free Electrons, http://free-electrons.com              Creative Commons License
Linux Training
                                 Lab book




© 2004-2010 Free Electrons, http://free-electrons.com   Creative Commons License

Weitere ähnliche Inhalte

Mehr von gowell (10)

Lua 语言介绍
Lua 语言介绍Lua 语言介绍
Lua 语言介绍
 
Kernel init
Kernel initKernel init
Kernel init
 
Logging develop
Logging developLogging develop
Logging develop
 
Logging introduce
Logging introduceLogging introduce
Logging introduce
 
Script meta
Script metaScript meta
Script meta
 
Script binding
Script bindingScript binding
Script binding
 
使用Lua提高开发效率
使用Lua提高开发效率使用Lua提高开发效率
使用Lua提高开发效率
 
Casing3d opengl
Casing3d openglCasing3d opengl
Casing3d opengl
 
Pytables
PytablesPytables
Pytables
 
从动态说开去
从动态说开去从动态说开去
从动态说开去
 

Kürzlich hochgeladen

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Kürzlich hochgeladen (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

Kernel sources-lab

  • 1. Linux Training Lab Book Kernel source code Objective: Get familiar with the kernel source code. After this lab, you will be able to Explore the sources in search for files, function headers or other kinds of information... Browse the kernel sources with tools like cscope and LXR. Setup Go to the /home/<user>/felabs/linux/sources directory. Download the Linux 2.6.35 kernel sources from http://kernel.org. Please use this exact version, and not 2.6.35.x updates. Doing this will keep Get familiar with the sources it easy to upgrade to 2.6.36 in the next lab. As a Linux kernel user, you will very often need to find which file implements a given function. So, it is useful to be familiar with exploring the kernel sources. 1. Find the Linux logo image in the sources You may look for all files with logo in their name. 2. Find who the maintainer of the 3C505 network driver is. 3. Find the declaration of the platform_device_register()  function. Use a kernel source indexing tool Now that you know how to do things in a manual way, let's use more automated tools. Of course, if your kernel has a Try LXR (Linux Cross Reference) at http://lxr.free-electrons.com significant amount of custom code, or and choose the Linux version closest to yours. if you are not always connected to the Internet, you can run LXR on If you don't have Internet access, you can use cscope or Kscope  your own computer. instead. As in the previous section, use this tool to find where the platform_device_register() is declared, implemented and even used. Accessing kernel sources with git Later this week, we will also see another way of accessing kernel sources, with the git source control management tool used by kernel developers. To save time with the git lab on the last day, let's advance us by cloning the Linus Torvalds' git tree. First, install required software packages: sudo apt­get install git­core gitk git­email Then, go to the /home/<user>/felabs/linux/git directory, and run the below command: git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux­2.6.git Replace git:// by http:// if your Now, just let this command run, from 30 minutes to several hours company firewall blocks the git according to your workstation and network speed. protocol. © 2004-2010 Free Electrons, http://free-electrons.com Creative Commons License
  • 2. Linux Training Lab book © 2004-2010 Free Electrons, http://free-electrons.com Creative Commons License