View Poll Results: How much Ramhack do you want to have?

No ramhack at all
25 Vote(s)
16MB ramhack
12 Vote(s)
24MB ramhack
16 Vote(s)
32Mb ramhack
104 Vote(s)

[KERNEL][exp: (3.1.10) #5] Firtecy Kernel - a modified Kowalski Kernel

123 posts
Thanks Meter: 1,123
By Firtecy, Senior Member on 1st June 2014, 12:15 PM
Post Reply Email Thread
This is an EXPERIMENTAL Kernel that continues the work of @pengus77, but with some additions i make. That means a huge thank to pengus77! Please check his thread
This kernel is completely based on his latest release.

This kernel only supports newbl and will only work on roms with 3.1 support (these are atm only 4.4 (aka KitKat) Roms and tonyps TheRom that is compatible with the 3.1 kernel

Features from the kowalski kernel:
  • 3.1.10 Kernel Version
  • bcmdhd wifi driver
  • Dynamic FSync
  • Overclock to 1.5 GHz (Not all phones work well with 1.5 Ghz!)
  • Undervolting
  • MultiCore Sched PM
  • Auto Hotplug
  • Fast charge
  • Wifi PM
  • and many more ...
Features added by me:
  • PKSM as enhanced KSM module
  • Built in ZRAM Modul (that makes it possible to use the android default zram solution)
  • Possibility to use deferred_timer for (P)KSM
  • 0, 16 or 32 MB Ramhack
  • Support for extra free kbytes tunable (more a ROM dev feature)
  • Custom vibration force/strength through sysfs
  • 120MHz and 168 MHz frequencies for more battery savings during wakelock

Known bugs:
  • Camera Bug
  • Gyro does not work properly
If you want to report a new kernel bug, you must describe your problem in detail, post your kmsg and last_kmsg (if available) (you can found them under /proc/kmsg and /proc/last_kmsg) otherwise the rule is: no log = no issue

This is more a personal kernel build. I have built these kernels for weeks for myself and used them in private. Now i just want to share them with you guys!

You can download the kernels here: They are labeled like this: where X is either exp for an experimental kernel release and stable for a stable kernel and where N is the build number (this number is always incremental!)

You can find the sourcecode at github: the branch is exp. The config file is: "kowalski_defconfig"

The intention of this thread is to continue the 3.1 kernel development pengus started. Development related questions or discussions are appreciated
Have fun!

And to quote pengus77:
On a side note... i'm not really responsible if you decide to test it and your phone melts... right?
Thanks to:
@hjunii for bringing up 3.1 Kernel
@pengus77 for the kowalski kernel

XDA:DevDB Information
Firtecy Kernel - a modified Kowalski Kernel, Kernel for the LG Optimus 2x

Firtecy, pengus77, hjunii, djnoxd
Kernel Special Features:

Version Information
Status: Beta
Current Beta Version: 3.1#5
Beta Release Date: 2014-08-25

Created 2014-10-31
Last Updated 2014-10-31
The Following 52 Users Say Thank You to Firtecy For This Useful Post: [ View ] Gift Firtecy Ad-Free
1st June 2014, 12:17 PM |#2  
Firtecy's Avatar
OP Senior Member
Thanks Meter: 1,123
Donate to Me


firtecy_kernel_exp-5 - 25.8.2014

  • Added intellactive governor (thanks to @faux123) and powersave
  • Some bug fixes
  • Added sync framework and exfat support (but not active for the moment)
  • Added a "kowalski touch driver" and dt2w files (since they are not stable enough for now, they are disabled)
The reason why I disabled those things is that I didn't had the time to test them. If you want to test them you have to build your own version. Especially for other developers that can be interesting.


firtecy_kernel_exp-4 - 25.6.2014

  • minor updates/fixes from other kernels
  • Added the min screen on freq back
  • Added a sysfs attribute to change the min screen on freq
  • when disabling pksm, it will be disabled completely

Screen on min freq
If your screen is on, this frequency is the lowest that will be used. If your screen goes off for whatever reason the cpu will go to the normal min frequency.
Note: It seems like 120MHz and 168MHz are stable even for screen on, but since there was the question if i can add it, here you go:

How to change the value:
echo [value] > /sys/module/cpu_tegra/parameters/cpu_screen_on_min_cap
You have to use a value that is in the frequency table, but you have to echo the frequency in KHz, so 120MHz -> 120000KHz:
echo 120000 > /sys/module/cpu_tegra/parameters/cpu_screen_on_min_cap
This option does not stick after a reboot

According to @BS86 this release should be more stable than exp3 and thanks for testing!


firtecy_kernel_exp-3 - 13.6.2014

  • tons of updates to zram/zcache (picked from faux123 tegra kernels)
  • crypto: added optimized AES and SHA1 routines
  • added permission checker for binder IPC
  • tegra video driver updates
  • Fixed the voltage table -> all values below 770 MHz are not supported by the regulator chip (thanks to all who helped researching! )


firtecy_kernel_exp-2 - 8.6.2014

  • Added the possibility to change the vibration force (or vibration strength)
  • Added 120MHz and 168MHz as cpu frequencies
  • Enabled 600 mV as lowest undervolting value (undervolting is very dangerous if you go too low! Better stay at defaults)
  • Fixed a nvidia or lg cpu derp.
  • For security reasons it is not possible that the cpu will go underneath 216MHz when screen is on!
  • Option to use: No ramhack, 16Mb Ramhack or 32 Mb Ramhack!

Vibration force:
to change the vibration force echo a number between 0 and 127 to /sys/module/tspdrv/parameters/vibration_force. Where 127 is the highest and the default. 20 seems to be the last noticeable value.
echo [force] > /sys/module/tspdrv/parameters/vibration_force
This option does not stick after a reboot. Rom support will be available (hopefully) soon. I'm preparing a patch for tonyps Rom, so that it is possible to change it in the Rom settings.

120 and 168Mhz:
These values are useful for the case where the phone helds a wake lock. This means because of the wake lock it won't enter deepsleep. The phone would run at 216MHz even if it isn't needed. Running at 168Mhz or even 120MHz should result in a better battery life.
If you experience any problems, try to raise the voltage at this frequencies to a higher value and test again. If it is still unstable report it (with a description of the problem) and change the minimum frequency to 216Mhz.


firtecy_kernel_exp-1 - 1.6.2014

  • Initial release
  • Base source: kowalski kernel
  • Added built in ZRam (no need to use zram.ko for longer)
  • Added PKSM as replacement for ksm (
  • Enabled deferred timers for pksm and ksm
Notice: Since there is no ksm available, but pksm you will not find the options for ksm in any app. All configurations are no longer under: /sys/kernel/mm/ksm/ , but under: /sys/kernel/mm/pksm/
To deativate pksm run this command as root:
echo 0 > /sys/kernel/mm/pksm/run
This option does not stick after a reboot

The Following 21 Users Say Thank You to Firtecy For This Useful Post: [ View ] Gift Firtecy Ad-Free
1st June 2014, 12:30 PM |#3  
Firtecy's Avatar
OP Senior Member
Thanks Meter: 1,123
Donate to Me
How to build your own kernel:

You need a Linux PC with either 32 or 64Bit. I'm using Linux Mint Debian Edition 64Bit. And you will need the following packages:
build-essential kernel-package libncurses5-dev bzip2
For example to install them run:
sudo apt-get install -y build-essential kernel-package libncurses5-dev bzip2
Hint: If you run into troubles with installing packages, check this post

1. Create a new directory for your kernel building (for example: ~/kernel_p990)
mkdir ~/kernel_p990
2. cd to your kernel dir
cd ~/kernel_p990
3. Run this command to download the source code for compiling:
git clone
4. Now we need to download the toolchain for compiling: Download it from here: under the Bare-Metal section. It is labeled GCC ARM Embedded. Version: 4.7-2013.q3 ; Release: 13.11

5. Now extract the toolchain to a new dir, for example: ~/kernel_p990/toolchain

6. Now we have to define some values for the build enviroment:
Set the CROSS_COMPILE var to your path where you have downloaded your toolchain. For example:
export CROSS_COMPILE=~/kernel_p990/toolchain/gcc-arm-none-eabi-4_7-2013q3/bin/arm-none-eabi-
Notice at the end you find this prefix: arm-none-eabi- this is not a dir, but the prefix for all files inside the bin directory(for example: arm-none-eabi-gcc)

7. Set the architecture (processor architecture) for which the kernel should be build. So in our case arm:
export ARCH=arm
export SUBARCH=arm
8. The next step defines the configurations for the kernel (in this case the configuration is named kowalski_defconig)
make kowalski_defconfig
Notice: this takes the configuration from the file located under arch/arm/configs and will write it to .config

9. Now we can finally build the kernel Run:
You will find the kernel under: arch/arm/boot/zImage. You just have to copy the zImage and replace the one found in the flashable zip (e.g. my downloads) under kernel/zImage with your own.

Before you can build or run any from step 8 or 9 you have to make sure that all three vars are set correctly (so ARCH, CROSS_COMPILE and SUBARCH). You can check it by running:
echo $ARCH
for ARCH (for CROSS_COMPILE and SUBARCH it is the seem, but you have to change the name)
If they are not set correctly repeat step 6 and 7.
If you get a compile error first try to run:
make clean
and try to build the kernel again.

How to diff 2 files or directories in linux
If you are running linux and have two files on your computer and you want to find the differences you can run the diff command in the terminal.
Let's say you have a file "hjunii/traps.c" and "kowalski/traps.c", this is how you compare them:
diff -u hjunii/traps.c kowalski/traps.c
The command will compare both and will print an output to the terminal that will be similar to this:
@@ -27,6 +27,7 @@
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/sched.h>
+#include <linux/slab.h>
 #include <linux/atomic.h>
 #include <asm/cacheflush.h>
@@ -483,25 +484,38 @@
 static inline void
 do_cache_op(unsigned long start, unsigned long end, int flags)
-	struct mm_struct *mm = current->active_mm;
-	struct vm_area_struct *vma;
 	if (end < start || flags)
+	return flush_cache_user_range(start, end);
+static inline int
+do_cache_op_iov(const struct iovec __user *uiov, unsigned long cnt, int flags)
+	int i, ret = 0;
+	unsigned long len = cnt * sizeof(struct iovec);
+	struct iovec *iov = kmalloc(len, GFP_KERNEL);
-	down_read(&mm->mmap_sem);
-	vma = find_vma(mm, start);
-	if (vma && vma->vm_start < end) {
-		if (start < vma->vm_start)
-			start = vma->vm_start;
-		if (end > vma->vm_end)
-			end = vma->vm_end;
+	if (iov == NULL) {
+		ret = -ENOMEM;
+		goto out;
+	}
-		up_read(&mm->mmap_sem);
-		flush_cache_user_range(start, end);
-		return;
+	if (copy_from_user(iov, uiov, len)) {
+		ret = -EFAULT;
+		goto out_free;
-	up_read(&mm->mmap_sem);
+	for (i = 0; i < cnt; ++i) {
+		unsigned long start = (unsigned long __force)iov[i].iov_base;
+		unsigned long end = start + iov[i].iov_len;
+		do_cache_op(start, end, flags);
+	}
+	kfree(iov);
+	return ret;
@@ -550,6 +564,10 @@
 		do_cache_op(regs->ARM_r0, regs->ARM_r1, regs->ARM_r2);
 		return 0;
+	case NR(cacheflush_iov):
+		do_cache_op_iov((const struct iovec __user *)regs->ARM_r0,
+					regs->ARM_r1, regs->ARM_r2);
 	case NR(usr26):
 		if (!(elf_hwcap & HWCAP_26BIT))

Each line starting with a "+" are lines that were added, for example:
+#include <linux/slab.h>
On the other side lines starting with a "-" are lines that were deleted, for example:
-	struct mm_struct *mm = current->active_mm;
A line like the following should just show you were you find the changes:
@@ -550,6 +564,10 @@
with the following syntax:
@@ -[line number in 1. file],[number of lines that were printed from 1.file] + [line number in 2. file], [number of lines that were printed from 2.file] @@
But the basic syntax is the following:
diff -u [base file] [file containing the changes you want to display]
You can also compare whole directories!

ProTip: Install the program "colordiff". It will color the console output, that means the output is more readable!
diff -u [base file] [file containing the changes you want to display] | colordiff
@@ -1,8 +1,8 @@
-NAME = Flesh-Eating Bats with Fangs
+NAME = "Divemaster Edition"
The Following 19 Users Say Thank You to Firtecy For This Useful Post: [ View ] Gift Firtecy Ad-Free
1st June 2014, 12:50 PM |#4  
Wooby's Avatar
Senior Member
Flag Somewhere in Poland :D
Thanks Meter: 170
Nice New kernel!
1st June 2014, 12:53 PM |#5  
Thanks Meter: 12
will try that one as soon as possible.

thanks for the work.we dont let the 2x die!
1st June 2014, 01:13 PM |#6  
Junior Member
Thanks Meter: 0
Will this work on Mokee rom?

If you don't understand the subconscious you will always bump into it calling it fate...
1st June 2014, 01:15 PM |#7  
Firtecy's Avatar
OP Senior Member
Thanks Meter: 1,123
Donate to Me
Originally Posted by themistoklisv

Will this work on Mokee rom?

If you don't understand the subconscious you will always bump into it calling it fate...

Which kernel is included by default in the Rom or can you paste a link?

Gesendet von meinem LG-P990 mit Tapatalk
1st June 2014, 01:18 PM |#8  
Junior Member
Thanks Meter: 0
[email protected]#126

If you don't understand the subconscious you will always bump into it calling it fate...
1st June 2014, 01:20 PM |#9  
Firtecy's Avatar
OP Senior Member
Thanks Meter: 1,123
Donate to Me
Originally Posted by themistoklisv

[email protected]#126

If you don't understand the subconscious you will always bump into it calling it fate...

Then I am sorry, but it is not compatible.

The 3.1 kernel differs too much to be compatible with ROMs that are build for an 2.6 kernel

Gesendet von meinem LG-P990 mit Tapatalk
1st June 2014, 04:09 PM |#10  
NoDze's Avatar
Senior Member
Flag Sarajevo
Thanks Meter: 110
Oh my God, amazing! Finally some serious development! Great work Firtecy. Time to bust CM11 back on my device and try this ramhacked wonder
1st June 2014, 05:10 PM |#11  
ivaneris's Avatar
Senior Member
Flag Todanan - Blora
Thanks Meter: 259
Oh...i see...this why no ksm settings
Btw...i would suggest a higher ramhack like 32mb like m1 ramhack...but this kernel works great so far...just classic low ram problem exist (well...obviously) need to set an aggresive value (i'm using swap without zram)
Do i need to post a logcat?

Sent from my LG-P990
The Following 2 Users Say Thank You to ivaneris For This Useful Post: [ View ] Gift ivaneris Ad-Free
Post Reply Subscribe to Thread


Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes