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


[root@nb-namran 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

Leave a Reply

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