LDP/LDP/howto/docbook/JavaStation-HOWTO/04_kernel_build_chapter.xml

635 lines
18 KiB
XML

<sect1 id="KernelBuildChapter">
<title>Build Your Kernel</title>
<sect2 id="KernelBuild-BeforeBeginningSection">
<title>Before you begin</title>
<para>
This chapter assumes you wish to compile your own <application>Linux
</application> kernel for the <productname>JavaStation</productname>.
If this is something you can not do, there are sample kernels pointed
to at the end of this chapter.
</para>
<para>
This chapter assumes you already know how to compile
<application>Linux</application> kernels in general, perhaps
on a <acronym>PC</acronym>, a <acronym>SPARC </acronym> server
running <application>Linux</application>, or any of the
other <application>Linux</application> ports. If not, read the
Kernel-HOWTO and the README file of your kernel source.
</para>
<para>
Compiling a kernel for a <productname>JavaStation</productname> is not
much different than compiling a <application>Linux kernel</application>
elsewhere. You just need to know the right options to pick. In general,
you're compiling for a <hardware>Sun4M class architecture</hardware>, and
enabling <productname>JavaStation</productname>-specific options. The
following sections in this chapter will take you through the steps.
</para>
<para>
While it may be possible to compile the <productname>JavaStation</productname>
-enabled kernel on alternate platforms by way of a cross-compiler, this
HOWTO assumes you will do it on a <hardware>Linux/Sparc based server</hardware>
running in 32-bit mode. Cross-compiling will not be covered, and
questions regarding it will not be entertained.
</para>
</sect2>
<sect2 id="KernelBuild-WorkIn32BitModeSection">
<title>Make sure you use 32-bit mode</title>
<para>
When compiling your own <productname>JavaStation</productname>-capable
kernel on a Sun server, you need to make sure the machine you work on is
set to 32-bit mode. So, if you're on an Ultra-class machine, be sure to
first switch to 32-bit mode before you begin compiling.
</para>
<para>
To check what mode you're in, do a <userinput>uname -a</userinput>. If it
says <quote>sparc</quote>, you're in 32-bit mode and don't have to do
anything. If it reports <quote>sparc64</quote>, then you should perform
a <userinput>sparc32 bash</userinput> first to switch to 32-bit mode. A
subsequent <userinput>uname -a</userinput> should reflect the change.
</para>
</sect2>
<sect2 id="KernelBuild-KernelVersionSupportSection">
<title>Supported <application>Linux Kernel</application> Versions</title>
<para>
The kernel source revision you should use depends both on which model of
<productname>JavaStation</productname> you have, and which series
kernel you are using. The current "stable" series of Linux kernels is
2.4.x, but as we will read in a minute, this may not be the best bet
to use.
</para>
<para>
First, a few note on the 2.2.x and 2.3.x series.
<productname>Mr. Coffee</productname> has had kernel support since about
kernel version 2.2.5, and definitely works out of the box with the
<application>RedHat 6.0+/SPARC distribution kernels</application>.
<productname>Krups</productname> support did not work well out of the
box until the latter 2.3.x kernel cycle. Krups support was added
in the early 2.3.x sequence, but the <hardware>MMU</hardware> changes
to the 32-bit <application> SPARC kernel</application> had kept it from
compiling cleanly until later on.
</para>
<para>
Kernels for both Mr. Coffee and Krups compiled cleanly by the HOWTO
author with the Mar. 17, 2000 CVS kernel, and are included in the
Sample Kernels section.<productname>. Krups</productname> support was
backported into the 2.2.x kernels (where x>15). The latest 2.2.x
kernel "should" compile cleanly for the Mr. Coffee and Krups models,
but your mileage may vary.
</para>
<para>
Now onto the 2.4.x series.
</para>
<para>
The only kernel which has been tested and compiles cleanly for Mr. Coffee
and Krups is version 2.4.2. All other versions are broken or require a
patch.
</para>
<para>
The reason for this is that the sparc32 branch of the kernel has not had
an active maintainer for many months. Some are contributing fixes, but
without an active maintainer things go slow.
</para>
<para>
There is another reason to be weary of the 2.4.x series. From 2.4.0 through
2.4.9, the VM of the kernel was found to be inadequate under heavy loads,
and was subsequently replaced in 2.4.10+. This was a big change for the
so-called "stable" series of kernels.
</para>
<para>
To add further insult to injury, there have been security flaws detected
in all of 2.2.x kernel series and up through 2.4.12. This is patched
in pre-2.2.20 and 2.4.12+. As of this writing, 2.4.12+ has not been checked
by the author as functioning on the JavaStations.
</para>
<para>
So basically, it has been a crap-shoot over which kernel to choose.
Try a few until you find one that suits you best.
</para>
<para>
If you can not get a kernel to compile, or wish to avoid the headache or
trying, you may try the samples pointed to by this document.
</para>
</sect2>
<sect2 id="KernelBuild-RequiredKernelConfigOptionsSection">
<title>Required Kernel Configuration Options</title>
<para>
When you do your <userinput>make config</userinput> command to enter the
kernel configuration stage, there are a few things you are required to
enable. Note that the following option names are from a 2.2.x kernel,
and may be slightly different on a 2.4.x series kernel. If in doubt,
check the sample files later in the chapter.
</para>
<para>
For all <productname>JavaStations</productname>, you want to enable
<acronym>PCI</acronym> support:
</para>
<screen>
CONFIG_PCI=y
</screen>
<para>
Don't forget your mouse:
</para>
<screen>
CONFIG_BUSMOUSE=y
CONFIG_SUN_MOUSE=y
</screen>
<para>
You'll want video, done with the <application>Linux framebuffer interface</application>:
</para>
<screen>
CONFIG_FB_TCX=y (for Mr. Coffee)
CONFIG_FB_PCI=y
CONFIG_FB_IGA=y (for Krups/Espresso)
</screen>
<para>
Audio is done with the <hardware>Crystal Audio 4231 chipset</hardware>:
</para>
<screen>
CONFIG_SPARCAUDIO=y
CONFIG_SPARCAUDIO_CS4231=y
</screen>
<para>
Don't forget your network interface:
</para>
<screen>
CONFIG_SUNLANCE=y (Mr. Coffee)
CONFIG_HAPPYMEAL=y (Krups/Espresso)
</screen>
<para>
You'll no doubt need to support a filesystem:
</para>
<screen>
CONFIG_EXT2_FS=y
</screen>
<para>
You'll want <acronym>IP</acronym> autoconfiguration, and
<acronym>RARP</acronym>/<acronym>BOOTP</acronym> support:
</para>
<screen>
CONFIG_IP_PNP=y
CONFIG_IP_PNP_BOOTP=y
CONFIG_IP_PNP_RARP=y
</screen>
<para>
When doing the <quote>NFS-Root</quote> filesystem configuration, you will
need both <acronym>NFS</acronym> and <acronym>NFS</acronym>-Root support:
</para>
<screen>
CONFIG_NFS_FS=y
CONFIG_ROOT_NFS=y
</screen>
<para>
When doing the <quote>Embedded-Root</quote> filesystem, configure both
<acronym>RAM</acronym> disks and <quote>initial ramdisk</quote> support:
</para>
<screen>
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_INITRD=y (for 2.4.x, also configure size of ramdisk)
</screen>
<para>
You can get a working <quote>.config</quote> file which has the required
options set later in this chapter.
</para>
</sect2>
<sect2 id="KernelBuild-EmbeddedRootFSPatchSection">
<title>Necessary Patch for <quote>Embedded-Root</quote> FS Configurations</title>
<para>
If you have decided to go with the <quote>Embedded-Root</quote> filesystem
option, you will want to make a patch to the <acronym>RAM</acronym>disk
driver source first.
</para>
<para>
The default size of a <acronym>RAM</acronym> disk when using the <acronym>RAM
</acronym>disk driver is 4 <acronym>MB</acronym>. Chances are that you will
want an embedded filesystem of more than that size, particularly when you
start thinking about running an <application>X server</application>, or
including a <application>Java</application> runtime.
</para>
<para>
You can do this for 2.2.x kernels by a manual edit yourself, or by using the
patch pointed to below. The change is a one-line edit in the file
&lt;LINUXROOT&gt;/drivers/block/rd.c . Look for a line that says:
</para>
<screen>
int rd_size = 4096; /* Size of the RAM disks */
</screen>
<para>
and change it to the size of the <acronym>RAMdisk</acronym> you wish.
Typically, most embedded systems are under 16 <acronym>MB</acronym>, so
a common edit is to change the line to:
</para>
<screen>
int rd_size = 4 * 4096; /* Size of the RAM disks */
</screen>
<para>
If you can not do this, the patch below makes the edit for you.
</para>
<para>
4MB to 16MB kernel patch file is at:
<ulink
url="http://dubinski-family.org/~jshowto/Files/patches/ramdisk_patch.txt">
http://dubinski-family.org/~jshowto/Files/patches/ramdisk_patch.txt
</ulink>
</para>
<para>
Kernels in the 2.4.x series allow you to select the amount of RAM
as a configuration option. The patch is no longer needed for those
kernels.
</para>
<para>
It should also be noted in this section that there is currently a limit on the
size of <application>Linux</application> boot image for all
<productname>JavaStation</productname> models, due to the implementation
of <application>PROLL</application>. This limit is technically 8
<acronym>MB</acronym>. This topic is mentioned again in
the <quote>Questions and TroubleShooting</quote> section of this document.
</para>
</sect2>
<sect2 id="KernelBuild-BuildTheKernelSection">
<title>Build the <productname>JavaStation</productname>-Ready Kernel</title>
<para>
To build the kernel, you type <userinput>make vmlinux</userinput>. If you
come from an <hardware>x86 </hardware> Linux background, you might be
surprised that you do not perform a <userinput>make bzImage</userinput>
or <userinput>make zImage</userinput>. Do not be alarmed: this command
is correct.
</para>
<para>
When the compile is finished, you will find a file named <quote>vmlinux
</quote> in the kernel source root directory. You are almost ready to
put this kernel to use.
</para>
</sect2>
<sect2 id="KernelBuild-elftoaout">
<title>Convert Kernel from ELF to a.out format</title>
<para>
You need to make one more change to your kernel before it is ready for
use. You need to convert it from <acronym>ELF</acronym> to <acronym>AOUT
</acronym> executable format. You can do this with the <quote>elftoaout
</quote> utility included in most <application>Linux/SPARC</application>
distributions.
</para>
<para>
To convert your kernel image to the <acronym>AOUT</acronym> executable format,
you issue the command:
</para>
<screen>
<userinput>elftoaout -o vmlinux.aout vmlinux </userinput>
</screen>
<para>
You will probably now want to rename the image file to a longer name
which includes the current date and kernel revision you used, so as not
to get confused with when you have multiple boot kernel images down the road.
</para>
<para>
The elftoaout program should come with your SparcLinux distribution.
If not, try VGER or your favorite kernel mirror.
</para>
</sect2>
<sect2 id="KernelBuild-KernelSamplesSection">
<title><productname>JavaStation</productname>-Ready Kernel Images,
System.map and .config File Samples</title>
<para>
Here are some sample <quote>.config</quote> and <productname>JavaStation
</productname>-ready kernel images. They were prepared and donated
to help get you up-to-speed quickly.
</para>
<para>
Warning: Some of these kernel images are considered out of date,
and should be avoided in a production environment. It is up to
you to decide how much of a liability you feel running them holds.
The document author and kernel contributors cannot be held liable
for any damage caused by the use of these kernels. They are provided
with absolutely no warranties.
</para>
<para>
If for some reason you have troubles downloading, try holding left-shift
on your browser as you click the link. Kernel images are compressed
with bzip2 compression. They must be uncompressed before use. Kernel
images are already converted to a.out format.
</para>
<para>
If you mirror these files, or can verify they work on a machine not yet
confirmed, <emphasis>PLEASE</emphasis> email me so I can add your information
here.
</para>
<sect3 id="KernelBuild-2.3.99pre3_embedded_RSD">
<title>2.3.99pre3_embedded_RSD</title>
<para>
.config (md5sum c59329ceb2e831f2502c1e410ece141c):
<ulink
url="http://dubinski-family.org/~jshowto/Files/kernels/2.3.99pre3_embedded_RSD/config__2.3.99pre3_embedded_RSD.txt" >
http://dubinski-family.org/~jshowto/Files/kernels/2.3.99pre3_embedded_RSD/config__2.3.99pre3_embedded_RSD.txt</ulink>
</para>
<para>
kernel (md5sum 8e8d28b13961b92e3f95e4ba98f6f319):
<ulink
url="http://dubinski-family.org/~jshowto/Files/kernels/2.3.99pre3_embedded_RSD/vmlinux__2.3.99pre3_embedded_RSD.bz2" >
http://dubinski-family.org/~jshowto/Files/kernels/2.3.99pre3_embedded_RSD/vmlinux__2.3.99pre3_embedded_RSD.bz2
</ulink>
</para>
<para>
System.map (md5sum 43205a86fcb0b16ecae7313d38fcbb2c):
<ulink
url="http://dubinski-family.org/~jshowto/Files/kernels/2.3.99pre3_embedded_RSD/system.map__2.3.99pre3_embedded_RSD.txt">
http://dubinski-family.org/~jshowto/Files/kernels/2.3.99pre3_embedded_RSD/system.map__2.3.99pre3_embedded_RSD.txt
</ulink>
</para>
<para>
Description:
</para>
<para>
This kernel is donated by Robert Dubinski. It was used at Marquette
University to build an embedded root boot image. This is based off of the
Mar. 17, 2000 CVS kernel. It includes support for both Mr. Coffee and
Krups machines.
</para>
<para>
Tested on Mr. Coffee: YES
</para>
<para>
Tested on Krups: YES
</para>
<para>
Tested on Espresso: NO
</para>
</sect3>
<sect3 id="KernelBuild-2.3.99pre3_nfsroot_RSD">
<title>2.3.99pre3_nfsroot_RSD</title>
<para>
.config (md5sum e715370346ac298555dd7ce099c8f80a):
<ulink
url="http://dubinski-family.org/~jshowto/Files/kernels/2.3.99pre3_nfsroot_RSD/config__2.3.99pre3_nfsroot_RSD.txt" >
http://dubinski-family.org/~jshowto/Files/kernels/2.3.99pre3_nfsroot_RSD/config__2.3.99pre3_nfsroot_RSD.txt</ulink>
</para>
<para>
kernel (md5sum fd141e8e8f639df67427d5ecd0ecba76):
<ulink
url="http://dubinski-family.org/~jshowto/Files/kernels/2.3.99pre3_nfsroot_RSD/vmlinux__2.3.99pre3_nfsroot_RSD.bz2" >
http://dubinski-family.org/~jshowto/Files/kernels/2.3.99pre3_nfsroot_RSD/vmlinux__2.3.99pre3_nfsroot_RSD.bz2
</ulink>
</para>
<para>
System.map (md5sum fd141e8e8f639df67427d5ecd0ecba76):
<ulink
url="http://dubinski-family.org/~jshowto/Files/kernels/2.3.99pre3_nfsroot_RSD/system.map__2.3.99pre3_nfsroot_RSD.txt">
http://dubinski-family.org/~jshowto/Files/kernels/2.3.99pre3_nfsroot_RSD/system.map__2.3.99pre3_nfsroot_RSD.txt
</ulink>
</para>
<para>
Description:
</para>
<para>
This kernel is donated by Robert Dubinski. It was used at Marquette
University to prototype a filesystem. This is based off of the
Mar. 17, 2000 CVS kernel. It includes support for both Mr. Coffee and
Krups machines.
</para>
<para>
Tested on Mr. Coffee: YES
</para>
<para>
Tested on Krups: YES
</para>
<para>
Tested on Espresso: NO
</para>
</sect3>
<sect3 id="KernelBuild-2.4.2_embedded_RSD">
<title>2.4.2_embedded_RSD</title>
<para>
.config (md5sum dd1a9dd2e92b9b175b7ba747c94edca7):
<ulink
url="http://dubinski-family.org/~jshowto/Files/kernels/2.4.2_embedded_RSD/config__2.4.2_embedded_RSD.txt" >
http://dubinski-family.org/~jshowto/Files/kernels/2.4.2_embedded_RSD/config__2.4.2_embedded_RSD.txt</ulink>
</para>
<para>
kernel (md5sum 5a1592b7e0a37909ae16374296a7070e):
<ulink
url="http://dubinski-family.org/~jshowto/Files/kernels/2.4.2_embedded_RSD/vmlinux__2.4.2_embedded_RSD.bz2" >
http://dubinski-family.org/~jshowto/Files/kernels/2.4.2_embedded_RSD/vmlinux__2.4.2_embedded_RSD.bz2
</ulink>
</para>
<para>
System.map (md5sum 1de202e0fab7a9e661bebc80255605b7):
<ulink
url="http://dubinski-family.org/~jshowto/Files/kernels/2.4.2_embedded_RSD/system.map__2.4.2_embedded_RSD.txt">
http://dubinski-family.org/~jshowto/Files/kernels/2.4.2_embedded_RSD/system.map__2.4.2_embedded_RSD.txt
</ulink>
</para>
<para>
Description:
</para>
<para>
This kernel is donated by Robert Dubinski. It is a demonstration kernel
for the 2.4.x series, and has not been tested...yet. It includes support
for both Mr. Coffee and Krups machines.
</para>
<para>
Tested on Mr. Coffee: NO
</para>
<para>
Tested on Krups: NO
</para>
<para>
Tested on Espresso: NO
</para>
</sect3>
<sect3 id="KernelBuild-2.4.2_nfsroot_RSD">
<title>2.4.2_nfsroot_RSD</title>
<para>
.config (md5sum cabd1d98613ad169b372666b7eaa869b):
<ulink
url="http://dubinski-family.org/~jshowto/Files/kernels/2.4.2_nfsroot_RSD/config__2.4.2_nfsroot_RSD.txt" >
http://dubinski-family.org/~jshowto/Files/kernels/2.4.2_nfsroot_RSD/config__2.4.2_nfsroot_RSD.txt</ulink>
</para>
<para>
kernel (md5sum c24f42f72c58920c00ac7ff7aaffadde):
<ulink
url="http://dubinski-family.org/~jshowto/Files/kernels/2.4.2_nfsroot_RSD/vmlinux__2.4.2_nfsroot_RSD.bz2" >
http://dubinski-family.org/~jshowto/Files/kernels/2.4.2_nfsroot_RSD/vmlinux__2.4.2_nfsroot_RSD.bz2
</ulink>
</para>
<para>
System.map (md5sum 6af2b374c7d3fc3f97d48ab71b335062):
<ulink
url="http://dubinski-family.org/~jshowto/Files/kernels/2.4.2_nfsroot_RSD/system.map__2.4.2_nfsroot_RSD.txt">
http://dubinski-family.org/~jshowto/Files/kernels/2.4.2_nfsroot_RSD/system.map__2.4.2_nfsroot_RSD.txt
</ulink>
</para>
<para>
Description:
</para>
<para>
This kernel is donated by Robert Dubinski. It is a demonstration kernel
for the 2.4.x series, and has not been tested...yet. It includes support
for both Mr. Coffee and Krups machines.
</para>
<para>
Tested on Mr. Coffee: NO
</para>
<para>
Tested on Krups: NO
</para>
<para>
Tested on Espresso: NO
</para>
</sect3>
<sect3 id="KernelBuild-OutsideFileMirrors">
<title>Outside kernel mirrors</title>
<para>
Other sites mirror the kernels here or other kernel samples.
Here are a few known sites as of Oct-31-2001:
</para>
<orderedlist>
<listitem>
<para>
<ulink
url="ftp://atari-source.com/pub/javastation/">
ftp://atari-source.com/pub/javastation/
</ulink>
</para>
</listitem>
<listitem>
<para>
<ulink
url = "http://people.redhat.com/pjones/krups/">
http://people.redhat.com/pjones/krups
</ulink>
</para>
</listitem>
<!-- Varol seems to have left.
url = "http://aristo.ulakbim.gov.tr/~varol/documents/linux_krups.html">
http://aristo.ulakbim.gov.tr/~varol/documents/linux_krups.html
-->
</orderedlist>
</sect3>
</sect2>
</sect1>