This chapter assumes you wish to compile your own Linux kernel for the JavaStation. It assumes you already know how to compile Linux kernels in general, perhaps on PC, a SPARC server running Linux, or any of the other Linux ports. If not, read the Kernel-HOWTO and the README file of your kernel source.
Compiling a kernel for a JavaStation is not much different than compiling a Linux kernel elsewhere. You just need to know the right options to pick. In general, you're compiling for a Sun4M class architecture, and enabling JavaStation-specific options. The following sections in this chapter will take you through the steps.
While it may be possible to compile the JavaStation -enabled kernel on alternate platforms, this HOWTO assumes you do it on a Linux/Sparc based server running in 32-bit mode.
When compiling your own JavaStation-capable kernel, you need to make sure the Sun server you are working on is set to 32-bit mode. So, if you're on an Ultra-class machine, be sure you first switch to 32-bit mode before you begin compiling.
To check what mode you're in, do a uname -a. If it says "sparc", you're in 32-bit mode and don't have to do anything. If it reports "sparc64", then you should perform a sparc32 bash first to switch to 32-bit mode. A subsequent uname -a should reflect the change.
The kernel source revision you should use depends on which model of JavaStation you have.
Mr. Coffee support has worked since about kernel version 2.2.5, and definitely works out of the box with the RedHat 6.0+/SPARC distribution kernels.
Krups support did not work well out of the box until the latter 2.3.x kernel cycle. Pete Zaitcev <zaitcev@metabyte.com> added Krups support in the early 2.3.x sequence, but the MMU changes to the 32-bit SPARC kernel kept it from compiling cleanly until later on. The kernel is known to compile cleanly with the Mar. 17 CVS kernel, and should compile cleanly with any 2.3.99pre3+ version kernel. Krups support has been backported by Varol Kapton <varol@ulakbim.gov.tr>, and it is fully supported in the 2.2.15-prepatch versions.
By the time this document gets widespread exposure, it is hoped that the 2.4.x stable kernel cycle will be ready, at which time any 2.4.x kernel should compile cleanly with support for the entire JavaStation line.
If you can not get a kernel to compile, you should try the samples pointed to by this document.
When you do your make config command to enter the kernel configuration stage, there are a few things you are required to enable:
For all JavaStations, you want to enable PCI support:
CONFIG_PCI=y |
Don't forget your mouse:
CONFIG_BUSMOUSE=y CONFIG_SUN_MOUSE=y |
You'll want video, done with the Linux framebuffer interface:
CONFIG_FB_TCX=y (for Mr. Coffee) CONFIG_FB_PCI=y CONFIG_FB_IGA=y (for Krups/Espresso) |
Audio is done with the Crystal Audio 4231 chipset:
CONFIG_SPARCAUDIO=y CONFIG_SPARCAUDIO_CS4231=y |
Don't forget your network interface:
CONFIG_SUNLANCE=y (Mr. Coffee) CONFIG_HAPPYMEAL=y (Krups/Espresso) |
You'll no doubt need to support a filesystem:
CONFIG_EXT2_FS=y |
You'll want IP autoconfiguration, and RARP/BOOTP support:
CONFIG_IP_PNP=y CONFIG_IP_PNP_BOOTP=y CONFIG_IP_PNP_RARP=y |
When doing the "NFS-Root" filesystem configuration, you will need both NFS and NFS-Root support:
CONFIG_NFS_FS=y CONFIG_ROOT_NFS=y |
When doing the "Embedded-Root" filesystem, configure both RAM disks and "initial ramdisk" support:
CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_INITRD=y |
You can get a working ".config" file which has these options set later in this chapter.
If you have decided to go with the "Embedded-Root" filesystem option, you will want to make a patch to the RAMdisk driver source first.
The default size of a RAM disk when using the RAMdisk driver is 4 MB. Chances are that you will want an embedded filesystem of more than that size, particularly when you start thinking about running an X server, or including a Java runtime.
You can do this change by yourself, or by using the patch pointed to below. The change is a one-line edit in the file <LINUXROOT>/drivers/block/rd.c . Look for a line that says:
int rd_size = 4096; /* Size of the RAM disks */ |
and change it to the size of the RAMdisk you wish. Typically, most embedded systems are under 16 MB, so a common edit is to change the line to:
int rd_size = 4 * 4096; /* Size of the RAM disks */ |
If you can not do this, the patch below makes the edit for you.
4MB to 16MB kernel patch file is at: http://studsys.mscs.mu.edu/~tech/Linux_on_JS/Files/ramdisk_patch
It should be noted in this section that there is currently a limit on the size of Linux boot image for all JavaStation models, due to the implementation of PROLL. This limit is technically 8 MB. This topic is mentioned again in the "TroubleShooting" section of this document.
To build the kernel, you type make vmlinux. If you come from an x86 Linux background, you might be surprised that you do not perform a make bzImage or make zImage. Do not be alarmed: this command is correct.
When the compile is finished, you will find a file named "vmlinux" in the kernel source root directory. You are almost ready to put this kernel to use.
You need to make one more change to your kernel before it is ready for use. You need to convert it from ELF to AOUT executable format. You can do this with the "elftoaout" utility included in most Linux/SPARC distributions.
To convert your kernel image to the AOUT executable format, you issue the command:
elftoaout -o vmlinux.aout vmlinux |
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.
Here are some sample ".config" and JavaStation-ready kernel images. They have been donated by Linux-running JavaStation users.
http://www.mscs.mu.edu/~tech/Linux_on_JS/Files/kernel_config_2_3_99_pre3_mar_17
This is a ".config" file donated by Robert Dubinski <dubinski@mscs.mu.edu>. It was used at Marquette University to build a boot image from the Mar. 17, 2000 CVS kernel version. This includes support for both Mr. Coffee and Krups in an "Embedded-Root" filesystem configuration. These options should be valid for newer kernels as well; Perform a make oldconfig when using with latter kernels.
http://studsys.mscs.mu.edu/~tech/Linux_on_JS/Files/vmlinux_2_3_99pre3_mar_17
This is a kernel file donated by Robert Dubinski <dubinski@mscs.mu.edu>. It was built for Marquette University and is based off the Mar. 17, 2000 CVS kernel version.
This kernel image includes support for both Mr. Coffee and Krups models in an "Embedded-Root" filesystem configuration.
This boot kernel image has already been converted to the required AOUT executable format.