[KERNEL][ROOT]The Ultimate Kernel for the HTC Desire 500

Search This thread

dummie999

Senior Member
Mar 2, 2014
721
413
The Ultimate kernel for the HTC Desire 500, both one sim and dual sim!
Software version 1.32/1.26 only! It probably won't work on earlier versions, but it might work on later versions (1.34), I haven't tested that.

Use at your own risk!

Features:
  • /system write protection removed
  • two new frequencies added: 1300 and 1400 mhz
  • init.d support
  • intelli_plug
  • sweep2sleep
  • sweep2wake and doubletap2wake, both with pocket detection
  • ntfs read/write support
  • Governors added: SmartassV2 and Lulzactive
  • ioschedulers added: sio and fiops Default: sio
  • Fastcharge
  • Unsecure (ro.secure=0)

If you don't want to overclock your device, then simply choose the download link with no overclocking.

Requirements:
  • Unlocked bootloader
  • Custom recovery (cwm or twrp)
  • Fastboot installed


Installation instructions:
  • Download the latest boot.img
  • Boot your phone into fastboot mode
  • Open up your commandline
  • cd to the directory containing the boot.img
  • In the command line type: fastboot flash boot boot5.img
  • Boot into cwm/twrp
  • Wipe cache and dalvik-cache
  • If you don't have it yet (your phone is not rooted), flash SuperSU or superuser


Downloads:
Version 8: Not overclocked: boot8_no_oc.img, Overclocked: boot8_oc.img
Version 7: Not overclocked: boot7_no_oc.img, Overclocked: boot7_oc.img
Version 6: boot6.img
Version 5: boot5.img
Version 4: boot4.img
SuperSU: SuperSU
If your phone does not boot after installing an overclocked kernel, then try installing the not overclocked kernel.

Changelog:
Version 8:
  • Removed the underclocking, it was way too low, and caused wakeup issues
  • Added 1300 mhz frequency
  • Updated intelli plug from faux123's github
  • Updated to 1.34, many thanks to @0lvin
  • Little fixups on sweep2wake/doubletap2wake

Version 7:
  • Added overclocking up to 1400 mhz
  • Underclocking down to 19 mhz
  • Added sweep2wake and doubletap2wake
  • Added intelli plug, a replacement for Qualcomm's closed source mpdecision
  • Enabled perflock again
Version 6:
  • Add fastcharge
Version 5:
  • Disabled -O3 optimization
Version 4:
  • -O3 optimization
  • ntfs read/write support
  • Governors added: SmartassV2 and Lulzactive
  • ioschedulers added: sio and fiops Default: sio

Version 3 and below:


Kernel source:


Credits:
@flar2 for sweep2sleep
@xpirt for helping me with Smartass
@GreatEmerald for helping me with kernels in general ;)
@eexter for testing for 1.26
@0lvin for updating to 1.34

To the devs:
Feel free to include this kernel in your rom/rooting tool. Just give proper credits and put a link to this thread in your rom thread (Required for GPL).

XDA:DevDB Information
The Ultimate Kernel, Kernel for the HTC Desire 500

Contributors
dummie999, 0lvin
Kernel Special Features: dt2w | s2w | intelli_plug | fastcharge | oc | init.d

Version Information
Status: Stable

Created 2014-10-14
Last Updated 2014-10-14
 
Last edited:

dummie999

Senior Member
Mar 2, 2014
721
413
Tips

How to change sleep/wake options:
The options for sweep2sleep, sweep2wake and doubletap2wake:
sweep2sleep: 0 - disabled, 1 - enabled, both directions, 2 - enabled, left->right only, 3 - enabled, right->left only
sweep2wake: 0 - disabled, 1 - enabled, both directions, 2 - enabled, left->right only, 3 - enabled, right->left only
doubletap2wake: 0 - disabled, 1 - enabled, full screen, 2 - enabled, bottom half screen, 3 - enabled, center down of the screen (hope you get it)
To change the options, put a script in /system/etc/init.d:
Code:
#!/bin/sh
echo "0" > /sys/android_touch/sweep2sleep
echo "0" > /sys/android_touch/sweep2wake
echo "0" > /sys/android_touch/doubletap2wake
This setting disables all the sweep/wake options
Code:
#!/bin/sh
echo "1" > /sys/android_touch/sweep2sleep
echo "1" > /sys/android_touch/sweep2wake
echo "2" > /sys/android_touch/doubletap2wake
This setting enables sweep2sleep and sweep2wake, and enables doubletap2wake bottom half of the screen

How to use fastcharge:
If you charge your phone via usb (from your computer) then it will only charge at 500mA even while most usb ports are capable of supplying 1000mA. Enabling fastcharge will allow your phone to charge at 1000mA via usb.
!!! Warning: you must be sure your usb can supply 1000mA !!!

Fastcharge is disabled by default. You can enable it in 2 different ways:
1. Writing a 1 to /sys/kernel/fast_charge/force_fast_charge. You can do this with a text editor, or with a script in init.d (see above)
2. Or you can simply install an app. I tested Fast Charge by Mathew Winters and Fast Charge by Chris Conley, both worked.
To hard? Use this app by Ufonek: Kernel Settings


A word about governors:
Some governors lower the frequencies to fast. For example, when I play angry birds when using lulzactive, the phone laggs a lot. This is, however, not the fault of the kernel, but the fault of the way the governor is tweaked. It is the price you pay for the better battery life you have. If you want to do something about it, tweak your governor, there are a lot of tutorials about this.
Don't come here complaining the phone laggs, and that I should fix it, I won't, because I can't. Everyone has his own preferences, and if you can't live with this, then I recommend you use the ondemand governor.
 
Last edited:

dummie999

Senior Member
Mar 2, 2014
721
413
Compilation instructions

Instructions for compiling the kernel yourself.

Prerequisites:
1. A linux computer
2. Basic bash knowledge
3. ~120 MB free space
4. The android-eabi toolchain:
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6 for 4.6
(use darwin-x86 instead of linux-x86 for mac)
And then add it to your $PATH (You need to have the arm-eabi-4.6/bin folder in your path)

Instructions:
1. Download the kernel source
2. Open the cmdline and cd to the directory with all the files (Documentation, arch, block etc.)
3. type: make dummie_z4u_defconfig
4. type: make menuconfig
........A menu will open, and you can change some settings. If you want everything to be the way I built it, then skip this step.
5. type: make
The actual building will begin.

Troubleshoot:
If you run into a python problem, you might want to change, in android_kernel_htc_z4u/scripts/gcc-wrapper.py this:
"#! /usr/bin/env python" into "#! /usr/bin/env python2", credits @svalo

If the building succeeds, then you will find the file zImage in arch/arm/boot.

Next step: turn the zImage into a boot.img
1. Download imgtools, and add it to you $PATH
2. Download my boot.img
3. Open cmdline, cd to the directory containing boot.img and type: unpack boot.img
........You will end up with: ramdisk.cpio.gz, ramdisk and zImage (and the boot.img that was already there)
4. Replace the zImage with the zImage you build earlier (arch/arm/boot)
5. Rebuild the kernel:
Code:
repack_ramdisk ramdisk initramfs.cpio.gz
mkbootimg --kernel zImage --ramdisk initramfs.cpio.gz --base 0x3b00000 --cmdline 'no_console_suspend=1 console=null' -o new_boot.img
You will now see a file called new_boot.img, containing your own kernel, which you can install the very same way

Good luck:good:
 
Last edited:

GreatEmerald

Senior Member
Jan 14, 2014
68
12
Vilnius
Note that -O3 does not work for the kernel, at all, and never has. You can set it but it won't do anything. The compiler will still use -O2, because all the parts where performance matters are written in assembly or through GCC-specific extensions already. There is nothing that automatic code optimisation would improve. Meanwhile -O3 enables non-safe options that can result in imprecise calculations, which can lead to disasters in things that are as important as the kernel. So you should disable that.
 
  • Like
Reactions: dummie999

dummie999

Senior Member
Mar 2, 2014
721
413
Note that -O3 does not work for the kernel, at all, and never has. You can set it but it won't do anything. The compiler will still use -O2, because all the parts where performance matters are written in assembly or through GCC-specific extensions already. There is nothing that automatic code optimisation would improve. Meanwhile -O3 enables non-safe options that can result in imprecise calculations, which can lead to disasters in things that are as important as the kernel. So you should disable that.

Then why do people use it?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 31
    The Ultimate kernel for the HTC Desire 500, both one sim and dual sim!
    Software version 1.32/1.26 only! It probably won't work on earlier versions, but it might work on later versions (1.34), I haven't tested that.

    Use at your own risk!

    Features:
    • /system write protection removed
    • two new frequencies added: 1300 and 1400 mhz
    • init.d support
    • intelli_plug
    • sweep2sleep
    • sweep2wake and doubletap2wake, both with pocket detection
    • ntfs read/write support
    • Governors added: SmartassV2 and Lulzactive
    • ioschedulers added: sio and fiops Default: sio
    • Fastcharge
    • Unsecure (ro.secure=0)

    If you don't want to overclock your device, then simply choose the download link with no overclocking.

    Requirements:
    • Unlocked bootloader
    • Custom recovery (cwm or twrp)
    • Fastboot installed


    Installation instructions:
    • Download the latest boot.img
    • Boot your phone into fastboot mode
    • Open up your commandline
    • cd to the directory containing the boot.img
    • In the command line type: fastboot flash boot boot5.img
    • Boot into cwm/twrp
    • Wipe cache and dalvik-cache
    • If you don't have it yet (your phone is not rooted), flash SuperSU or superuser


    Downloads:
    Version 8: Not overclocked: boot8_no_oc.img, Overclocked: boot8_oc.img
    Version 7: Not overclocked: boot7_no_oc.img, Overclocked: boot7_oc.img
    Version 6: boot6.img
    Version 5: boot5.img
    Version 4: boot4.img
    SuperSU: SuperSU
    If your phone does not boot after installing an overclocked kernel, then try installing the not overclocked kernel.

    Changelog:
    Version 8:
    • Removed the underclocking, it was way too low, and caused wakeup issues
    • Added 1300 mhz frequency
    • Updated intelli plug from faux123's github
    • Updated to 1.34, many thanks to @0lvin
    • Little fixups on sweep2wake/doubletap2wake

    Version 7:
    • Added overclocking up to 1400 mhz
    • Underclocking down to 19 mhz
    • Added sweep2wake and doubletap2wake
    • Added intelli plug, a replacement for Qualcomm's closed source mpdecision
    • Enabled perflock again
    Version 6:
    • Add fastcharge
    Version 5:
    • Disabled -O3 optimization
    Version 4:
    • -O3 optimization
    • ntfs read/write support
    • Governors added: SmartassV2 and Lulzactive
    • ioschedulers added: sio and fiops Default: sio

    Version 3 and below:


    Kernel source:


    Credits:
    @flar2 for sweep2sleep
    @xpirt for helping me with Smartass
    @GreatEmerald for helping me with kernels in general ;)
    @eexter for testing for 1.26
    @0lvin for updating to 1.34

    To the devs:
    Feel free to include this kernel in your rom/rooting tool. Just give proper credits and put a link to this thread in your rom thread (Required for GPL).

    XDA:DevDB Information
    The Ultimate Kernel, Kernel for the HTC Desire 500

    Contributors
    dummie999, 0lvin
    Kernel Special Features: dt2w | s2w | intelli_plug | fastcharge | oc | init.d

    Version Information
    Status: Stable

    Created 2014-10-14
    Last Updated 2014-10-14
    5
    Small update: added fastcharge
    Download in OP
    4
    Compilation instructions

    Instructions for compiling the kernel yourself.

    Prerequisites:
    1. A linux computer
    2. Basic bash knowledge
    3. ~120 MB free space
    4. The android-eabi toolchain:
    git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6 for 4.6
    (use darwin-x86 instead of linux-x86 for mac)
    And then add it to your $PATH (You need to have the arm-eabi-4.6/bin folder in your path)

    Instructions:
    1. Download the kernel source
    2. Open the cmdline and cd to the directory with all the files (Documentation, arch, block etc.)
    3. type: make dummie_z4u_defconfig
    4. type: make menuconfig
    ........A menu will open, and you can change some settings. If you want everything to be the way I built it, then skip this step.
    5. type: make
    The actual building will begin.

    Troubleshoot:
    If you run into a python problem, you might want to change, in android_kernel_htc_z4u/scripts/gcc-wrapper.py this:
    "#! /usr/bin/env python" into "#! /usr/bin/env python2", credits @svalo

    If the building succeeds, then you will find the file zImage in arch/arm/boot.

    Next step: turn the zImage into a boot.img
    1. Download imgtools, and add it to you $PATH
    2. Download my boot.img
    3. Open cmdline, cd to the directory containing boot.img and type: unpack boot.img
    ........You will end up with: ramdisk.cpio.gz, ramdisk and zImage (and the boot.img that was already there)
    4. Replace the zImage with the zImage you build earlier (arch/arm/boot)
    5. Rebuild the kernel:
    Code:
    repack_ramdisk ramdisk initramfs.cpio.gz
    mkbootimg --kernel zImage --ramdisk initramfs.cpio.gz --base 0x3b00000 --cmdline 'no_console_suspend=1 console=null' -o new_boot.img
    You will now see a file called new_boot.img, containing your own kernel, which you can install the very same way

    Good luck:good:
    3
    This kernel is ready to use with 1.34.401.1 ?
    I haven't tested it myself, but people said it is ready to use.
    Best kernel ever!
    Can You add voice rec option? And can we expect version8 with lag fix?
    I can't get it working.
    Yes.
    2
    Upcoming features

    * Intellidemand (implemented - needs tweaking)
    * F2FS