[Galaxy S I9000 Android Development] Arise:
Eclipse IDE on Windows

Install Eclipse CDT. Google for it. Chose your Windows/Linux version and install it.

Inside Eclipse installation folder there is a file, eclipse.ini.

Edit it and change the last line (regarding memory) to something like -Xmx768m.

Reason: You need some memory, the linux kernel is kinda big, in order to get comfortable we need to change the default settings.

Note: To run Eclipse, you need Java SDK. Google for it, find it, install it if you don't have Java SDK.

0.###########################################################

Start Eclipse.

New project.

Select a C project. Give it a name. Example: sgs_kernel.

Project type: Makefile project -> Empty Project

Toolchain: --Other Toolchain --

(check screenshot 1)

Note: You can change the location of the folder, you can work with the default one, just don't create the project in the same folder where you have the linux kernel sourcecode.

1.###########################################################

Next

Advanced Settings

In the Properties window that was opened, go on the C/C++ General branch, expand it, Indexer.

Check Enable project specific settings

Uncheck Enable Indexer. I repeat, you have to uncheck in order to disable the indexer. :)

Apply

Ok

(check screenshot 2)

2.###########################################################

In the Project Explorer select your project (sgs_kernel), right click, New > Folder

Click on Advanced then Link to alternate location (Linked Folder)

Browse and select the root of the kernel of your choice. (you have a kernel folder already, right? If not, check sztupy post regarding git commands to retrieve your own kernel source code)

Finish

(check screenshot 3)

Reason: By linking to alternate location you keep the mess out, the project settings stays on your windows machine, the kernel files remains on the linux machine.

3.###########################################################

Get a cofee. Adding all the files to the project over Samba should take some time.

###########################################################

When it is done, expand the source code tree, inside arch folder select everything except arm folder and right click Resource configuration and then Exclude from Build....

In the new window, check Default, then OK.

The same should be done in the arm folder, so, expand the arm folder and there select all folders starting with "mach-", except mach-s5pv210 which is the platform for our Galaxy S, and we dont want that one to be excluded.

Again right click Resource configuration and then Exclude from Build....

(check screenshot 4)

4.###########################################################

Right click on the project (sgs_kernel) and expand C/C++ General > Paths and Symbols.

On the Symbol tab click on Add... button, check Add to all languages and add the symbol with the name: __KERNEL__ and Value: 1.

(check screenshot 5)

5. ###########################################################

Now the hard part.

To push Eclipse to the limits, we have to add the defines from the include/linux/autoconf.h.

There are several ways to do that, I'm still looking for better ways to do that, but for now the ideea is to use a script that parse the file autoconf.h and extract the defines and push those inside our project.

The script I'm talking about is a python script (yeah, that sucks, something else to install on our kitchen.

sudo apt-get install python

Note: The python script is attached in this post.

Copy the script autoconf-to-eclipse.py somewhere, example: /home/kernel

Also copy/create a new sh script that will call the python script above, using a syntax like:

#!/bin/sh
python autoconf-to-eclipse.py /home/kernel/voodoo/linux_gt-i9000/Kernel/include/linux/autoconf.h /home/kernel/voodoo/linux_gt-i9000.eclipse/

The first parameter is the path to the autoconf.h file, the second is the path where you should copy your eclipse project file (that would be the .cproject file).

So you have to copy over the .cproject file from the Windows host project folder C:\Users\XXXXXXX\workspace\sgs_kernel to the linux box to a folder like: /home/kernel/voodoo/linux_gt-i9000.eclipse/

You have samba, right?

Then on the linux guest, run the sh script, that will run the python script.

If everything is ok, then the .cproject file should be much bigger (the defines were imported).

Note: you have to do this step each time you alter the configuration, like running "make menuconfig".

Copy the file back on windows to the project folder and inside eclipse, right click on project folder and hit Refresh.

Wait...

To check everything is ok, right click, Properties, expand C/C++ Projects > Paths and Symbols, Symbols tabs... and there you should have all defines.

(check screenshot 6)

6. ###########################################################

Switch to the Includes Tab in the same branch C/C++ Projects > Paths and Symbols.

Add include folder. Check Add to all languages.

Add arch/arm/mach-s5pv210 folder. Check Add to all languages.

(check screenshot 7)

Apply.

Ok.

END. ###########################################################

Finally.

Right click > Properties > branch C/C++ Projects > Indexer.

Check Enable Indexer.

Ok.

Get a RedBull, it should take a while.

###########################################################

Start coding!

Ask for help if you don't understand/run into troubles.

Credits: Inspiration from here -> http://www.nazgee.eu/en/book/forcing-eclipse-to-work-with-linux-kernel-indexing-kernel-source