Subject: Re: chap-kernel fixes
To: Pavel Cahyna <pavel.cahyna@st.cuni.cz>
From: Daniel de Kok <danieldk@pobox.com>
List: netbsd-docs
Date: 08/14/2004 17:13:18
--NzB8fVQJ5HfG6fxh
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
On Fri, Aug 13, 2004 at 07:09:17PM +0200, Pavel Cahyna wrote:
> the section about modifying kernel sources looks a bit scary here, and
> also unprofessional (if the modification is so desirable, why hasn't
> it been integrated already?). Maybe it should be moved to the chapter
> about wscons?
I agree this fits better in chap-wscons, so it is probably better to
remove it for now to avoid confusion.
> > + The <filename>adjustkernel</filename> Perl script, which is
>
> I don't know almost anything about Docbook, but why <filename> here
> and <command> a few lines lower?
Sorry, my bad.
> Also, the table which gives kernel compile times on various hardware
> seems really too optimistic.
Yep, it is probably based on NetBSD 1.4.x.
Thanks for the feedback, I have attached an updated patch.
Any comments?
--
Daniel de Kok <danieldk@pobox.com>
--NzB8fVQJ5HfG6fxh
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="chap-kernel.xml.diff"
Index: chap-kernel.xml
===================================================================
RCS file: /cvsroot/htdocs/guide/en/chap-kernel.xml,v
retrieving revision 1.9
diff -b -u -r1.9 chap-kernel.xml
--- chap-kernel.xml 20 May 2004 03:09:14 -0000 1.9
+++ chap-kernel.xml 14 Aug 2004 15:06:46 -0000
@@ -42,131 +42,35 @@
<title>Installing the kernel sources</title>
<sidebar>
- <para>You can get the kernel sources from AnonCVS, see
- <xref linkend="chap-cvs" />.</para>
+ <para>
+ You can get the kernel sources from AnonCVS (see
+ <xref linkend="chap-cvs" />), or from the
+ <filename>syssrc.tgz</filename>
+ tarball that is located in the <filename>source/sets/</filename>
+ directory of the release that you are using. If you use the second
+ method, you can extract the tarball as root:
+ </para>
</sidebar>
- <para>Be patient: this operation lasts many minutes, because the repository
- contains hundreds of files.
- The sources live in <filename>/usr/src/sys</filename>; the
- symbolic link <filename>sys</filename> points to this directory.
- Therefore the following commands have the same effect:</para>
+ <screen>
+&rprompt; <userinput>cd /</userinput>
+&rprompt; <userinput>tar zxf /path/to/syssrc.tgz</userinput>
+ </screen>
- <screen>&rprompt; <userinput>cd /usr/src/sys</userinput>
-&rprompt; <userinput>cd /sys</userinput></screen>
+ <para>
+ If you chose to use AnonCVS, be patient, the operation can last
+ many minutes, because the repository contains hundreds of files.
+ </para>
- <para>Once the sources are checked out, you can create a custom kernel: this
- is not as difficult as you think.
+ <para>
+ Once you have the sources available, you can create a custom kernel:
+ this is not as difficult as you might think.
In fact, a new kernel can be created in a few steps
which will be described in the following sections.</para>
</sect1>
<!-- ============================================================= -->
- <sect1 id="chap-kernel-italian-keyboard">
- <title>Italian keyboard layout</title>
-
- <para>Before compiling the kernel, Italian users should consider modifying
- the predefined layout for the italian keyboard, which is defined in the
- source file <filename>/sys/dev/pckbc/wskbdmap_mfii.c</filename>.
- In the default layout some characters useful for programmers are
- missing (for example, left and right braces and tilde).
- This is an alternative layout:</para>
-
- <programlisting>static const keysym_t pckbd_keydesc_it[] = {
-...
-KC(8), KS_7, KS_slash, KS_braceleft,
-KC(9), KS_8, KS_parenleft, KS_bracketleft,
-KC(10), KS_9, KS_parenright, KS_bracketright,
-KC(11), KS_0, KS_equal, KS_braceright,
-KC(12), KS_apostrophe, KS_question, KS_grave,
-KC(13), KS_igrave, KS_asciicircum, KS_asciitilde,
-KC(26), KS_egrave, KS_eacute, KS_bracketleft, KS_braceleft,
-KC(27), KS_plus, KS_asterisk, KS_bracketright,KS_braceright,
-...</programlisting>
-
- <para>The previous layout defines the following mappings:</para>
-
- <informaltable>
- <tgroup cols="2">
- <colspec align="center" colwidth="1.5in" />
- <colspec align="center" colwidth="1.5in" />
-
- <thead>
- <row>
- <entry>Keys</entry>
- <entry>Character</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>Alt Gr + 7</entry>
- <entry>{</entry>
- </row>
-
- <row>
- <entry>Alt Gr + 8</entry>
- <entry>[</entry>
- </row>
-
- <row>
- <entry>Alt Gr + 9</entry>
- <entry>]</entry>
- </row>
-
- <row>
- <entry>Alt Gr + 0</entry>
- <entry>}</entry>
- </row>
-
- <row>
- <entry>Alt Gr + '</entry>
- <entry>`</entry>
- </row>
-
- <row>
- <entry>Alt Gr + ì</entry>
- <entry>~</entry>
- </row>
-
- <row>
- <entry>Alt Gr + é</entry>
- <entry>[</entry>
- </row>
-
- <row>
- <entry>Alt Gr + +</entry>
- <entry>]</entry>
- </row>
-
- <row>
- <entry>Shift + Alt Gr + è</entry>
- <entry>{</entry>
- </row>
-
- <row>
- <entry>Shift + Alt Gr + +</entry>
- <entry>}</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
-
- <note>
- <title>Console driver</title>
-
- <para>starting with version 1.4, &os; uses the
- <application>wscons</application> multiplatform console driver to
- handle screen, keyboard and mouse.
- Previous versions used <application>pccons</application> or
- <application>pcvt</application>.
- For a detailed description, see <xref linkend="chap-cons" />.</para>
- </note>
- </sect1>
-
- <!-- ============================================================= -->
-
<sect1 id="chap-kernel-recompiling-kernel">
<title>Recompiling the kernel</title>
@@ -187,10 +91,6 @@
<title>Basic steps for kernel compilation</title>
<step>
- <para>Build the toolchain</para>
- </step>
-
- <step>
<para>Create/modify the kernel configuration file</para>
</step>
@@ -214,23 +114,6 @@
<!-- ============================================================= -->
- <sect1 id="chap-kernel-build-toolchain">
- <title>Build the toolchain</title>
-
- <para>The &os; toolchain provides a simple mechanism for compiling
- the &os; system both natively or when the need arises, cross
- compiling for other targets. In this example, a native toolchain
- is built (as <username>root</username>) by simply typing:</para>
-
- <screen>&rprompt; <userinput>cd /usr/src</userinput>
-&rprompt; <userinput>./build.sh tools</userinput></screen>
-
- <para>Once the tools are built, the kernel can be reconfigured
- and compiled.</para>
- </sect1>
-
- <!-- ============================================================= -->
-
<sect1 id="chap-kernel-creating-kernel-configfile">
<title>Creating the kernel configuration file</title>
@@ -244,14 +127,14 @@
characteristics of the devices supported by the kernel as well as
several kernel configuration options.
Kernel configuration files are located in the
- <filename>/sys/arch/i386/conf</filename> directory.
+ <filename>/usr/sys/arch/i386/conf</filename> directory.
The easiest way to create a new file is to copy an existing one
and modify it: usually the best choice on most platforms is the
GENERIC configuration.
In the configuration file there are comments describing the options; a
more detailed description is found in the &man.options.4; man page.</para>
- <screen>&rprompt; <userinput>cd /sys/arch/i386/conf/</userinput>
+ <screen>&rprompt; <userinput>cd /usr/src/sys/arch/i386/conf/</userinput>
&rprompt; <userinput>cp GENERIC <replaceable>MYKERNEL</replaceable></userinput>
&rprompt; <userinput>vi <replaceable>MYKERNEL</replaceable></userinput></screen>
@@ -313,31 +196,32 @@
...
options PCKBD_LAYOUT="KB_IT"</programlisting>
- <para>The <filename>adjustkernel</filename> Perl script, which can be
- found at <ulink url="http://www.feyrer.de/Misc/adjustkernel"></ulink>,
- analizes the output of &man.dmesg.8; and
+ <para>
+ The <command>adjustkernel</command> Perl script, which is
+ available through pkgsrc analyzes the output of &man.dmesg.8; and
automatically generates a minimal configuration file.
- To run it you need to have Perl installed on your system.
- The installation of new software is described in detail
- in the <xref linkend="chap-pack" />.
- If you want to install Perl now, download the pre-compiled package
- <filename>perl-5.00404.tgz</filename> and write the following command:</para>
-
- <screen>&rprompt; <userinput>pkg_add perl-5.00404.tgz</userinput></screen>
+ The installation of packages is described extensively in
+ in the <xref linkend="chap-pack" />, but installing
+ <command>adjustkernel</command> basically boils down to:
+ </para>
- <para>Now Perl is installed, configured and ready to work: easier than this
- it's impossible...</para>
+ <screen>
+&rprompt; <userinput>cd /usr/pkgsrc/sysutils/adjustkernel</userinput>
+&rprompt; <userinput>make install</userinput
+ </screen>
<para>You can now run the script with:</para>
<screen>&rprompt; <userinput>cd /sys/arch/i386/conf</userinput>
-&rprompt; <userinput>perl adjustkernel GENERIC > <replaceable>MYKERNEL</replaceable></userinput></screen>
+&rprompt; <userinput>adjustkernel GENERIC > <replaceable>MYKERNEL</replaceable></userinput>
+ </screen>
- <para>I tried this script and it worked very well, saving me a lot of manual
+ <para>
+ This script usually works very well, saving a lot of manual
editing.
- Beware that the script only configures the available devices: you
- must still configure manually the other options (e.g. Linux emulation,
- ...)</para>
+ But be aware that the script only configures the available devices: you
+ must still configure the other options manually.
+ </para>
</sect1>
<!-- ============================================================= -->
@@ -376,53 +260,10 @@
chips): the compilation puts a higher stress on the system than most
applications do.
Another typical error is the following: option B, active, requires
- option A which is not active.</para>
-
- <para>A full compilation of the kernel can last from some minutes to several
+ option A which is not active.
+ A full compilation of the kernel can last from some minutes to several
hours, depending on the hardware.
- See the following table for some examples:</para>
-
- <informaltable>
- <tgroup cols="3">
- <colspec colwidth="1.5in" />
- <colspec colwidth="1in" />
- <colspec colwidth="1.5in" />
-
- <thead>
- <row>
- <entry>CPU</entry>
- <entry>RAM (MB)</entry>
- <entry>Approx. time</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>486 DX2 50</entry>
- <entry>20</entry>
- <entry>1 hour</entry>
- </row>
-
- <row>
- <entry>P166</entry>
- <entry>96</entry>
- <entry>15 minutes</entry>
- </row>
-
- <row>
- <entry>PIII</entry>
- <entry>128</entry>
- <entry>5 minutes</entry>
- </row>
-
- <row>
- <entry>68030/25</entry>
- <entry>8</entry>
- <entry>4 hours</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
+ </para>
<para>The output of the make command is the <filename>netbsd</filename> file
in the compile directory: this file should be copied in the root
--NzB8fVQJ5HfG6fxh--