Android OS Forum banner

[KERNEL]GN-LTE[Hybrid-3.0.53]JB:Pre-UV,OC,TUN,CIFS,OTG,FIOPS(v024)[Nov-27]

715K views 4K replies 543 participants last post by  Amphaeon 
#1 · (Edited by Moderator)
Mod Type:: Kernel

Difficulty:: Very Easy

Mod Base:: AOSP

Mod Status:: Stable

Apply In:: CWM Recovery

Carrier:: Verizon

Optional:: Insecure Boot

Requires Root:: Yes

Optional:: Overclocked

Android Version:: 4.1.1 (JB)

Source::
NOTICE: This is COMPATIBLE with ALL Google Rooted Stock and Custom ROMs based on JellyBean (4.1x) and Ice Cream Sandwich (4.0.x)!

For frequency control use SystemTuner by 3C or SetCPU app by coolbho3k

Just a statement regarding kernel source: The Kernel Source is of course covered under GPL version 2. Free software does NOT mean no work or time was spent working on it. I have donated a large sum of my free time to hack this kernel. If you use my modified kernel source in parts or in its entirety, I kindly ask you mention its origins and to send me a github pull request or PM whenever you find bugs or think you can help improve my kernel hack further. This way the entire community will truly benefit from the spirit of open source. Thank you !

Hi RootzWiki members and fellow Samsung users:

This is my fourteenth kernel hack. I want to thank b16, and the entire RootzWiki Staff, and several others I cannot recall for inspiring me to venture into this unfamiliar territory for me.

What is a Kernel? The Kernel is the Foundation in which everything else builds upon in any software system.
[Car Analogy]: Kernel is like the Engine, Electrical system and the Transmission to a car. The Library, Framework and the Apps [AKA ROM] are the body frame and the rest of the Car.


THIS KERNEL is BASED ON Google Source Code. So it is COMPATIBLE WITH ALL AOSP ICS 4.0.1, 4.0.2 or 4.0.3 Builds.

DO NOT use any task killers, they DO NOT improve performance nor battery life. They INTERFERE with your phone's stability (more crashes) and App compatibilities (Forced Close).


Kernel Features:

So what type of kernel is this? Well, this kernel is based on Linux 3.0.y (says so from the version string) but it's really a hybrid between Linux 3.0.y and Linux 3.3+ due to many features introduced from Linux 3.3+ (for specific details on technologies, see 2nd post below!)
Features in Magenta are identical as the latest Linux 3.3-rc2

Memory Management subsystem:
-- feature SLQB allocator ( http://lwn.net/Articles/311502/ )
-- enabled memory control group (ultimate ONLY)
-- SLUB completed updated to Linux 3.3-rc2 (kernel 013+)
-- enabled KSM for CM9 Dalvik hack also completely updated to Linux 3.3-rc2 (kernel 013+)
-- vmalloc completely updated to Linux 3.3-rc2 (kernel 013+)
-- vmscan completely updated to Linux 3.3-rc2 (kernel 013+)
-- memcontrol completely updated to Linux 3.3-rc2 (kernel 013+)
-- memory compaction completely updated to Linux 3.3-rc2 (kernel 013+)
-- page writeback completely updated to Linux 3.3-rc2 (kernel 013b6+)
-- filemap completely updated to Linux 3.3-rc3 (kernel 013b8+)
-- swap/swapfile completely updated to Linux 3.3-rc3 (kernel 013b8+)
-- shmem completely updated to Linux 3.3-rc3 (kernel 013b8+)
-- memblock completely updated to Linux 3.3-rc3 (kernel 013b13+)
-- oomkill completely updated to Linux 3.3-rc3 (kernel 013b13+)

Init:
-- kernel init completely updated to Linux 3.3-rc3 (kernel 013b8+)

Core Kernel:
*** RCU:
-- completely updated to latest preemptive tree RCU to Linux 3.3-rc2 ( http://en.wikipedia....ead-copy-update )
*** Scheduler:
-- back ported select Linux 3.3+ cgroup (cpu control groups), threadgroup optimizations
-- cherry picked select NOHz optimizations from Linux 3.3+ ( http://www.phoronix....m=651&num=1 )
-- multi-threaded device initialization
-- cherry picked the new lockless list support from Linux 3.3+ ( http://lwn.net/Articles/423366/ )

Power Management:
-- cherry picked select PM optimizations from Linux 3.2+
-- cherry picked select CPUIDLE optimizations from Linux 3.3+
-- Added Two-Phase Power Savings to OnDemand Governor
-- Added screen off hotplug capability to Interactive (default), OnDemand and Conservative governors

File System:
-- DOS VFAT (read/write), NTFS (read/write), CDROM/UDF FS, CIFS+UTF-8 (windows share) all built-in
-- Filesystem writeback completely updated to Linux 3.3-rc2 (kernel 013b6+)
-- Asynchronous I/O completely updated to Linux 3.3-rc3 (kernel 013b6+)

Block I/O:
-- Deadline (default), No-op, FIOPS (back ported from Linux 3.3+), CFQ
-- Completely updated to Linux 3.3-RC3 (kernel 013b13+)
-- FIOPS version 2 (kernel 013+)

Kernel Features:
-- CleanCache Enabled ( http://lwn.net/Articles/386090/ ) (ultimate ONLY)
-- FrontSwap Enabled and updated to latest revisions slated for Linux 3.3+ (ultimate ONLY)

Device Drivers:
-- USB OTG (USB On-the-Go, aka USB Host-like support allows for external USB sticks, Keyboard/Mice)
-- DeviceMapper Cache capability ( http://sourceware.org/dm/ )
-- updated ZRAM / ZCache to latest Linux 3.3+ (compressed RAM devices) (ultimate ONLY)
-- Added Google's Snappy Compression support (alternative to LZO compression written by Google) (ultimate ONLY)
-- Patched OMAP4 Real-Time Clock with latest updates
-- Patched TWL6040 Codec with latest updates and optimization
-- ARM Berkeley Network Packet Filter Just-in-Time (JIT) compiler support ( http://en.wikipedia....y_Packet_Filter )
-- Added CM9 / Supercurio Color Gamma Hack (kernel 013b13+)

Library Support:
-- Optimized CRC32 and CRC32c with Sliced by 8 algorithm (used by TCP/IP and File Systems)
-- Optimized memcpy and string libraries (used by many things)
-- Updated IDR library to Linux 3.3-rc2 (kernel 013+)
-- more selective cherry picks from Linux 3.3-rc3 (kernel 013b8+)

ARM / OMAP architecture drivers:
-- Patched ARM VFP with latest updates (floating point optimization)
-- Patched ARM hotplug with latest updates (turning on/off CPUs)
-- Patched OMAP4 SmartReflex with latest updates (OMAP4xxx Hardware assisted Dynamic Voltage Scaler)
-- Patched ARM cache code with latest updates (L1/L2 Cache controls)
-- Asynchronous SMP initialization
-- CPU Overclocking to max 1.35GHz (with additional freq @ 1.06GHz, 810MHz and 525MHz)
-- GPU Overclocking to 384 MHz from 307 MHz (ultimate ONLY)

Kernel Tweaks:

Force USB (fast) charge profile:
Code:
<br />
echo 1 > /sys/kernel/fast_charge/force_fast_charge (enable)<br />
echo 0 > /sys/kernel/fast_charge/force_fast_charge (disable)<br />
Gamma Adjustments: (default 60 for all three)
Code:
<br />
echo xx /sys/class/misc/samoled_color/red_v1_offset<br />
echo xx /sys/class/misc/samoled_color/green_v1_offset<br />
echo xx /sys/class/misc/samoled_color/blue_v1_offset<br />
Color Multiplier Adjustments:
Code:
<br />
echo xx /sys/class/misc/samoled_color/red_multiplier<br />
echo xx /sys/class/misc/samoled_color/green_multiplier<br />
echo xx /sys/class/misc/samoled_color/blue_multiplier<br />
Original Color Multiplier values for reference just in case of accidents

(use any file manager and view those files as text)
Code:
<br />
/sys/class/misc/samoled_color/red_multiplier_original<br />
/sys/class/misc/samoled_color/green_multiplier_original<br />
/sys/class/misc/samoled_color/blue_multiplier_original<br />
Installation Instructions:

*** JELLYBEAN 4.2.0 System Image ***
[ CFS ] (Mainline Edition - should work with ALL phones)
The File == Tuna JellyBean kernel == (GPU @ 384 MHz)

[ CFS ] (Mainline SmartReflex Edition - should work with ALL phones)
The File == Tuna JellyBean kernel == (GPU @ 384 MHz)

[ CFS ] (Ultimate Edition - should work with ALL phones but at a higher battery cost!)
The File == Tuna JellyBean kernel == (User UV Control, Enabled GPU Overclock to 512 MHz)

[ CFS ] (Ultimate SmartReflex Edition - should work with ALL phones but may require BootLoop Calibrations!)
The File == Tuna Jelly Bean kernel == (Enabled SmartReflex 1.5, Enabled GPU Overclock to 512 MHz)

*** JELLYBEAN 4.1.0 System Image ***
[ CFS ] (Mainline Edition - should work with ALL phones)
The File == Tuna JellyBean kernel == (GPU @ 384 MHz)

[ CFS ] (Mainline SmartReflex Edition - should work with ALL phones)
The File == Tuna JellyBean kernel == (GPU @ 384 MHz)

[ CFS ] (Ultimate Edition - should work with ALL phones but at a higher battery cost!)
The File == Tuna JellyBean kernel == (User UV Control, Enabled GPU Overclock to 512 MHz)

[ CFS ] (Ultimate SmartReflex Edition - should work with ALL phones but may require BootLoop Calibrations!)
The File == Tuna Jelly Bean kernel == (Enabled SmartReflex 1.5, Enabled GPU Overclock to 512 MHz)

*** ICE CREAM SANDWICH 4.0.3/4 System Image ***
[ CFS ] (Mainline Edition - should work with ALL phones! GPU Max Clock @307MHz)
The File == Tuna ICS kernel ==

[ CFS ] (Ultimate Edition - should work with ALL phones but at a higher battery cost!)
The File == Tuna ICS kernel == (Enabled Memory resource control, Enabled GPU Overclock to 384 MHz)

[ CFS ] (Ultimate SmartReflex Edition - should work with ALL phones but may require BootLoop Calibrations!)
The File == Tuna ICS kernel == (Enabled SmartReflex 1.5, Enabled Memory resource control, Enabled GPU Overclock to 384 MHz)

Here's a step by step instruction to install this kernel:

1. download the above file (via phone directly or to a PC)
2. copy the downloaded zip file to /sdcard/download/
3. Open ROM Manager and select "Reboot into Recovery" and select "OK"
4. Once in recovery, select "wipe cache partition", select "Yes", then select "advanced", then select "Wipe Dalvik Cache", then select "Yes" again. Once finished, click the back button to go back to the main recovery menu. On that menu, select "Install Zip From SDCad", then select "Choose zip from SDCard", then go to /sdcard/download and select the downloaded zip file and let it run its script.
5. Once the script is done, select "reboot system now"

Note: After FLASHING, the first reboot may take longer than usual, please be patient... After the first reboot, it may lag during initial load (let everything finish loading). Once everything is loaded and phone is ready for use, reboot the phone a 2nd time and the lag will be gone and everything should be silky smooth...


[ Advanced Users: ]

[ Optional: ]

If you encountered any funny / weird / strange issues coming from other than 100% pure stock ROMs or my kernels, the following "Reset Kernel" will restore the kernel to its Original Stock Settings.
After applying the reset kernel, then load my latest kernel again.


*** ICE CREAM SANDWICH 4.0.1 System Image ***
Upgrade to 4.0.2 image from Google (http://code.google.c...ages.html#yakju)

*** ICE CREAM SANDWICH 4.0.2 System Image *** (NOTE: Kernel 013 is the FINAL UPDATE for ICS 4.0.2)
Upgrade to 4.0.4 image from Google (http://code.google.c...ages.html#yakju)


*** JellyBean -- RESET KERNEL (FOR STOCK BASED ROM ONLY. FOR CM SIMPLY REFLASH THE LATEST NIGHTLY, then FLASH my KERNEL AFTERWARDS) ***

http://faux.androidr...eset-Kernel.zip

*** ICS 4.0.2 -- RESET KERNEL ***

ICS 4.0.2 Reset Kernel

*** ICS 4.0.3 -- RESET KERNEL ***

ICS 4.0.3 Reset Kernel

*** ICS 4.0.4 -- RESET KERNEL ***

ICS 4.0.4 Reset Kernel

*** CM9 4.0.4 -- RESET KERNEL ***

http://faux.androidr...eset-Kernel.zip

[ For Kernel Devlopers ONLY: ]

NEWS BULLETIN:

Version 021 is OUT! With optional SmartReflex automatic UV!!!

Please don't hesitate to talk among yourselves and help each other out... The RootzWiki community is what inspired me to hack kernels for everyone since everyone here is nice and helpful to each other... Keep helping each other.... Famous proverb: It's better to give than to receive...

BUGS:

Not All CHIPS ARE CREATED EQUAL

TO DO:

version 0.x.x -- more to come...

History:

See Post below...

Standard Disclaimer: Not responsible for bricking your phone, voiding your warranty, or any other pain or suffering you may feel as result of using this kernel!!!


My github Complying with GPL and RW rulez


Follow me on :

If you find this Kernel useful, feel free to hit the [Thanks] button below
 
See less See more
4
#2 · (Edited by Moderator)
Technologies:

FIOPS Scheduler (Optimized for FLASH based devices)

traditionally, linux ships I/o schedulers designed for rotational devices (harddrives) but nowadays, with SSD and Android (emmc/sdcard), Flash devices are becoming more and more popular. older I/O schedulers were design to hide the latencies of the rotational devices but those latency hiding techniques do NOT work well with FLASH based devices thus leading to poor write performance. Intel is the leading manufacturer of SSD devices, so it is in their interest to show off their wares but they are hampered by the existing I/O schedulers. so one of their open source engineer designed a new I/O scheduler based on existing CFQ I/O scheduler but designed from specifically for Flash based devices. What he did was to take out all the rotational device optimizations and techniques which are obsolete or irrelevant for flash based devices and replaced them with Flash specific optimization. unfortunately, the new I/O scheduler was designed for Linux-Next (the latest and greatest Linux experimental build) I spent an afternoon backporting (adapting and changing) the code designed for Linux Next to Linux 3.0.x kernels (the one we use for Galaxy Nexus).

CleanCache/FrontSwap (via ZCache backend)

Cleancache provides a place where the kernel can put pages which it can afford to lose, but which it would like to keep around if possible. A classic example is file-backed pages which are clean, so they can be recovered from disk if need be. The kernel can drop such pages with no data loss, but things will get slower if the page is needed in the near future and must be read back from disk. Like Cleancache, Frontswap can play tricks with the stored pages to stretch its memory resources. The real purpose behind this mechanism, though, appears to be to enable a hypervisor to respond quickly to memory usage spikes in virtualized guests. Dan put it this way:
Frontswap serves nicely as an emergency safety valve when a guest has given up (too) much of its memory via ballooning but unexpectedly has an urgent need that can't be serviced quickly enough by the balloon driver.

ZRAM (aka CompCache aka RAMZSwap - NOT IMPLEMENTED)

ZRAM is an updated version formally known as CompCache and RAMZSwap. It was originally designed for 2.6.38.xx kernels, I have backported to our 2.6.35.xx kernel. ZRAM allows real-time compression of memory objects in RAM thus reducing memory pressure for the Linux kernel and can keep more apps in memory longer (more apps in RAM == better performance, less fetching from slower MMC or SDCard). Compression, however, is not Free. Some CPU cycles are required to do the compress/decompression, so there's a slight penalty for it. The original CompCache / RAMZSwap required a user space binary to control its behavior which adds additional penalty to performance, but the new version ZRAM eliminated the need for a separate dedicated daemon, thus reducing the overhead and increased performance from the old CompCache by 20%. Therefore, with the newer implementation of ZRAM interface, the performance penalty is almost negligible.


Joe's RCU (Optimized for Small SMP systems - NOT IMPLEMENTED)

Joe Korty has created an RCU for small SMP systems (> 32 cores). His approach is to isolate all the Garbage Collection (GC, a slow time consuming but necessary processing) to a single core, thus allowing other cores to ONLY work on real required processing. This will allow the additional cores to complete their assigned tasks as fast as possible (not bogged down by GC) then immediately go back to a suspended state (saving battery).

Fast No Hz RCU (Optimized for SMP operations)

Fast NoHz is an optimized version of the traditional Tree RCU. Many new kernels are using the Tickless NoHz design. This RCU is tailored and designed to work with the new NoHz kernel system.

SmartAssV2 Governor (Balanced -- NOT IMPLEMENTED)

This governor has a built-in "profile" similar to SetCPU, so screen off will use lower clock rate thus conserve more battery, but it also has a fast wake up feature so that user interaction will not see the lag when switching from Sleep to Wake state.... (So SetCPU Profiles are sorta redundant when using this governor, you can still use SetCPU to OC to higher than default Clock frequency).

Interactive Governor (Performance)

This governor is designed to put more priority to User Interface (UI aka Apps) tasks, therefore appears more responsive then the traditional OnDemand governor. So if you want the smoothest UI interaction, this governor is for you...

Brain F*ck Scheduler - (BFS -- NOT IMPLEMENTED)

This scheduler is designed to be simple and speedy tailor specifically for user interface type systems such as desktop/smart phone devices where user interaction is MORE important than serving 1 million web requests (CFS, the default scheduler) at the same time (think of nimble desktop workstations vs large corporate servers).

SLQB - (SLAB allocator with Queue)

This memory allocator is designed for small number of CPUs system (such as desktop or smart phone devices). This allocator is design to be simple and it is optimized for using order-0 pages as much as possible (order-0 pages are the simplest therefore quickest type of memory in a Linux system to allocate). Not all kernels are using SLQB including CM7 main line...

Fair Budget Queue (BFQ I/O scheduler)

This I/O scheduler is an improvement on top of Completely Fair Queue (CFQ). CFQ is fair in terms of time but not in terms of throughput / bandwidth, so BFQ make sure that both time and throughput / bandwidth are balanced across all requests.[/size]
 
#4 ·
Awesome, thanks a lot for this, faux!

Couple questions..
I know it says that it's compatible with all galaxy nexus roms/custom roms.. does that include any build? 4.0.1, 4.0.2, and 4.0.3? I ask because so far, it seems each kernel is built for specific builds, so i'm curious if this works on all of them..

Also, I apologize if I missed this info somewhere in your post.. I am generally a pretty tech-savvy guy, but I am no developer, so some of this was lost on me, and I may have skipped over something within the technical jargon that I didn't understand. What are the overclock frequencies available for CPU/gpu? 1400mhz or 1350mhz seems to be standard for most cpu overclocking right now. 384mhz for gpu.. but, I did read where coolbho3000 clocked the gpu at 512mhz and had it running without problems, so I didn't know if maybe it was clocked at another frequency.

Again, sorry if I just missed this. I read over everything I could understand, and a lot that I didn't understand.

Thanks again..
 
#13 · (Edited by Moderator)
It seemed with the OMAP architecture, the kernel needs to be matched to the userspace side, that's why 4.0.1 kernels won't work with 4.0.2/3 system images and 4.0.3 kernels won't work with older 4.0.1/2 system images. In the download section I have specified to only 4.0.3 images. I will update my thread info/title.

Sorry to break the news to you, as cool as coolbho3k is, his patches for CPU OC and UV both have problems, I originally used his patches in my older releases I have since reverted them both.

Coolbho3k's CPU OC has issues with 1.4 GHz... I have implemented my own @ 1.35 using different settings. My teammates have tested my version and it does not have any of the slow down lag issues at the highest speed.
Coolbho3k's CPU UV has issues as well. When you undervolt below min core vdd, the Dynamic Voltage Frequency Scaler (DVFS) will report error and stall thus not scaling down to lowest possible OPP state (this can be verified by all the errors in dmesg log). Once you stalled DVFS, all the benefits from Undervolt is immediately wiped out because you are stuck at a higher frequency. For now I have implemented my own undervolt which pre-UV @ -100mv across the board and again this has been tested under various conditions and it's been rock solid (no DVFS stalls).

I will address BOTH issues further with my subsequent releases.

As for as 4.0.2 compatibility, Google has skipped over 4.0.2 kernel source and released the absolute latest 4.0.3 (which includes 4.0.2 updates), so unless someone point out to me the exact patches needed for 4.0.2, there's nothing I can do for it. Either update to 4.0.3 using some unofficial AOSP builds by all these wonderful ROM developers or wait for Google to update to 4.0.3 officially.
 
#19 ·
It seemed with the OMAP architecture, the kernel needs to be matched to the userspace side, that's why 4.0.1 kernels won't work with 4.0.2/3 system images and 4.0.3 kernels won't work with older 4.0.1/2 system images. In the download section I have specified to only 4.0.3 images. I will update my thread info/title.

Sorry to break the news to you, as cool as coolbho3k is, his patches for CPU OC and UV both have problems, I originally used his patches in my older releases I have since reverted them both.

Coolbho3k's CPU OC has issues with 1.4 GHz... I have implemented my own @ 1.35 using different settings. My teammates have tested my version and it does not have any of the slow down lag issues at the highest speed.
Coolbho3k's CPU UV has issues as well. When you undervolt below min core vdd, the Dynamic Voltage Frequency Scaler (DVFS) will report error and stall thus not scaling down to lowest possible OPP state (this can be verified by all the errors in dmesg log). Once you stalled DVFS, all the benefits from Undervolt is immediately wiped out because you are stuck at a higher frequency. For now I have implemented my own undervolt which pre-UV @ -100mv across the board and again this has been tested under various conditions and it's been rock solid (no DVFS stalls).

I will address BOTH issues with my subsequent releases.

As for as 4.0.2 compatibility, Google has skipped over 4.0.2 kernel source and released the absolute latest 4.0.3 (which includes 4.0.2 updates), so unless someone point out to me the exact patches needed for 4.0.2, there's nothing I can do for it. Either update to 4.0.3 using some unofficial AOSP builds by all these wonderful ROM developers or wait for Google to update to 4.0.3 officially.
A true knowledgeable developer. I thank you for the clarifications.
 
#18 ·
Probably not any time soon. My kernels have been tested quite extensively internally by my teammates. Right now there are no major breakage or missing functionalities. I have brought some of the latest technologies from Linux-Next into this kernel and introduced quite a few enhancements and fixed bugs (CPU OC/UV). It is quite stable... I am currently researching on more advanced OC/UV capability for GPU/CPU plus additional patches from Linux-Next... but those won't be available for public consumption for a while.
 
#17 ·
No, it's only when you use the OTG functionality. Google has disabled OTG mass storage capability (USB Sticks, harddrive etc) at the last second right before release of ICS. It probably conflicts with their decision to use MTP/PTP for internal storage. Not sure when OTG Mass Storage will be restored by Google, I am sure they have their reasons.
 
#22 ·
faux123 said:
No, it's only when you use the OTG functionality. Google has disabled OTG mass storage capability (USB Sticks, harddrive etc) at the last second right before release of ICS. It probably conflicts with their decision to use MTP/PTP for internal storage. Not sure when OTG Mass Storage will be restored by Google, I am sure they have their reasons.
Gotcha, but we can mount the internal storage to a computer just fine? Forgive my ignorance, I have yet to even receive my Nexus and am still trying to learn.
 
#23 · (Edited by Moderator)
Internal "SDCard" (it's really a virtual SDCard) will be mounted as MTP under Windows or PTP using Linux. It will behave exactly like a drive under those operating systems. The only difference between MTP/PTP and regular USB Mass Storage is you don't get a drive letter assignment under windows... which may cause some issues of some of the older programs which need a "drive letter" to access them...
 
#24 ·
faux123 said:
Internal "SDCard" (it's really a virtual SDCard) will be mounted as MTP under Windows or PTP using Linux. It will behave exactly like a drive under those operating systems. The only difference between MTP/PTP and regular USB Mass Storage is you don't get a drive letter assignment under windows... which may cause some issues of some of the older programs which need a "drive letter" to access them...
Good thing I don't use windows


I appreciate it! Always nice to have a developer around that explains these things to people
 
#34 ·
Thank you for all of your hard work. However, I am having some troubles getting this to work. I have 4.0.2, rooted, CWM, and HD revolution 2.1.1.

I then wipe cache/dalvik, installed kernal. I then wipe and installed 4.0.3 by birdman then flashed Gapps. What is the correct order to get this kernal and 4.0.3 system working?
 
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top