Hammer How to build Kernel

Here is how to build a custom kernel:

NOTE: If you are installing a custom rootfs, you may have to increase the size of the space in flash to hold the new rootfs image. You do this by editing the linux- /arch/arm/mach-s3c2410/mach-tct_hammer.c file. Find the .size string and change the value to be a little larger than your rootfs image is. The image size is in hex, so you will have to do a conversion to get the right value.

Some common values for .size are:

2 MB = 0x340000 3 MB = 4 MB = 5 MB = 6 MB = 8 MB =

You may have to increase the size of your initramfs/initrd to accomodate your ramdisk image if the uncompressed size is larger than about 12 MB. There will be both compressed and uncompressed rootfs images in the buildroot/binaries/ directory. To do this, you have to set the size of the initramfs/initrd in the kernel. Find Block Devices in the kernel configuration and set the size to be just a little larger than your uncompressed initramfs/initrd. Only add a multiple of 1024 bytes.

Do:

tar xzf linux-2.6.22.tar.gz cd linux-2.6.22 zcat ../Hammer-linux-2.6.22-09122007.diff.gz | patch -p1 Edit linux- /arch/arm/mach-s3c2410/mach-tct_hammer.c to change .size if needed. cp hammer-config .config make oldconfig make zImage make modules

The kernel can be found in arch/arm/boot/zImage

If your kernel and rootfs compress size is bigger than 1Mo, you will need to change some Apex config.

If you want to flash the bootloader, do make menuconfig In Environment Regions (nor:1280k+2048k) Source region for ramdisk image to have a rootfs image smaller than 2048k

make

and then reflash with the new apex.bin file

newer kernel (2.6.22 to 2.6.28)
If you want to compile a kernel upper than 2.6.22, you don't need to patch the kernel. To make a new kernel, just :

export ARCH=arm export CROSS_COMPILE=arm-linux-uclibc- make tct_hammer_defconfig make menuconfig make zImage export INSTALL_MOD_PATH=../../buildroot/project_build_arm/Hammer/root/ ==> depend on your kernel source directory location make modules_install

To use the 2.6.28 kernel, you will also need to : make menuconfig

In Device drivers -> Character devices -> Serial drivers And type Y for Samsung SoC serial support

if not, you will not have any feedback in the serial console.