#kaios #foss #opensource #freesoftware #libresoftware
About software and its distribution
In the years which software was not commercialized and copyright about software was not yet a thing. People were distributing software and its source code and users were changing the software to their wish for better usability. The term hacker didn't mean someone who breaks into servers but it meant someone who plays around with the software and possibly fix bugs or add features to make it more useful. Today, this is known as “Hacker in the MIT sense”.
Later came FOSS to bring the same advantages to the software world in the modern era. FOSS stands for Free Open Source Software. Strictly speaking, free software and open source software are different. Free here means freedom not zero price. However most pieces of software which are free software are also open source and vice versa. This includes those under MIT/X11, GPL, LGPL, MPL and many many other such these licences.
Nowadays, a software does not necessarily come with the source code. Even if it's written in a language like Javascript which does not give your a binary, yet you don't have the source code because people mangle and minify the JS code. This will make the final package smaller and will also prevent users from understanding what the software does. To understand such a code, first you must add proper formatting and indentation to it. After that you'll have a bunch of function or variable names which use a single character and no comments to help you understand the code. I remember a friend had said “These apps have been written without any love”. I told him the “love” has been removed from the apps before deploying to production!
From a point of view, KaiOS is just a pre-built Lego, just like any other Unix-like distribution. It's a Linux distro. The main parts of this Lego are the Linux kernel which its job is communication with the hardware, the libraries including libc
which provide a useful and more abstract way to talk to kernel, and finally Gecko which on the top of it KaiOS applications, including the System app and the stock apps, run. There are also many other stuff like propriety vendor-dependent stuff.
Which parts of KaiOS are FOSS?
The Linux kernel used in KaiOS phones is under GPLv2. GPL is a strong copyleft licence. Many other “userland” libraries have similar licences. Gecko has a copyleft licence but a weak one. Copyleft means you can take the software and use it and possibly change it. But if you want to give the software to the others, you must give them the software and the changes in source code form as well. So from a legal point of view, KaiOS manufacturers must provide users the source codes which are under a copyleft licence. For example Nokia has published source code of Linux, many libraries and Gecko.
But will giving you the source code make it possible for you to change the OS to your wish and deploy the new version to your phone? Sadly, the answer is not a total yes.
First, many drivers are vendor-dependent and propriety. For instance, my 800 Tough has a Snapdragon from Qualcomm. If you have a similar phone, you will find many stuff in your phone with qcom
in their name for various hardware features of the phone, including but not limited to Camera, charging, Cellular data and 3D acceleration. So where's the copyleft? The Linux kernel is under GPL which is a strong copyleft. Strong copyleft simply means you cannot combine propriety code with strong copyleft code. But Qualcomm uses propriety firmwares for various hardwares on the phone which are not linked with the Linux kernel and therefore it's not necessary to release the source code. Also not every part of KaiOS is strong copyleft. There is also weak copyleft which permits the combination as long as the original source code will be available. Or in other words, the open source part does not become closed source. Gecko uses Mozilla Public License or MPL which is of this kind.
Second, there are many “System” and “Stock” apps used in KaiOS which are not FOSS. If you want your own free KaiOS, you'll have to write your own version of these apps. Like Contact, Call log, messaging and Settings app. And the most important one, the System app which runs other apps.
Third and the worst problem is that even if you've got an OS to deploy, the problem is the deploying process! You'll need to write your version of OS to device's internal storage and make your phone boot it. It's not easy, simple or straightforward. Companies usually lock their phones to prevent this and frighten customers that if they try such these ways, their phone will go out of warranty.
Nevertheless, there has been attempts to port different stuff to KaiOS phones by using the Linux kernel and possibly other userlands. You can see Affe Null's Bananian project which ports Debian to the BananaPhone. I also remember Affe talking about running KaiOS 3.x on his port but it wasn't useful without hardware drivers and other apps, especially the System app. Last time I asked him, he said he is no longer working on Bananian and instead working on postmarketOS.
Note: postmarketOS is a Linux distribution for the mobile phones. It uses the mainline Linux kernel and Alpine Linux on the top. You might see a variety of different old or very old mobile phones, mostly Android ones, which pmOS supports them. Unfortunately, because of drivers being propriety and little manpower to reverse engineer and replace them with FOSS ones, there aren't many devices with very good support of pmOS.
So just the kernel being FOSS has enabled the community to port different stuff to these feature phones. And this shows importance of the kernel to be FOSS.
Which parts of KaiOS are source available but not FOSS?
Source available means you can see the source code but you are not permitted to change it and/or distribute with or without changes. All stock and System apps of KaiOS are source available because they are written in Javascript. Because the JS code has been mangled and minified, it's not easy to understand and modify them. Yet the BananaHackers community has provided near 20 ways as of writing this post to customize your device. To have custom launcher, custom Contact app, custom apps to launch from Lock-screen, change settings of stock apps and a lot more.
Now imagine if we had source code of these apps under a FOSS licence, we could do much better and travel much further. Because the licence of stock apps does not allow re-distribution, legally we are not permitted to publish the entire improved packages or custom ROMs.
Conclusion
So if the ecosystem was FOSS-based and if the devices were not locked, KaiOS could be much better and it wasn't the only practical choice we have got on our mobile phones. And we see that even though the stock apps are not FOSS, and their sources are not available, we have made significant improvements to the ecosystem for ourselves and other users of this ecosystem. If locked phones were not locked, their users could have these improvements in their hands as well.