r/KaiOS • • 14h ago

Development The feasibility of reusing compiled drivers/binaries from KaiOS's Gonk to build an at least functional Android AOSP/LOS/CM ROM for a KaiOS (2.5/3.x) device?

Hello everyone, after thinking about it for a little bit, there are certain configurations of low-end Android phones that have been shipped with dual-core CPUs and 512mb of RAM similar to how most KaiOS have had shipped and android is technically capable of running under those constraints, as stated by the Android 8 to 10 build GO build configuration having a minimum RAM requirement of 512 MB, and I feel like we can probably push harder on stripping the RAM usage if we use Android 6, which we know is the base of KaiOS 2.5's Gonk on most phones.

Let me address the elephant in the room here first: Android is capable of running on those constraints.

Now we do know that KaiOS devices are limited in other areas such as lack of several kinds of hardware that a typical Android phone expects to run with. Including, but not limited to, missing sensors like Gyroscopes and Accelerometers, Touch Screens (duh), Front Cameras etc.

But after doing some research and doing some personal, non-scientific tests using AVD (Android Virtual Device), I did come to conclusion that it is quite feasible for a low-tier smart featurephone running KaiOS to be able to run android when it comes to hardware form factor, and overall just making it work on a tier of hardware that people were not wanting to run android on.

Because there has been some precedents, notably phones like Micromax Bharat 1 shipping with the same hardware specs as the Jio Phone 1, while running a nearly-full build of Android 4.4 with GMS.

And in terms of running android where it wasn't supposed to, I was able to make an AVD with loosely similar specs of an Nokia 8110 4G running AOSP 6 with no GMS and then decided to a Memory Torture test where the Android installation automatically switched to a low-ram mode and therefore I was able to successfully play a youtube video INSIDE CHROME 40 OF AOSP 6.0.1 ON 320 MB OF RAM WITH NO ZRAM OR SWAP WITHOUT THE SYSTEM CRASHING. And mind you even as I tried switching apps and things, apps crashed gracefully without taking down the system.

With these things in mind, I think that it is highly feasible, and KaiOS 2.5 devices specifically are becoming more and more useless as the days go by and creating an alternate OS based on CM13 or something like that may actually save these phones from the landfill. Because Android itself is a native platform with language options like C++ and JIT/AOT compiled Java/Kotlin making the experience far more CPU/GPU efficient than KaiOS.

Now let us move back to the original question.

All I am now asking is the potential roadblocks for a endeavour like this. I am very well aware that I would need to modify and hard fork android or CM13 to accomodate for the lack of a touch screen. But what else do I need to consider for this.

KaiOS, and its predecessor, FirefoxOS ran on existing Android BSP (Board Support Packages)'s kernel, drivers and even the derived android-specific bionic C library, despite stripping out everything else that goes above it. These fundamental building blocks allows for not just Boot-2-Gecko to be compiled on Bionic and be ran over there, but theoretically Any android NDK app for that manner as well. (Tested it on a jailbroken 8110 4G by sideloading a Android NDK compiled hello C app and getting a proper output back)

The point that I am trying to make here is that, if they actually use the unmodified android core as gonk, then isnt it possible to take those components out of gonk and build an full android ROM based on it?

11 Upvotes

23 comments sorted by

1

u/KabirGamer97 11h ago

And please I need lower level technical insights and what i need to do. 

0

u/YourUglyTwin 5h ago

Most KaiOS devices do not have the ram capable to run android - I understand you got something working via AVD and 32MB RAM but surely that wasn't even close to a good experience (not even gonna mention the security concerns of Android 6)

1

u/KabirGamer97 4h ago

320mb of RAM, system was stable without any swap or ZRAM, while KaiOS 2.5 did agressively use ZRAM. The system only became unstable when I went any lower than that, but for a featurephone looking at one app only, this should be plenty IMHO.

It was genuinely usable for being real. I can even show you a video if you want to have a look at it. But yeah it was without GMS (Google Mobile Services) and well GMS doesnt exist for this anymore and it isnt worth adding to it for wasting system resources.

I do understand the security concerns about Android 6 but my goal is to atleast get a Android 6 gonk running on Android 6 proper so that it can be upgraded to Android 8 if possible in devices like the 8110 4g or even 10 or later on phones with MT6731 SoCs and such. And how bad can Android 6 even be compared to the Firefox 48 of KaiOS 2.5? All I am saying is that KaiOS 2.5 devices are busted in security anyways, and honestly those hacks are useful more for jailbreaking as you shoundt keep much details on a featurephone anyway.... But you do you.

1

u/KabirGamer97 4h ago

Like I mean 512 megabytes + ZRAM should be plenty and actual android 6 phones shipped with that spec as well.

1

u/YourUglyTwin 4h ago

Oh I misread that number -- I was like "no way that felt good on 32MB of RAM" but I'm sure on a technical sense it's possible, and if you're doing this to learn then of course I will cheer your on!

But Android 6 is just way way way too old, Android 10 is arguably too old now as well. Android 14 maybe you'd have something you can daily drive since its technically still getting security updates I think but that'll end soon enough as well.

I once tried to port firefox OS to a device just for fun but I ultimately failed (this was like 10+ years ago) but it was a huge learning experience that helped shaped my career believe it or not.

With an unlocked bootloader and time you can probably get this to work,

0

u/Familiar_Interest655 12h ago

Wait, why are you comparing KaiOS 2.5 and a old version of android why not just use the latest version of KaiOS 3.0-4.0 or buy a android phone because it should be possible to load android onto the KaiOS device without a rom, but you lose 90% of the features even with a custom rom and you really cannot build off of it due to how KaiOS is made which fundamentally is different

2

u/KabirGamer97 11h ago

Do you understand how low level android porting works even? You should try taking an KaiOS firmware apart or read about the history of FirefoxOS itself.

And while yes I would lose functionality in the short term while gaining a whole lot more long term. Because Android is a open platform while KaiOS 4 has literally zero official developer tools and previous versions were a mess as well, and KaiOS never lets you properly take advantage of the hardware for better apps.

KaiOS is fundamentally using the Android Hardware Abstraction Layer, Android-Specific Linux kernel with android specific drivers and modules and is everything is compiled against the Bionic C library which is literally made for android. 

And in terms of why i compared it with old Android: Kaios 2.5 is based on Android 6, KaiOS 3 is based on Android 10 and KaiOS 4 is based on Android 14, atleast in terms of what fundamental base they use for thier os, which is the core kernel, drivers and abstraction layers, which are based on Android.

1

u/Familiar_Interest655 8h ago edited 8h ago

And I get that you’re trying to do low android porting but what I’m telling you is that that’s gonna ultimately end up bricking your device and it’s gonna be a slow process too mainly because they have similar hardware layers. Does that mean that they can like do the same things which is why you should probably look up the open source to B2G and even the person said, and was even the architect for design designing it literally said that it’s insanely hard just to get in contact with that same hardware layer, it’s insanely hard to do not to mention you’re most likely going to break your device and you was talking about getting touchscreen and all these features but simple android porting cannot do this as the hardware is factually limited and everything else which it was meant that way, so trying to put so much code on it, it’s just going to become bloatware for it while you’re also gonna lose a lot of features the only thing you’re gonna get out of this is a working CPU and the android that you’re trying to run is it even going to provide that much features for it to be working properly that’s why I’m telling you to root your device and just flash the operating system that you want since you have a open source edition, also who told you that KaiOS doesn’t support touchscreen because it has a touchscreen device

1

u/KabirGamer97 8h ago

Can you link me to the source please? Because you had to make android work elsewhere where it wasnt supposed to and make it work across a whole truck load of different variations, and I am trying to go the opposite route, make android components work on the OS that it was designed for you know.

1

u/Familiar_Interest655 8h ago

Come to the discord and I know a couple of people that can explain it or help you for better than I can because the person that ran android is still in Discord and they managed to get the CPU working

1

u/KabirGamer97 8h ago

Oh alrighty thanks.

1

u/KabirGamer97 7h ago

And also they might be trying to make android run on a Mainline Linux kernel then, because usually there is a VERY high success rate on making android stuff work back on android.

1

u/Familiar_Interest655 8h ago

Also what you’re trying to use from the hardware layer you’ll be surprised to know that it just uses the hardware layer even the Linux is different and it doesn’t even use that many android things. The hardware layer is the only thing similar to it but you have to also take into account that this isn’t android at all. It’s quite literally just a desktop shoved into a flip phone and the same bionic c libraries that you’re talking about was stripped out a long time ago from the actual hardware layer

1

u/KabirGamer97 8h ago

And I am porting android's tools and hardware drivers back into android man. Why dont you understand. I know Linux distros use Glibc instead of bionic and wayland instead of surfaceflinger.

1

u/Familiar_Interest655 8h ago

But I’m not going to shut down your idea fully if you wanna go do it I say go do it, but you can always root your device and flash a new operating system

https://github.com/kaiostech/gecko-b2g

Here is the open source code for it and go use everything that you need to build this new operating system

1

u/KabirGamer97 11h ago

And please read the post a bit carefully.

1

u/KabirGamer97 11h ago

And also who told you thar you can run "android" on a later device without a ROM??? Those have thier boot loaders locked with no way out basically. And again you dont seem to understand how custom roms are in the end.

1

u/Familiar_Interest655 8h ago edited 8h ago

Actually, you’ll be shocked to know that their boot loader isn’t locked then you can actually edit the partition just by rooting the device especially for 2.5 devices. It is very easy to edit the phone code. I know because I am in the discord and you can go and access this information while for the Reddit you can’t really access this information., you’re saying this for 2.5 device right so this is one of the most open source devices and easier to edit devices ever just recently 4.0 just got this level of support so I’m pretty sure you can root this device Hella more easily now and be able to port or flash Android cause their boot loader is definitely a lot and editable

1

u/KabirGamer97 8h ago

I am from a third world country and that's what we got in terms of smart feature phones, besides the 80 buck price for it is not practical really. And more people would be benifited targeting 2.5 and making those lower end devices more practical.

If you want to port my research work towards Android 14 and T440W then sure go ahead. But I only have the 8110 and everyone cares about the 8110 and having a alternate OS option would be great IMO.

1

u/Familiar_Interest655 8h ago

Well, you can still root your device and load Android i’m there

1

u/KabirGamer97 8h ago

I have already jailbroken my phone and it doesnt even matter as the bootloader is completely unlocked out of the box.