Difference between revisions of "Custom Linux Kernel Development"

From wiki.emacinc.com
Jump to: navigation, search
(added table of source structure)
m (sorted table)
Line 29: Line 29:
 
| <code>arch</code> || Architecture-specific kernel code with subdirectories for each architecture
 
| <code>arch</code> || Architecture-specific kernel code with subdirectories for each architecture
 
|-
 
|-
| <code>include</code> || Include (header) files required to build the kernel code
+
| <code>block</code> || Block device driver code
 
|-
 
|-
| <code>init</code> || Kernel initialization code
+
| <code>crypto</code> || Encryption support algorithms
 
|-
 
|-
| <code>mm</code> || Memory management code
+
| <code>Documentation</code> || Text documentation files on the kernel and APIs
 
|-
 
|-
 
| <code>drivers</code> || Device driver code, with a subdirectory structure for each device type
 
| <code>drivers</code> || Device driver code, with a subdirectory structure for each device type
 
|-
 
|-
| <code>ipc</code> || Interprocess communications code
+
| <code>firmware</code> || Code for building firmware required to communicate with devices
 
|-
 
|-
 
| <code>fs</code> || File systems code
 
| <code>fs</code> || File systems code
 +
|-
 +
| <code>include</code> || Include (header) files required to build the kernel code
 +
|-
 +
| <code>init</code> || Kernel initialization code
 +
|-
 +
| <code>ipc</code> || Interprocess communications code
 
|-
 
|-
 
| <code>kernel</code> || Main internal kernel code
 
| <code>kernel</code> || Main internal kernel code
|-
 
| <code>net</code> || Kernel networking code
 
 
|-
 
|-
 
| <code>lib</code> || Library code
 
| <code>lib</code> || Library code
 
|-
 
|-
| <code>scripts</code> || Various scripts used for the configuration and build process as well as standalone utility scripts
+
| <code>mm</code> || Memory management code
 
|-
 
|-
| <code>block</code> || Block device driver code
+
| <code>net</code> || Kernel networking code
 
|-
 
|-
| <code>firmware</code> || Code for building firmware required to communicate with devices
+
| <code>samples</code> || Code examples and drivers that have not been fully developed
 
|-
 
|-
| <code>samples</code> || Code examples and drivers that have not been fully developed
+
| <code>scripts</code> || Various scripts used for the configuration and build process as well as standalone utility scripts
 
|-
 
|-
| <code>virt</code> || Virtualization support code
+
| <code>security</code> || Kernel security support
 
|-
 
|-
 
| <code>sound</code> || Sound and audio driver code
 
| <code>sound</code> || Sound and audio driver code
|-
 
| <code>crypto</code> || Encryption support algorithms
 
|-
 
| <code>security</code> || Kernel security support
 
 
|-
 
|-
 
| <code>usr</code> || Code used during kernel image creation
 
| <code>usr</code> || Code used during kernel image creation
 
|-
 
|-
| <code>Documentation</code> || Text documentation files on the kernel and APIs
+
| <code>virt</code> || Virtualization support code
 
|-
 
|-
 
|}
 
|}

Revision as of 17:39, 29 December 2013

TODO: {{#todo:Write this|Travis Stratman|oe 5,TS,NotStarted}}

The ability to easily customize and expand any portion of the kernel is a feature of Linux that makes it very well suited for embedded systems development. In the embedded environment, specialized hardware, protocols, and systems may require a look into the kernel internals, custom configuration, feature additions, or driver development. This article aims to provide information on the most common kernel development tasks for EMAC OE Linux systems. In addition, the reader is pointed to additional sources for kernel development resources.

Before continuing, make sure that git tools are installed on your development machine, and review the Building the Linux Kernel document.

The Kernel Source

Source code for EMAC kernels is provided through our Git server. Refer to the documentation for your system to determine the correct source to use.

Clone the Git Repository

To clone the git repository over anonymous HTTP, run the following commands:

developer@ldc:~$ git clone http://git.emacinc.com/public/source/linux-2.6.30-at91.git

Once the command has completed, the entire source should be contained in the linux-2.6.30-at91 directory. The master branch will be checked out automatically. Because EMAC uses the master branch for all releases, this is the correct branch to use, but other branches or tags may be checked out if directed or required.

Kernel Source Structure

Within the kernel source tree that was downloaded, you will see several directories. Table 1 gives a brief description of each of these directories.

Directory name Description
arch Architecture-specific kernel code with subdirectories for each architecture
block Block device driver code
crypto Encryption support algorithms
Documentation Text documentation files on the kernel and APIs
drivers Device driver code, with a subdirectory structure for each device type
firmware Code for building firmware required to communicate with devices
fs File systems code
include Include (header) files required to build the kernel code
init Kernel initialization code
ipc Interprocess communications code
kernel Main internal kernel code
lib Library code
mm Memory management code
net Kernel networking code
samples Code examples and drivers that have not been fully developed
scripts Various scripts used for the configuration and build process as well as standalone utility scripts
security Kernel security support
sound Sound and audio driver code
usr Code used during kernel image creation
virt Virtualization support code


Configuration

Refer to configuration section in the kernel building document. Show how to add / remove options in the config.

Adding Support for a new Carrier Board

Show how to add a carrier board in the 2.6.30 "emac-carrier" structure.

Driver Development

Basic info on driver structure here.

Licensing

Where to go for Additional Information

LDD3, mailing list, EMAC support.