Files
oldlinux-files/docs/kernelhacking-HOWTO/indexs04.html
2024-02-19 00:23:35 -05:00

108 lines
5.0 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
<title>Source Tour</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.40">
<link rel="home" href="index.html" title="Kernel Hacking HOWTO">
<link rel="up" href="index.html" title="Kernel Hacking HOWTO">
<link rel="previous" href="indexs03.html" title="Linux Kernel Overview">
<link rel="next" href="indexs05.html" title="Tools">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr><th colspan="3" align="center">Source Tour</th></tr>
<tr>
<td width="20%" align="left">
<a href="indexs03.html">Prev</a> </td>
<th width="60%" align="center"> </th>
<td width="20%" align="right"> <a href="indexs05.html">Next</a>
</td>
</tr>
</table>
<hr>
</div>
<div class="sect1">
<a name="sourcetour"></a><div class="titlepage"><div><h2 class="title" style="clear: both">
<a name="sourcetour"></a>Source Tour</h2></div></div>
<p>The kernel source is made up of around two million lines of code. While that may seem intimidating, it is important to remember that very few people understand all the subsystems and associated source code in depth. You can improve your programming productivity if you know where to look for specific code, down to a directory and a source file.</p>
<div class="sect2">
<a name="whatgoeswhere"></a><div class="titlepage"><div><h3 class="title">
<a name="whatgoeswhere"></a>What goes where</h3></div></div>
<p>Fortunately, the source is well organised into a logical directory structure. This section gives a quick guide to the top level kernel source directory:</p>
<div class="itemizedlist"><ul>
<li><p>
<a name="id46571473"></a><tt>Documentation</tt>: Information about specific platforms &amp; devices as well as general kernel information.</p></li>
<li><p>
<a name="id46571466"></a><tt>arch</tt>: Architecture specific code; i386, sparc etc.</p></li>
<li><p>
<a name="id46571489"></a><tt>drivers</tt>: Device specific code; sound card, network card etc.</p></li>
<li><p>
<a name="id46571496"></a><tt>fs</tt>: Filesystem specific code; ext2, vfat etc.</p></li>
<li><p>
<a name="id46571504"></a><tt>include</tt>: Kernel header files.</p></li>
<li><p>
<a name="id46571511"></a><tt>init</tt>: All the code associated with the boot and initialisation process.</p></li>
<li><p>
<a name="id46571518"></a><tt>IPC</tt>: Inter Process Communication code; shared memory implementation etc.</p></li>
<li><p>
<a name="id46571525"></a><tt>kernel</tt>: The core kernel code; scheduling, signals etc.</p></li>
<li><p>
<a name="id46571533"></a><tt>libs</tt>: Kernel related libraries; image decompression etc.</p></li>
<li><p>
<a name="id46571540"></a><tt>mm</tt>: Memory Management related code.</p></li>
<li><p>
<a name="id46571547"></a><tt>net</tt>: Network related code.</p></li>
<li><p>
<a name="id46571554"></a><tt>scripts</tt>: kernel related scripts (e.g. patch-kernel)</p></li>
</ul></div>
</div>
<div class="sect2">
<a name="keydatastructures"></a><div class="titlepage"><div><h3 class="title">
<a name="keydatastructures"></a>Key data structures</h3></div></div>
<p>This section gives a quick guide to some of the fundamental data structures, including key fields and where to find them in the kernel source tree.</p>
<div class="sect3">
<a name="processdescriptor"></a><div class="titlepage"><div><h4 class="title">
<a name="processdescriptor"></a>Process descriptor</h4></div></div>
<p>Process Descriptor: <tt>task_struct</tt>: <tt>~/include/linux/sched.h:281</tt>
</p>
</div>
<div class="sect3">
<a name="pagedescriptor"></a><div class="titlepage"><div><h4 class="title">
<a name="pagedescriptor"></a>Page descriptor</h4></div></div>
<p>Page Descriptor:</p>
</div>
</div>
<div class="sect2">
<a name="startingpoints"></a><div class="titlepage"><div><h3 class="title">
<a name="startingpoints"></a>Starting Points</h3></div></div>
<p>This section will present a selection of good starting points for reading and understanding the kernel source code.</p>
</div>
<div class="sect2">
<a name="srctouryourturn"></a><div class="titlepage"><div><h3 class="title">
<a name="srctouryourturn"></a>Your Turn</h3></div></div>
<p>Find and read the driver code for some of the devices in your system.</p>
<p>Take a look at the <tt>Makefiles</tt> and see if you can figure out how the build process works. See <tt>Documentation/kbuild/makefiles.txt</tt> for help.</p>
</div>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a href="indexs03.html">Prev</a> </td>
<td width="20%" align="center"><a href="index.html">Home</a></td>
<td width="40%" align="right"> <a href="indexs05.html">Next</a>
</td>
</tr>
<tr>
<td width="40%" align="left">Linux Kernel Overview </td>
<td width="20%" align="center"><a href="index.html">Up</a></td>
<td width="40%" align="right"> Tools</td>
</tr>
</table>
</div>
</body>
</html>