How to compile custom kernel for Vortex86 SX

Sometime we might want to change something in kernel itself in order to get some hardware to work or just small patch to tune it better.

Whatever the cause.. this is how we can compile our own version of kernel and boot it into Vortex86 SX machine.

I recommend before starting anything at all, kindly consult Vortex86SX_Linux_HowTo here [pdf] ..


First ,we download the closest version that you might want to compile with ..

this one is where we obtain the current working .config setting before we tweak it later.

well.. i took it from this page..

Downloaded both file –

1. root filesystem: xlr561-sx-rootfs.tar.gz (5.43 MB)

2. kernel files: xlr561-sx-kernel-2.6.24.tar.gz (1.94 MB)

and also Network adapter file.. if don’t have yet..

3. Ethernet driver: r6040.tar.gz (9 KB)

Ethernet driver source code for Linux 2.4 and 2.6.

Store it somewhere that you can found later..  extract it and look around also can..

Get that kernel source from kernel.org mirror. . in this case (2.6.24)

from this directory

http://www.kernel.org/pub/linux/kernel/v2.6/

or direct link at http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.24.tar.bz2

then.. we start with extracting the file.. (this one i compile on CentOS .. so your directory might differ)


su -
cd /usr/src/kernels
tar xjfc /tmp/linux-2.6.24.tar.bz2

then..

get the source / default / currently working config from original filesystem that we downloaded earlier..

mkdir -p /tmp/xlr
cd /tmp/xlr
tar zxfv /tmp/xlr561-sx-rootfs.tar.gz .

this will extract all root filesystem from the archive file..

verify that the exist the file ./etc/kernel-config/kernel-2.6.24-vortex86sx.config

for the kernel-file ..

mkdir /tmp/kernel-xlr
cd /tmp/kernel-xlr
tar zxfv /tmp/xlr561-sx-kernel-2.6.24.tar.gz .

it will consist just two file
1. linux
2. sysconfig.cfg

the content of sysconfig.cfg is something like this

DEFAULT linux

LABEL linux
KERNEL linux
APPEND root=/dev/hda2

we are going to copy the original kernel config into /usr/src/kernel/linux-2.6.24/

cd /usr/src/kernel/linux-2.6.24
cp /tmp/xlr/etc/kernel-config/kernel-2.6.24-vortex86sx.config .config

time to try start compile..


cd /usr/src/kernel/linux-2.6.24
make oldconfig

this will bring its setting to the closest set to original compiled kernel.
then from here we tweak it .. with


make menuconfig

For “MOXA” card..
need to select some from this hierarchy .

+ Device Driver
+–+ Character Devices
+–+–+ Non-Standard Serial Port Support
+–+–+–+ Moxa Intellio Support
+–+–+–+ Moxa SmartIO Support v. 2.0
non-standard

need to double spacebar .. to change it to * .. instead of .. we build its directly into static library instead of Modular..
(however your need might be vary..)
moxa-support
if you want to tweak any other setting also can be done from here..

patch the kernel source or anything as you want..
when done..”save its setting”
save-new-kernel-cofig
then.. next is compile it.


make

moxa
when done.. it will spit something like this..

SYSMAP .tmp_System.map
OBJCOPY arch/x86/boot/compressed/vmlinux.bin
GZIP arch/x86/boot/compressed/vmlinux.bin.gz
LD arch/x86/boot/compressed/piggy.o
LD arch/x86/boot/compressed/vmlinux
OFFSETS arch/x86/boot/offsets.h
AS arch/x86/boot/header.o
CC arch/x86/boot/version.o
LD arch/x86/boot/setup.elf
OBJCOPY arch/x86/boot/setup.bin
OBJCOPY arch/x86/boot/vmlinux.bin
BUILD arch/x86/boot/bzImage
Root device is (8, 5)
Setup is 11192 bytes (padded to 11264 bytes).
System is 1820 kB
CRC 4a6184d5
Kernel: arch/x86/boot/bzImage is ready (#2)
Building modules, stage 2.
MODPOST 2 modules

you can later find the new kernel created as /usr/src/kernel/linux-2.6.24/arch/x86/boot/bzImage


[[email protected] linux-2.6.28.8]# file arch/x86/boot/bzImage
arch/x86/boot/bzImage: Linux kernel x86 boot executable RO-rootFS, root_dev 0x805, swap_dev 0x1, Normal VGA

.. now we copy this together with original file from original kernel

cd /tmp/kernel-xlr
mv linux linux-orig
/usr/src/kernel/linux-2.6.24/arch/x86/boot/bzImage linux

this will replace the original kernel (linux) with our recently build kernel...

then next process would be ..
transferring this file into VortexSX86 and boot it from there..

use scp or whatever mean.. to get it into that machine folder..

/boot/

.. this is where and when the network driver come handy..
after copied the file .. reboot the machine to have new kernel in effect..

to verify ..
use

uname -a

or can also test the moxa driver after that as well..

p/s : the screenshot is based on 2.6.28.8 kernel.. as can't get screenshot during the on-site activity .. on ubuntu host ..though..
would not matter anyway .. just for my future reference and help whoever need them later .. 😎

Related Post

2 Responses

  1. namran says:

    4) Module parameters.
    ———————
    The following module parameters can be passed:

    mode=

    Possible values are 0 (round robin policy, default) and 1 (active backup
    policy), and 2 (XOR). See question 9 and the HA section for additional info.

    miimon=

    Use integer value for the frequency (in ms) of MII link monitoring. Zero value
    is default and means the link monitoring will be disabled. A good value is 100
    if you wish to use link monitoring. See HA section for additional info.

    downdelay=

    Use integer value for delaying disabling a link by this number (in ms) after
    the link failure has been detected. Must be a multiple of miimon. Default
    value is zero. See HA section for additional info.

    updelay=

    Use integer value for delaying enabling a link by this number (in ms) after
    the “link up” status has been detected. Must be a multiple of miimon. Default
    value is zero. See HA section for additional info.

    arp_interval=

    Use integer value for the frequency (in ms) of arp monitoring. Zero value
    is default and means the arp monitoring will be disabled. See HA section
    for additional info. This field is value in active_backup mode only.

    arp_ip_target=

    An ip address to use when arp_interval is > 0. This is the target of the
    arp request sent to determine the health of the link to the target.
    Specify this value in ddd.ddd.ddd.ddd format.

    If you need to configure several bonding devices, the driver must be loaded
    several times. I.e. for two bonding devices, your /etc/conf.modules must look
    like this:

    alias bond0 bonding
    alias bond1 bonding

    options bond0 miimon=100
    options bond1 -o bonding1 miimon=100

    Reply
  2. namran says:

    4) Module parameters.
    ———————
    The following module parameters can be passed:

    mode=

    Possible values are 0 (round robin policy, default) and 1 (active backup
    policy), and 2 (XOR). See question 9 and the HA section for additional info.

    miimon=

    Use integer value for the frequency (in ms) of MII link monitoring. Zero value
    is default and means the link monitoring will be disabled. A good value is 100
    if you wish to use link monitoring. See HA section for additional info.

    downdelay=

    Use integer value for delaying disabling a link by this number (in ms) after
    the link failure has been detected. Must be a multiple of miimon. Default
    value is zero. See HA section for additional info.

    updelay=

    Use integer value for delaying enabling a link by this number (in ms) after
    the “link up” status has been detected. Must be a multiple of miimon. Default
    value is zero. See HA section for additional info.

    arp_interval=

    Use integer value for the frequency (in ms) of arp monitoring. Zero value
    is default and means the arp monitoring will be disabled. See HA section
    for additional info. This field is value in active_backup mode only.

    arp_ip_target=

    An ip address to use when arp_interval is > 0. This is the target of the
    arp request sent to determine the health of the link to the target.
    Specify this value in ddd.ddd.ddd.ddd format.

    If you need to configure several bonding devices, the driver must be loaded
    several times. I.e. for two bonding devices, your /etc/conf.modules must look
    like this:

    alias bond0 bonding
    alias bond1 bonding

    options bond0 miimon=100
    options bond1 -o bonding1 miimon=100

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *