[Android Apps and Games] ruleh:
Together We are One

Some background

Combining modules sounds like it kinda defeats the purpose of having modules in the firsplace : to enable/disable kernel features independendly of each other.

However with all the dependencies of the wifi world, having 5-10 (rt73usb requires 6 ) modules that need to be constantly loaded and unloaded seems a bit unpractical especially when you need to

load it in a certain order

to meet these dependencies.

Basically independent loading/unloading is a big NO with wifi kernels on android.

On other devices you have your friend udev which does all the hard work for you but we can't enjoy a luxury like that.

Progress

Combining modules WORKS.

Somehow I managed to combine cfg80211 and mac80211 into a module called bigfatwifi.ko.

It loads fine and other modules that depend on cfg/mac also load. {I did not test if the wifi device actually works yet}

Problems

ohhh this is gonna be a long one.

First it is a lot of trail and error.

And by a lot I mean a lot.

Mainly because I still haven't go the hang of makefiles yet so most of the time is spend on me trying to get something together so that the compiler understands what I am trying to tell it.

Also sadly I can't just let the kernel compile and take the object files to combine them.

It just doesn't work.

Instead I need to list every single source file in the makefile (with always 1 exception per module) and correct all the paths so it actually does something.

The reason for why adding object files together doesn't work is because they all have this annyoing _init/_exit function which is really really bad.

However my approach to it is just as bad if not worse: cut out all the init/exit functions out of the original .c files and add them to a new file called load.c.

Then add the _init functions inside another function the same way the modules would be loaded. For the _exit functions this has to be repeated but backwards therefore preventing the use of copy-paste.

{I just hope having the module return 0 a few times during init doesn't cause any problems.}

I have also included the original .c file with [include "path/to/file"] and then disabled that original .c in the makefile.

However this makes my load.c file illegal according to ISO C90. (hope it won't matter to other compilers)

Anyways, doing this with every single driver will take time, and by time I mean A LOT of time.

More Problems:

--leds causes the kernel to completely panic followed by a full reboot.

--this only happens when:

--using mac80211 with led support or any driver that uses leds

--and actually having the dongle connected

For now I will just continue adding a bunch of drivers until I feel that the module is finished. Then making it easy to compile is the next most important step because ...uhmm it just is.

As a little fun note, menuconfig allows me to add and remove stuff to/from the module.

[But it just doesn't work as intended because of load.c]

Update: still crashing.... potential suspects: leds, export.h, crosscompiler, init/exit. Looks like it will take longer than it should just to get the basics working.

If anyone is interested here is the error (not a very descriptive one).

[Kernel panic - not syncing: Fatal exception]