Searching on the web you can find many ways of compiling Android native applications, I mean, the usual console application, daemon, C/C++ library, etc. you usually compile with no problem in your computer.
In order to compile for Android you need an ARM toolchain. The two main options I have found consists on using Android Prebuilt toolchain and the CodeSourcery one:
- Android Prebuilt toolchain
- CodeSourcery toolchain
Android doesn’t come with the traditional libc library. On the contrary it comes with Bionic, a slim libc developed by Google for use in the Android mobile software platform. Bionic is clearly tailored for supporting the Android system. In  you can find some of the peculiarities of this library.
The Android prebuilt toolchain has a prefix arm-linux-androideabi-.
CodeSourcery, in partnership with ARM, Ltd., develops improvements to the GNU Toolchain for ARM processors and provides regular, validated releases of the GNU Toolchain. This toolchains are provided in many different versions with this naming convention . For our case the one it is going to be used is arm-none-linux-gnueabi, which includes the glibc. In case using the arm-none-eabi, non glibc is included and it is oriented to be used to compile complete native libraries and applications (like for instance in FreeRTOS).
As of my later post, you are not getting the Nexus S kernel source. And what is more it seems rather difficult to customize it (include new modules or facilities, etc.).
Next it is shown how to do so. It is not as difficult as expected and the procedure is quite similar to a kernel customization and build in a computer.
This entry tries to cover howto compile the complete Android environment from scratch. It includes how to download the source code of all packages, building and images generation. For further information you can follow the official guide.
Both applications are available in the Market so once the system is rooted you can download them from it. It is the easiest way.
The applications’ names to search in the Market are :
- Android Teminal Emulator
- BusyBox by Stephen (Stericson)
Otherwise you can compile busybox from it’s source available at http://www.busybox.net. You have to setup a building environment.
Creating ROM Backup
Flash the recovery image
$ ./fastboot flash recovery recovery-clockwork-220.127.116.11-crespo.img sending 'recovery' (4040 KB)... OKAY [ 0.642s] writing 'recovery'... OKAY [ 0.540s] finished. total time: 1.187s
The ClockworkMod Recovery should now be installed on the Nexus S.
Rooting is a process that allows users of mobile phones and other devices running the Android operating system to attain privileged control. With root access the limitations imposed by manufactures are overcome and how have almost full control of what you can install on your phone.
It’s only possible to flash a custom system if the bootloader allows it. On Nexus One, Nexus S, and Nexus S 4G, the bootloader is locked by default. Next it is described the way to unlock it.
Before going any further I highly recommend to read the CyanogenMod Wiki on fastboot as it includes information about it uses, options, etc.
Note: After unlocking all the data already installed is deleted and the mobile phone is wiped.