Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

If I want to build a custom kernel for an ARM architecture, do I need to :

a) Download the kernel from kernel.org, make changes to the kernel, build it using some cross compiler (like code sourcery or something)

b) Find an ARM specific kernel from somewhere, find some patches, compile it using some ARM specific tool ?

Can any custom kernel be built for the ARM architecture ?

I have little knowledge about kernels in general.

share|improve this question
    
To add to the answers: Besides the mainline, (sadly) many particular chips/boards/manufacturers have their specific arm ports, too. itworld.com/mobile-wireless/175829/… –  XTL Jan 31 '13 at 7:01
add comment

2 Answers

up vote 8 down vote accepted

The Linux kernel source tarball and git repository includes the code for all supported architectures, such as ARM.

The subdirectory Documentation/arm/ contains some ARM related documents which you should probably have a look at before going further.

The ARM specific code is located in the arch/arm/ subdirectory (some ARM specific drivers may be in the drivers/*/ subdirectories).

Thus go ahead and download the normal kernel tarball from kernel.org and start by reading Documentation/arm/README which starts as follows:

Compilation of kernel

In order to compile ARM Linux, you will need a compiler capable of generating ARM ELF code with GNU extensions. GCC 3.3 is known to be ...

It looks like after reading that file you will have many answers (and maybe also more questions but do not hesitate to ask them :).

share|improve this answer
add comment

The kernel source is the same for all architectures. It's mostly written in C with a little bit of arch specific assembly.

The easiest way to build for ARM would be to be running on ARM already. You could then simply follow the regular compilation documentation.

If you want to build from a different architecture, that's called cross-compiling. I've never done that myself, but I do know that you need to set up a cross-compiling tool-chain in order to do so.

This HOWTO should get you started.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.