[DEV][N5110][KERNEL] kexec-hardboot derivated method explained and kernel patch - Galaxy Note 8.0 (Tablet) Android Development

Hi,
No access to dev subforum. Admin, please can you move it ?
This article can be usefull for developpers on other devices where kexec-hardboot does not work.
This derivated method could be an alternative.
This post follow this one http://forum.xda-developers.com/showthread.php?t=2558783 to give details about kernel patch to add this fonctionnality.
To understand the method used by mkasick, you can read this thread : http://forum.xda-developers.com/showthread.php?t=1266827. You can read also Tassadar explaination post here : http://forum.xda-developers.com/showthread.php?t=2104706
The important information is that, after a reboot, a part of the memory is not erased and then can be used to store data.
On stock distrib, this feature is used to keep previous kernel messages and make them readable from userspace in /proc/last_kmsg.
The kexec-harboot method was to use this feature to store kernel and initrd (and atags param) in a part of memory that will survice a reboot.
kexec comes in to part : a kernel syscall and a userspace programm.
On regular PC with Linux distrib, usually, when we want to restart quickly to another kernel, we do two steps :
- a first call to kexec program from userspace to load kernel/initrd into memory : kexec syscall is called and store all pages anywhere in free virtual pages. kexec kernel keep an index to know how to reorder all the pages to put them in real physical destination, when it will be time to jump to the new kernel.
- a second call to kexec (kexec -e) from userspace to switch to the new kernel : kexec syscall prepare the shutdown of all internal stuff ( flushing memory cache in TLB, disabling MMU, reseting cpu... ). At the very end of the process, just before jumping to the new kernel, all pages previously stored everywhere in memory are relocated to there final destination. This relocation process is done after mmu disabled. Just after relocation, new kernel is ready and kexec jump to first entry.
This process did not work well on android devices because some internal devices where not properly shutdown. That's why mkasick had the brilliant idea to store the new kernel in non flushed memory after reboot.
kexec-hardboot change the last action of kexec (jump to new kernel) by a reboot. After reboot (all internal devices are in a proper state), the second part of the patch verify if a kexec kernel has been previously loaded and if yes, jump to it, instead of the regular one.
( atags copy is also done there ).
I tried to apply this method on our Galaxy Note 8, everything was fine (reboot asm code, hardboot patch) except one blocking issue : the disable MMU code in kernel for our exynos4412 seems to not work well and hangs the system.
To solve this issue my idea was the following : If kexec can not do all the stuff and especially the relocation stuff, just do it by yourself : Instead off calling first time kexec to load kernel in non contigus virtual pages and creates index for relocation, we will write a userspace procedure to load directly the kernel at the physical final destination.
The only prerequisite will be to reserve enough physical memory at boot time. In the attached kernel patch, I reserve 32M of memory but, theorically, 8M could be enough for roms booting ( 8M limitation of boot.img block device).
Reserving more space is usable in case we want to play with bigger initrd. A lot of more memory can be reserved if needed.
To conclude, the method is as follow :
- Patch kernel to add hardboot patch
- Patch kernel to add Memory reservation at boot time ( bootmem allocator )
- Replace all kexec work by a userspace program to load kernel/initrd/atags directly to destination​I think this method can be applied easily to almost all android devices, as far as they support /proc/last_kmsg.
References/credits :
mkasic : kexec-hardboot creator
Tassadar : multirom creator - nice kexec-hardboot explainations​
Philippe,

Related

Gkernels 1.5 FINAL

For use with Streak Gingerbread Roms
Edit 12-7-11
This is the marked end of Gkernels project,
Gkernels 1.5 FINAL
but the marked beginning of Gxkernels!
Changes to 1.5 include:
Bumped the Dell source to 2.6.35.14 -Stable
Removed QoS in networking for reasons clear to my mind
Flashable zip here: http://db.tt/JuCSscC8
Developer tar.gz here: http://db.tt/pNkHIPRQ
Special thanks to you, the user of Gkernels!
-G
Edit 12-4-11
Gkernels1.4.3.1 now a flashable zip from your recovery, for easy installs!
lex parsimoniae
Special thanks going to _n0p_ for this method!
Download link here:http://db.tt/XrDJQ6Jv
to install:
copy the zip to sdcard, launch recovery in your streak, flash the zip file
for future releases, I will include the standard Gkernels tar.gz for rom developers, and also the flashable zip file, as two separate links for the community.
-Greg
Edit 12-3-11
GKERNELS1.4.3.1
Built with an older toolchain arm-eabi-4.3.1
Changes from 1.4.0.1 include:
<*> General filesystem local caching manager
<*> Filesystem caching on files
Wifi-
<*> Common routines for IEEE802.11 drivers
--- Bluetooth subsystem support
[*] L2CAP Extended Features support (EXPERIMENTAL)
networking options-
[*] IP: multicasting
[*] IP: ARP daemon support
Qos service changed-
<*> Hierarchical Fair Service Curve (HFSC)
---removed from 1.4.0.1 version---
adjust priority to speedup resume thread, (seems to help with wifi issue, special thanks DSC-Team)
Again, no overclocking;
Download Link here: http://db.tt/0vlfvlaI
Edit 11-27-11
1.4.0.1
changes since 1.3.3:
Suspend sleep mode (Power collapse suspend)
Control the low power modes of memory
Default Memory Low Power Mode during Idle (Memory in retention)
Default Memory Low Power Mode during Suspend (Memory in deep power down)
Enable standalone power collapse
Android RAM Console Enable error correction
Virtual Contiguous Memory (VCM) Layer
Download link: http://db.tt/ZnaqJ9qH
I am fairly certain wifi freeze issue is resolved. Further testing is needed to prove this;
Enjoy!
-Greg
Gkernels 1.3.3 still attached below
Gkernels 1.3.3
changes from Gkernels1.0
Enable WiFi control function abstraction
Preallocate memory for WiFi buffers
Enable KSM for page merging
Use kernel mem{cpy,set}() for {copy_to,clear}_user() (EXPERIMENTAL)
I've got some under-volting going on with static voltage regulator
kernel switched to low resolution timer
Cross-Compiled using arm-eabi-4.4.3 from Dell 4.05 source, thanks given to Dj Steve for his tip with wifi practices. Thanks going out to kernel cross-compiling sources and books; thanks to all the rom chefs;
To me, Streak kernel work is more of an art than a science. Include Gkernels in your rom; do what you feel with it, all is permitted.
Installation Instructions
Method 1:Assumption is on a linux distro,
obtain a prebuilt fastboot and adb binary, and get them into your /bin folder, to use the commands from anywhere within your system
download Gkernels1.3 and extract, if you have not already done so.
attach streak to computer with usb cable;
from the extracted archive directory run this command in terminal:
sudo adb reboot bootloader
the streak will then boot into the fastboot mode
Then:
fastboot -i 0x413c flash boot boot.img
Then:
fastboot -i 0x413c reboot
then from same directory, run this command as phone is rebooting:
sudo adb push dhd.ko /system/lib/modules
I then recommend rebooting one more time.
Method 2: Any system
Re-substitute the boot.img and dhd.ko in the archive, by replacing same files, in your chosen rom's update zip;
transfer to the device
then flash as you would, the rom using your prior flashed recovery.
Thanks to Delirium77!
Method 3: Bypass for adb with root explorer/total commander app from the market
flash the boot.img with fastboot per method 1-
copy the dhd.ko file to your sd card, unplug your device, and using root explorer/total commander, navigate to the file on the sdcard, then move it to:
/system/lib/modules
ensure the dhd.ko file has correct permissions, then your wifi will function after a reboot.
-Greg
Thanks for your work!
can you build for your kernel few modules?
cifs.ko, slow-work.ko
for slow-work there is some kind of manual editing and preparing.
or if you give me your .config i will try this myself?
EDIT:
also you can statically compile CIFS filesystem into kernel
mind if i ask what advantage/s does this kernel have over Steve's gingerstreak kernel?
I can provide a .config file, sometime this evening, as I am away-
Gkernels is a project based on the 4.05 Dell source;
It is not better than another kernel in that regard, I am trying to get all I can out of it, without overclock. Changes to my knowledge, that differ from the Steve kernel, are listed above;
Thanks to _n0p_ 's tip 1.3.3 solves the RTC issue- Thanks _n0p_
I believe this was done by changing to the low resolution timer.
-Greg
.config
Sorry for the delay, I was detained-
attached is the .config for 1.3.3
Working with an attempt to solve the wifi issues-
one environment seemed to work during my testing, yet at a great sacrifice to battery life, by enabling:
control the low power modes of memory -->
Default Memory Low Power Mode during Idle (Memory active)
Default Memory Low Power Mode during Suspend (Memory active)
I am still uncertain-
before I release a 1.4, I will trial more of these modes
-Greg
Can this modes be switched by detecting if external power supplied?
--
I've also recieved some requests, saying that power (and maybe other) buttons sometimes "flickers". Is there any way to filter key events a little?
--
Thank you for your devotion,
Sergei
I will look into this.
Hi, there seems to be some screen tearing , I suspect that it has something to do with vsync. Could this be fixed with a new kernel update or is this ROM related?
Sharptv-
This may be kernel, rom or both related;
you may try and experiment with different roms and kernels-
This could also be screen density related, on my device there is minimal tearing on default density
I had some screen tearing on power rom but none on DSC....
Good work on the kernal
May bishnu grant you many donkeys and wives
@Roy
are u indian
Hi GSpecial!
I'd like to ask you to join forces with ltrifonov.
You both are advanced system builders, i think Streakers community would really benefit from your teamwork!
That's an awesome job you are doing. Never was able to crack more than 1500 upload until now!
Sent from the SuperStreak!
borijess said:
That's an awesome job you are doing. Never was able to crack more than 1500 upload until now!
Sent from the SuperStreak!
Click to expand...
Click to collapse
Is this considered a good score?? I just did the test and got 10ping, 15162kbps down and 8912kbps up
Sent from my Dell Streak using xda premium
Greg, your new kernel 1.4.0.1 (can say after a day of tests), is absolutely fantastic.
Fast, responsive even with conservative governor waking from 128Mhz - and WiFi is simply excellent!
Thank you!
Nop can you make a flashable zip plz???
You might pay attention to Downloads section for DSC ROM (not ad )
greekunit690 said:
Is this considered a good score?? I just did the test and got 10ping, 15162kbps down and 8912kbps up
Sent from my Dell Streak using xda premium
Click to expand...
Click to collapse
I guess compared to u rs no but normally I was getting around 1000 up. So its 3 times as fast now for me.
Sent from the SuperStreak!

[DONE, v1.1 source] linboothkvc - minimal strangely kexec with out kexec ;-)

>>>> 24Jan2012_2155 - linboothkvc v1.1 source - does a bit more thorough job with Cache flushing for the corner cases where the new guy in the Nirvana environment doesn't do a thorough job of cache invalidation. Now have added the source to this post itself (cas, it is pretty much done now, except for any forgotten corner cases, and also one pass at removing all dependence on hidden kernel functions which I shamelessly depend on - rather it is only setup_mm and cache flush walking, others (on 2nd thought rather all) are trivial to replace but have left it there just from a future proofing perspective). However the details or blah blahs are in the newer posts towards the end of the thread. <<<<
>>>> 22Jan2012_1430 - linboothkvc v1.0 source with working binary kernel module for Nook Tablet released - look towards end (may be page 2) for the source - As you would already know, it can also work with any rooted arm based linux device provided it is recompiled for the given linux kernel on that device along with updated kernel function addresses in lbhkvc_k.c and appropriate Nirvana (some minimal change, if required) and NChild code (ie the bootloader you love for your device) <<<<
>>>> 22Jan2012_0058 - I have uploaded the source for a working linboothkvc for Omap3/Omap4/Arm_Cortex_A SOC based devices. As far as linboothkvc is concerned, it works on NookTab also successfully. However there is some effort/love still required wrt the NChild or bootloader used from with in the Nirvana environment ;-) <<<<
>>>> 17Jan2012_2325 - FINALLY SUCCESS on NookTab also ALSO Note that the POWER of KERNEL Modules and linboothkvc in turn is well beyond NookTab for the adventurers ... ;-) <<<<
>>>> 16Jan2012_2326 - Beta version of code posted towards the end, Now it fully runs on BeagleXM Hw - with minimal love should run on NookTab also, so enjoy <<<<
>>>> 15Jan2012_0251 - Alpha version of source code in post towards end, fully runs in Qemu for now ;-). And the difference between this cup and the lip (i.e actual h/w) being the missing proper cache handling from my side <<<<
Hi All,
Before my ideas with init hijack, and uboot hijack, I had a idea with trying to implement a kernel module to allow execution of any code, after killing linux without a full reboot (which would give control back to secure boot). However 2ndihkvc and NOPBypass came in between this.
However I will try and put sometime into it, as and when possible. I have some work coming up over the next few days, so going will be bit slow compared to my other two threads, but if nothing turns up from BN side (what I heard from Adamoutler on the other thread) wrt open ended bootloader then I will spend bit time on this.
Note that one doesn't require kexec to achieve functionality similar to kexec ;-). Linux kernel modules is a very powerfull mechanism which we have in our hand to give lot of or all the control required (Unless linux has changed drastically over the last few years, when I have been away from it, but that seems less likely, even thou I have heard and discussed some ideas which curtail this power almost a decade back, but I don't think it has materialised yet, which should be good for the situation we are in, and hope it remains like that for the forseeable future, what with all these close minded companies and closed devices these days).
NOTE: Look to the newer posts below for the Source Codes. RC1 source code in a day or two (but has mentioned, no significant changes wrt Beta
[REPOST] MAYBE Exec_Anycode instead of kexec
>>>> This was my old post on bypass bootloader ideas thread, put here for completeness <<<<
*** MAY BE A POSSIBLE EXEC_ANYCODE logic instead of KEXEC***
NOTE: KEXEC tries to run another linux kernel, so may be its logic is more complicated, than if we are trying to run just any code in kernel or better privilage level. I haven't looked into kexec as of now, so I am only guessing about kexec complexity, beyond what I have mentioned below for my method (which again I haven't tried as of now, just a idea).
If one is trying to run something from memory when already in Linux, then one also has to worry about the privilage level at which the processor is running, as well as about page table mapping etc... If the other thing which we are trying to run is another kernel or x-loader or uboot or another bootloader for that matter.
So if kexec doesn't work, may be there is another option available which is to
a) Create a kernel module (NOTE: It runs with same privilages as the kernel) which does
a.1) Disable interrupts so that control doesn't get out of our code
a.2) Over write the reset vector with x-loader or what ever custom bootloader one wants to get control of.
a.3) Change the memory map to have a 1-to-1 map for the region where the code is currently running (or rather for the code which will be run in the next step) or overwrite a region which already has 1-to-1 map between Physical and Virtual addresses, with the code for the next steps. Go to next step.
a.4) Disable page tables (I haven't tried this before, ie after it has already been enabled, but I don't see any reason why ARM doesn't allow this - except for things like what we are trying).
a.5) Change to the reset ARM privilage level (If a soft reset doesn't do it already, haven't looked at ARM at this level for ages, so don't remember)
a.6) Trigger a soft reset
This should give control to the bootloader which we have loaded into the reset vector address. (Rather we should trap all possible exceptions i.e all the 8 or 16 or what ever is the number of exception addresses in the exception vector).
NOTE: If we are not able to change back to the reset time privilage level for the ARM processor, then we should be still able to have a modified Linux kernel, which doesn't try to switch ARM privilages if not required - this I have tried, ages ago, If I am not wrong as part of some other activity I had done.
Current thoughts
Hi,
On thinking once again
a) We definately want to disable interrupts, so that we don't lose control other than for exceptions if at all.
b) We may have to stop the other processor if it is up in SMP, but I have noticed that most of the time, the other processor is shutdown in NookTab.(Have to think thro this bit more, later).
c) May be trap the TLB exception handler and inject custom pagetable till MMU is switched off (An idea for now, have to experiment a bit later). Rather than going thro the linux mmu code (am getting bit old, a decade back I would have done the required linux magic in few jiffies, but have been away from linux for too long now . OR force few entries into current/kernel linux memory map.
d) Copy
d.1) the core code required to manage stuff to a 1:1 mapped region.
d.2) Also the code required to jump to like (i.e the bootloader or what ever)
Other d.2) Or implement minimal code (as part of d.1) to read uart (oops - now that would have cut the complexity by 3/4th, but for people hating uart these days;-) or may be sd card and get a sector into memory (like x-loader).
e) Disable the mmu
f) Jump to the required code location of new universe
Today I did a quick running/jumping glance thro kexec code once, and even it does some what similar only, if I am not wrong, except for may be it not hijacking the TLB exception handler or having some junk for debugging or so ..., so I am not that off wrt the required idea.
First baby step - try and understand the default memory map
Hi,
Did try the 1st baby step towards this, by trying to go thro the running systems memory map.
LBHKVC driver v04Jan2012_2110
INFO: Total memory is iTotalMem 0x40000000
INFO: Page Size ??? PAGE_SHIFT 12 ie 4096
INFO: Begining of Platform ram PHYS_OFFSET 0x80000000(0x40000000)
INFO: End of userspace mapping TASK_SIZE 0xbf000000(0x7f000000)
INFO: Start address for Modules Space MODULES_VADDR 0xbf000000(0x7f000000)
INFO: End address for Modules Space MODULES_END 0xbfe00000(0x7fe00000)
INFO: Permanent kernal mappings PKMAP_BASE 0xbfe00000(0x7fe00000)
INFO: Kernel direct 1:1 map ??? platform RamBeg PAGE_OFFSET 0xc0000000(0x80000000)
INFO: Kernel direct 1:1 map ??? platform RamEnd high_memory 0xf0000000(0xb0000000)
INFO: vmalloc/ioremap space Begin VMALLOC_START 0xf0800000(0xb0800000)
INFO: vmalloc/ioremap space End VMALLOC_END 0xf8000000(0xb8000000)
Now one thing which is potentially true and easy is, the Physical Memory from 0x8000.0000 is 1:1 mapped to 0xc000.0000 in a linear way (Have to validate, but should be). There are certain virtual to physical maps which seem bit odd, most probably I am using the wrong function to do the conversion and or traversal of pagetable. Also some of them are not necessarily meant to have a mapping other than act has markers conceptually (Have to verify later).
Having something same to same mapped would have kept things to a minimal, and made this too trivial now - why not ooh linux gods ;-(. Now this is forcing some hijacking or forcing of page table entries or experimenting and seeing if this is good enough to me/any one else interested.
Also there seems to be something called SAR_RAM, have to see if this is of any use. As well as some of the regions reserved thro kernel command line and see if anyone is using it, or if it can be evicted if required, there are only for funny experimentations.
Otherwise I think, I should be able to get even my current modules virtual address translated to physical address and may be same-to-same mapped if required. Or forcefully take some region beyond my current running code and any exception logic I require.
Also I have to check how critical is the same-to-same map if any when switching off mmu, or is 1:1 map good enough, have been away from lowlevel arm also for too long now.
Wow hkvc you respond quicker then I do.
First off it is not a 1 to 1 mapping if you look at the arm B&Ndefconfig youll see that they utilize a different way of mapping (not looking at the code right now).
Second off kexec with the kernel module that does KEXEC_LOADED is essentially this. I would look at the kexec.c code, and you will see that you can comment out the sanity checks in the find hole function and it will find a valid hole, then with injection you could make this work. However, while i have done embedded design and some hacking, kernel modules are not my specialty. We need a high priority kernel module that removes interrupts, so that the kexec code can load.
baby step2 of linboothkvc
Hi Loglud/All,
Thanks for your inputs.
Not sure about ur (Loglud) 1:1 map part comment. Currenty when people say 1:1 I am not sure whether they mean linear map (i.e with a constant addition or substration you can get virtual - to - physical mapping and inturn the other way round) or same to same mapping, I have to look at arm initial booting code and see what they mean (and in turn what ARM requires), because they require this when booting and inturn the mmu gets enabled.
Also the code to dump the map what I put above, was my first attempt at kernel level view of memory maps after ages, so there are some FUNNY ;-) errors in the way I tried to dump it quick and dirty.
If you are talking about 0xC000.0000 (Virt) to 0x8000.0000 (Phys) mapping which I mentioned, I still feel it is linear mapping, but I have to verify once. Linux kernel used to maintain a linear mapped region to simplify the internal management of physical pages(i.e memory), so that they can convert from virt2phy and back easily wrt physical memory with out requiring to go thro pagetables and for other reasons (Obviously with limits, i.e the Full memory is not linearly mapped but the initial 800MB or 900MB or so used to be). I will verify it later.
Either way independent of that I have potentially found the region which I will be attacking wrt getting the required same-to-same mapping (which I want to use, even if linear map is good enough, which again I am not sure is true at this time). The VIRTUAL ADDRESS space set aside for kernel Modules in Linux (MODULES_VADDR (0xbf00.0000 ...) and MODULES_END) overlaps with the actual physical memory location (0x8000.0000 - 0xc000.0000) here. And there is enough free memory in this module virtual address space, as there are only 2 modules loaded in NookTab, plus the region is originally there to allow lot of modules plus worst case I don't really worry much about stomping_on/reusing someone elses used memory because I am going to kill the system shortly and I have already locked the current cpu by blocking interrupts.
Inturn I will initially see if there is a physical page in the physical address space from 0xbf00.0000 to MODULES_END such that I can do a direct same-to-same mapping into the corresponding Virtual address space. Again even if there is non, at one level I may not have to mind really ;-) as I will be nuking the full system shortly.
I am looking at same-to-same mapping to allow the code which will do the mmu disable to continue to work before and after mmu disabling. While a Linear mapped region is good to load the code (bootloader, kernel, ....), before mmu is switched off, which will be passed control after mmu has been disabled, and which inturn can welcome the new system.
NOTE: I am in this more for the fun of exploring, so at least initially I don't want to use kexec and modify it (If I fail, then I may look at using it directly, but don't see a reason to fail for now), rather I want to come up with a concept (and as you rightly mentioned, even kexec follows (and it definitely should) similar concept to a great extent except for may be some of the implementation steps, as end goals are similar) and then implement it for the fun of it, even in crazy ways if possible (I am just starting out on this now, so I dont want to say one way or the other on this aspect now) just for it
NOTE: I am explaining my thoughts, so if someone else is interested in experimenting parallely on his/her own, they can get some ideas (good or bad
BabyStep3 basic implementation done - but results say long fight ahead
Hi All,
Over yesterday and today, I have implemented a basic logic to test minimal kexec equivalent logic using kernel module.
Rather had to dig thro the kernel source code to
a) refresh thro my kernel basics and to understand atleast some of the changes in the newer kernel versions and MORE importantly
b) to OVER COME the tendency of core kernel developers to DISABLE EXPORT of some of the useful functions to external kernel modules.
Eitherway most of the disabled symbols I could pickup and hardcode the address in my code to still access them indirectly using function pointers - what would world be with out function pointers or rather pointers in general.
Also because of the SMP nature of the SOC, had to dig thro some of those stuffs also. Then for now decided to use some of the support mechanism already available within kernel to help with kexec logic like fin, reset, etc to try and see if I could use the easy path into it for now initially
However what I seem to have realised/found is that
a) Either these support routines haven't been fully implemented in the used kernel version on NookTab currently and or
b) I am missing few more additional steps wrt SMP (Have already killed the 2nd Processor using proper api in kernel - Have to cross check the CP15 to verify for sure once again later).
It seems to be mostly (a) and inturn related to cache cleanup and may be mmu switching, have to debug further.
Otherwise the same logic seems to be working in BeagleboardXM (rather within qemu -M beaglexm) except for some reason the uart messages seem to disappear once I switch over even thou the code seems to be running in the new Same-to-Same map with the physical memory address part, with proper UART address - checked using info registers in qemu (Have to debug this part of qemu related to how it decides which uart to show in Ctl-Alt-3 etc bit more and or try on a physical board sometime next week).
In few days time I will upload the code I have come up with (even thou useless from using/achieving kexec logic perspective currently, still may provide some ideas or act as a base platform for someone wanting to experiment, but having initial inertia , if I am not able to spend more time on it.
Initial Pre-Alpha source for linboothkvc kernel module and utils
Hi All,
As promised, I am uploading the initial version of the kernel module source code (with lot more updates compared to last weekend, when I mentioned about it) for achieving kexec like functionality even if kexec is disabled in kernel. As I always told, kernel modules are equivalent to kernel, so you can do what ever you want in kernel module that can be done in kernel, provided one is bit patient ;-).
Note: This is pre - alpha version of code for people with initial inertia/starting trouble to experiment. This has a known bug with cache handling which I have to fix as well as some restructuring and cleanup to do.
This will currently only run in Qemu, because it doesn't bother much with Cache. But on ACTUAL targets it will fail Randomly (there is a very very small one in a million chance that it can succeed if all the stars line up and the cache gods support you
This is no longer as critical for NookTab has it was 1 week back, because Now some people have already released a exploit which uses a uboot bug ;-(, which ideally we could have with held for a future product (because NookTab was already sufficiently open and didn't need any more exploits to use its full potential, as I had mentioned last week). But either way I realise that people are very impatient these days. And congrats to those people for their work however.
For people who want to experiment, the initial skeleton is available in this release
Alpha release with embedded x-loader for BeagleXM Qemu
Hi,
NOTE: This release successfully bootstraps a new linux from with in linux in Qemu, my yesterdays release would have also done the same, but would have required additional code to handle the final nitty grities, this is taken care of now in this release. So that it is easier for people wanting to experiment.
I have updated the kernel module to allow two images to be embedded into it.
a) The initial boot strap loader called Nirvana (Examples like bloop0.S, bloop1.S, ... and now a full fledged omap3callbootrom1.S for BeagleXM on Qemu - Rather it in itself is independent of Qemu-BeagleXm or Hw-BeagleXM)
and
b) The actual bootloader/???? to run in the new prestine environment called Nirvana's Child (NChild). Currenlty it is a version of the x-loader for BeagleXM (Either Qemu or Actual BeagleXM).
In turn once the kernel module is done with its job. It passes control to Nirvana. Also it passes the physical address and length of the NChild image to Nirvana thro r0 and r1.
The Nirvana code in turn can decide what it wants to do with the system. The default Nirvana code i.e omap3callbootrom1.S takes care of copying the NChild(by default x-load.bin) to 0x4020.0800 and then pass control to 0x4001.4000 so that it loads x-loader properly (ie setup stack for all modes etc).
NOTE: As of now it works on Qemu only. My earlier release yesterday would have just printed 1s on the screen, while this version actually boots into a new linux kernel + system in Qemu from with in a already running Linux system in qemu.
However it won't run outside Qemu successfully, as I haven't yet had time to look at fixing the cache issue, because I had to add support for NChild image logic either way for doing anything useful with the code.
NOTE: As this is either way no longer critical for NookTab, I will take a stab at it based on my hack-vs-life balance also. Depending on what and all come up over the next few days in life.
HOWEVER this latest release has the FULL REQUIRED INFRASTRUCTURE/LOGIC for running this on a actual h/w expect for the missing proper cache handling. It also includes a x-load.bin by default for BeagleXM which can be used either with Qemu-BeagleXm or Hw-BeagleXm.
Beta Source - Success on a Hardware (beaglexm for now) should work on NT also ...
Hi All,
I have finally identified the stupid cache issue which was frustrating me and eating my head for long and stalling this project unnecessarily . However it gave a nice oppurtunity for me to dig thro the kernel code as well as Arm documentations - which is what I am after either way So ALL IS WELL in the end
The problem was related to kernel's normal code using MVA based cache operations for flushing, which in the newer architectures stops mostly at L2 cache rather than hitting the memory. This is fine for Normal linux kernel operations because they don't disable cache and so the proper data will get used. But for us as we want to disable cache to give a true pristine NIRVANA environment, this doesn't work, as memory contains old/stale/wrong data. In our code flow This even affects the KERNEL MODULE CODE itself, leave alone Nirvana or NChild code.
Once I realised this by digging thro documents as well as seeing the strange behaviour (rather unbelieavble, initially for me) of my code(kernel module as well as Nirvana and NChild)/logic after cache disable, I was able to get it RUNNING SUCCESSFULLY on BeagleXM actual hardware and not the qemu emulation which I was previously using.
As of now it is restricted to Omap3/BeagleXM, because the Nirvana code Omap3callbootrom2 makes use of the bootrom memory map usage knowledge to setup NChild appropriately and pass control to it thro Bootrom (so that stack is setup for all modes). With small effort the same can be changed or updated for Omap4 and NT should be in the fold (Unless SMP creeps up, inspite of me shutting down the 2nd processor, for some crazy reason in the worst case ;-)
NOTE: Also my last release (alpha) for Qemu beagle had a bug which was a blessing in disguise, in that it was not disabling the MMU from with in kernel module(which I had added just for the heck of it and is actually not required). However it was still doing it once it hit Nirvana code, as required. If I had not done the mistake of using mrc instead of mcr with in my kernel module code, it would have failed immidiately, because BeagleXM has only 512MB ram and the kernel module code space is at virtual address 0xbf00.0000 or around it, which is WELL BEYOND the 512 MB of physical memory, so there would not have been any 1-to-1 memory map for it and disabling MMU would have made things go crazy. Note that Nirvana and NChild are kmalloced into linear mapped kernel address space which is with in physical memory limits normally ;-).
NOTE: May be there is a watchdog timer or coprocessor or so which I have to disable, haven't looked into this yet, which seems to mess things up, if I stay in Nirvana code for too long. However as by default there is no need to remain in Nirvana code for long, as it is required to pass control to NChild as quickly as possible, this is not a immidiate issue to worry about now.
Let the experimentations begin
For H/w BeagleXM boot, bypass stupid SMI based L2 Cache maintaince rot in uboot ;-)
Hi All,
If anyone has tried running my yesterdays Beta release on BeagleXM h/w there is one update and one other IMPORTANT things to keep in mind.
a) Update the omap3callbootrom2.S to directly call into NChild rather than thro BootRom, that call into BootRom is not required. i.e jump to 0x4020.0800 instead of 0x4001.4000 at the end.
NOTE: This also makes the code more generic and usable with minimal love across Beagle and NookTab.
b) In U-Boot remember to DISABLE/BYPASS the calls to ROM Support routines thro SMI to setup L2 cache as well as to invalidate cache. This is no longer required in newer Omap3 chips as well as there is actually few bugs in u-boot code itself related to this, as one wants to clear full cache but SMI rom routine only clears L2 (also the full cache walking for invalidate is there following the SMI call, so bypassing doesn't lose functionality), if I get rom code description in TRM correctly, plus few other bugs atleast in rowboat version. The files board.c and cache.S contain the calls to SMI which has to be bypassed.
I have attached the minimal patch required to uboot to allow it to work with linboothkvc with BeagleXM.
With the above two changes, linboothkvc will always succeed in BeagleXM, enjoy
NOTE: In my setup today, I have modified the NChild x-loader to load u-bootk.bin rather than u-boot.bin. Thus I can have both the Normal u-boot.bin for Normal booting and u-bootk.bin for linboothkvc based booting . My Beta release doesn't contain this modified x-loader NChild, the next release will contain the modified one. But with source of x-loader, you can do it yourself and copy over as NChild into linboothkvc
Success on nook tab
Hi All,
LinBootHKVC has successfully booted into Nirvana code in NookTab
NOTE: No major change required to my beta release other than one mentioned in my last post to make my released Nirvana code more generic and the address update in this post for NookTab.
As I had mentioned yesterday, even thou I hadn't got the time yesterday to check it on NookTab yet, it should work 90% except for any crazy SMP issues, inspite of me disabling the 2nd Processor. WELL IT turns out that what I had done already was sufficient for NookTab also.
Only in omap3callbootrom2.S you have to change the sram address to which things are copied from 0x4020.0800 to 0x4030.0800 for NChild code. However I haven't crosschecked the x-loader based NChild on NookTab as of now, but DONT SEE ANY REASON why it should fail, other than for any issues with stupid code, like the SMI calls to manage L2 cache in u-boot for beaglexm and for some reason if 0x4030.0000 space has some issues I haven't thought of in Omap4 (I am relatively new to Omap4 started with NookTab only).
Will upload the Release Candidate version 1 of the code in a day or two. It is late here and I have been up on this NookTab project for few weeks now
a) starting from idea of linboothkvc
b) then moving to 2ndihkvc
c) followed by NOPBypass with UART access
0) The uboot loop hole (Oh my my my (But not released from my side hoping to keep it for future, but alas, if only people have/had patience ..., that is partly a dream now
d) followed by MenuK for 2ndihkvc - haven't released yet, time got sucked back
into linboothkvc
and back to
e) linboothkvc
all of the above work on NookTab successfully as of today and all can be used to achieve custom Roms and in case of NOPBypass and linboothkvc even custom kernels
So enjoy everyone. Some sweet rest for me atlast ;-)
NOTE: The POWER of Kernel MODULE and inturn linboothkvc goes well beyond NookTab for the adventures people out there
Oh My MURPHY - For now keep away from 0x4030.xxxx
Hi All,
Now as Murphys law would have it , 0x4030.4350 (the default address used by x-loader in Omap4) has some issue with it (which I have to debug later). So if trying on NookTab remember to use some other address (what other I will leave as a exercise to the interested
Also the x-loader from BN and or inturn from Ti expects a special meta data structure to be passed along thro r0, which inturn tells it about boot device and boot mode. So you will require to take care of this or better still simplify the structure to handle in cpu/omap4/start.S
Also I did the cardinal sin of doing too many changes when working/debugging on a new unknown device (from my perspective i.e NookTab) with no jtag access (atleast at my end for now).
So ended up digging into Arm L2X0 cache and inturn PL310 trm and writing a L2X0 cache flush logic (obviously also cross checking the equivalent logic in Linux kernel) when none was required in reality as I had already found and mentioned in my last post few days back. I forgot (rather got too lazy to checkout my own old code, just for the fun of exploring further ;-) my own Nirvana code which I had tried towards the beginning of the week which had successfully run and printed stuff on screen.
Also dug into the Address translation support registers in CP15 to be 100% sure that the 1-to-1 map was in fact there (again lazy to dig thro the linux kernel setup_mm code, when arm walks the page table tree for you and on top when I had not tried this arm instruction method before .
But ended up finally realizing that me using the 0x4030.4350 was the culprit atleast for now.
So keep away from that address for now (or debug further on this on your own for now, I will be looking at it only later, could be something to do with HS code using that region or ..., there is more interesting stuff to do for now) and remember to patch x-loader appropriately and you should be able to get it running on NookTab; again with my last code release with hardly any changes other than what I have already mentioned in the last 2 to 3 posts.
A updated source with the now useless l2x0 cache flush and va2pa address translation verification logic and a newer nirvana code with panda board support also (verified works perfectly - only slight changes required between Panda and NookTab as far as Nirvana code is concerned) I will release after some more experimentation and code stabilisation at my end.
hkvc said:
Hi All,
Now as Murphys law would have it , 0x4030.4350 (the default address used by x-loader in Omap4) has some issue with it (which I have to debug later). So if trying on NookTab remember to use some other address (what other I will leave as a exercise to the interested
Also the x-loader from BN and or inturn from Ti expects a special meta data structure to be passed along thro r0, which inturn tells it about boot device and boot mode. So you will require to take care of this or better still simplify the structure to handle in cpu/omap4/start.S
Also I did the cardinal sin of doing too many changes when working/debugging on a new unknown device (from my perspective i.e NookTab) with no jtag access (atleast at my end for now).
So ended up digging into Arm L2X0 cache and inturn PL310 trm and writing a L2X0 cache flush logic (obviously also cross checking the equivalent logic in Linux kernel) when none was required in reality as I had already found and mentioned in my last post few days back. I forgot (rather got too lazy to checkout my own old code, just for the fun of exploring further ;-) my own Nirvana code which I had tried towards the beginning of the week which had successfully run and printed stuff on screen.
Also dug into the Address translation support registers in CP15 to be 100% sure that the 1-to-1 map was in fact there (again lazy to dig thro the linux kernel setup_mm code, when arm walks the page table tree for you and on top when I had not tried this arm instruction method before .
But ended up finally realizing that me using the 0x4030.4350 was the culprit atleast for now.
So keep away from that address for now (or debug further on this on your own for now, I will be looking at it only later, could be something to do with HS code using that region or ..., there is more interesting stuff to do for now) and remember to patch x-loader appropriately and you should be able to get it running on NookTab; again with my last code release with hardly any changes other than what I have already mentioned in the last 2 to 3 posts.
A updated source with the now useless l2x0 cache flush and va2pa address translation verification logic and a newer nirvana code with panda board support also (verified works perfectly - only slight changes required between Panda and NookTab as far as Nirvana code is concerned) I will release after some more experimentation and code stabilisation at my end.
Click to expand...
Click to collapse
hkvc:
Thanks for all of your work. Even though the bootloader bypass has been found, you do not know how many others you are helping. This could be used as an indefinite alternative to locked bootloaders for ALL DEVICES! Keep chugging on this, and I'm sure you'll find your solution to the l2 cache flush. Also i have been looking around, and I was curious if this could be another explotable boot flaw,
Code:
/*
* The SAR RAM is maintained during Device OFF mode.
* It is split into 4 banks with different privilege accesses
*
* ---------------------------------------------------------------------
* Access mode Bank Address Range
* ---------------------------------------------------------------------
* HS/GP : Public 1 0x4A32_6000 - 0x4A32_6FFF (4kB)
* HS/GP : Public, Secured
* if padconfaccdisable=1 2 0x4A32_7000 - 0x4A32_73FF (1kB)
* HS/EMU : Secured
* GP : Public 3 0x4A32_8000 - 0x4A32_87FF (2kB)
* HS/GP :
* Secure Priviledge,
* write once. 4 0x4A32_9000 - 0x4A32_93FF (1kB)
* ---------------------------------------------------------------------
* The SAR RAM save regiter layout is fixed since restore is done by hardware.
*/
27.4.4.4.1 Public Use of SAR RAM
At system level, the OMAP4430 SAR RAM memory is divided into four banks. The public ROM code uses only the first bank, which is always public-accessible. More specifically, the software booting configurationstructure must be located in the upper 1.5KB of the first bank.
The public ROM code offers some flexibility about the location of the software booting configuration structure. The PUBLIC_SW_BOOT_CFG_ADDR pointer defines the start address of the structure within the SAR RAM bank (see Table 27-14).
As mentioned previously, the software booting configuration feature is optional. Hence, the public ROM code decides to use the feature based on the value read on a warm reset at the address pointed to by the PUBLIC_SW_BOOT_CFG_ADDR pointer. If the value matches the range 0x4A326A00 – 0x4A326FFF, the ROM code tries to extract the structure located at that address. The value pointed to by PUBLIC_SW_BOOT_CFG_ADDR is always overwritten to zero on a cold reset.
The recommended address for storing the software booting configuration structure described hereafter is defined as PUBLIC_SAR_RAM_1_FREE. It is, however, possible to locate the structure at any location within the 1.5-KB range.
It is moreover possible to use the public SAR RAM area for any other purpose, such as storing traces for HLOS use. Obviously, care must be taken not to overwrite the locations used for low-power modes and/or software booting configuration if used.
Click to expand...
Click to collapse
linboothkvc v1.0_RC3 with good x-loader for O3Beagle and O4Pandabrd and semi 4NookTab
Hi All,
I am attaching the source code for linboothkvc with a good basic Nirvana code for Omap3 (Many mobiles and few tablets) and Omap4 (few mobiles and tablets) devices. NOTE: for NookTab, basic linboothkvc works perfectly now (except for may be some toning down of the secure Monitor code if possible), However there is some more work required at x-loader (which I am using as my NChild code) level which I have mentioned further below as TODO. Otherwise the basic logic fully works for NookTab also now. At this stage it can be used by developers and not end users as NChild code for NookTab still requires some love.
[A] obviously there would be some minor tweaks to the NChild load address and args to pass etc based on x-loader/bootloader used in a given device, but still the basic skeleton is fully there in Nirvana code now. And the same can be modified for other SOCs from Samsung/NVidia/(Not getting the other vendor name now funny)... pretty easily.
Also the addresses for the linux kernel functions which I use require to be updated for any new device or for a new/different kernel for the devices which I have already put the code in this release.
[C] It expects to find a u-bootk.bin in mmc vfat root dir, provided you are using the x-loader code which I have bundled. How ever based on your device, you may have to change to a different bootloader or modify x-loader to suit that devices need, and thus With your own version of x-loader or NChild code, you can always modify it the way you want as to what it loads and from where.
But with the above changes/setup this can be used with any Rooted ARM based Linux device (be it android or webos or ...)
Changes I had to do to x-loader for NookTab:
[1] I had to bypass or find alternate locations for some of the 0x.4030.xxxx addresses used in x-loader from BN/Ti (Haven't had time to look into the details as to why this is forced on us and how to force the use of the same address yet). For this reason I am recompiling the x-loader with a load address of 0x8000.7ff0 for now and sidestepping it mostly.
[2] Clock and related init settings related to MPU,IVA and DDR memory are offlimits for now (but then again for a basic working these need not be changed at x-loader level eitherway).
[3] smc/SEC_Ppa functions are offlimits for now, again not required at x-loader level.
[4] TODO: the x-loader bundled with BN source seems to be a old version or has some non required (from BN perspective, but usefull from our perspective) logics for BN stripped. So even thou I have modified the high level logic to do a FAT load from MMC for u-bootk.bin. Because of this missing support for FAT boot mode, the current version of x-loader for NookTab which I have bundled in my code doesn't load u-bootk.bin.
Enjoy and happy Experimenting all
NOTE: When I say bundled x-loader, it is only binary blob, you can get the actual source code for x-loader from the respective git sources. I think few days back I uploaded the patch required for beagle x-loader to make it run in linboothkvc Nirvana env. I will do the same for x-loader for NookTab and Omap4 (rather omap4/panda hardly any change required from Ti release - I had to mainly simplify the argument mechanism passed to x-loader and nothing much, if I remember correctly, as I tried pandaboard 1 day back and after that I have done so many other things that, pandaboard is out of my memory Fifo) in few days.
[DONE] source of linboothkvc v1.0 (includes binary for NookTab with working xloader)
Hi All,
LinBootHKVC for NookTab is fully DONE now. Well (for developers) it can work with any ROOTED ARM based LINUX device (android or not doesn't matter) with kernel module support with minimal love, for those who are interested ;-).
Along with the source (which can work with any Arm based linux setup with some minimal love), this release also includes the binary kernel module for BN NOOK TABLET with firmware 1.4.0. Which inturn contains a working x-loader binary as its NChild for NookTab, which looks for a u-bootk.bin file on the uSD card.
To use this on NookTab (similar steps work for any other device, provided you have suitably compiled linboothkvc for your device with proper love)
a) get your required/prefered u-boot.bin file and prepend a 288 (0x120) byte dummy header and name it u-bootk.bin
i.e
dd if=/dev/zero of=/tmp/dummy.bin bs=288 count=1
cat /tmp/dummy.bin u-boot.bin > u-bootk.bin
b) copy this u-bootk.bin to the root directory of the 1st partiton on a uSD card which inturn should be VFAT formated. (To be 100% safe and sure use a newly formated uSD - Or you never know when Murphys law can kick in, see my note at the end for a bad luck I had yesterday night
c) Insert the uSD card to your Nook Tablet
d) Copy to your Rooted NOOK TABLET with firmware 1.4.0 the kernel module lbhkvc_km_DEVICE_NOOKTAB.ko which I have provided with in the release folder in the source package uploaded with this message/post.
__may be__ adb push lbhkvc_km_DEVICE_NOOKTAB.ko /data/local/tmp/
or similar or thro the uSD card and a file manager.
e) either from adb (on PC) or a terminal (on NookTab) or serial port (on PC) get to a root shell.
if using ADB on a PC connected to rooted Nook Tab it will be
adb shell
su
NOTE: PC is NOT required, you can also load the kernel module directly from Nooktab by using a android terminal package to get shell access.
f) insmod the copied Kernel module from the root shell/prompt
insmod lbhkvc_km_DEVICE_NOOKTAB.ko
This will load linboothkvc and inturn do a forced reboot/hijack into a x-loader environment, which will inturn load the u-bootk.bin which you had copied into SD card in steps a to c above.
NOTE: Based on what I have verified, u-boot works with out requiring any change to it (unless you want to bypass the security check in u-boot . So ENJOY.
NOTE: This can equally work on a 1.4.1 firmware based Nook Tablet, provided it is rooted. But for that you will most probably have to recompile my kernel module with updated addresses (if it has changed) for the kernel functions which I am using. However if BN hasn't done any change to kernel in 1.4.1 firmware, then the current kernel module which I have bundled it self will work. I haven't verified with 1.4.1 firmware currently (as I haven't upgraded to 1.4.1)
NOTE: Be sure to save any things you might be working on your NookTab, before loading the kernel module, because it will force a reboot with out any mercy, so any unsaved things in your NookTab can get lost. so BEWARE
NOTE: Rather even yesterdays release would have worked 99%, I had a problem with my uSD card being bit corrupt wrt rootdirectory, which is why it was failing yesterday when I finished it originally . However in this release I have also cleaned up the Nirvana code a small bit to avoid the hardcoded ioremap address of UART.
Release v1.1 source with binary for NookTab
Hi All,
Being bit lazy I had not called cache flush once again after disabling the cache, because I was calling it just a wee bit before disabling it and was also expecting any body who enables Cache in Nirvana environment to do a thorough job of cache invalidation before enabling it again.
However found that the linux kernel 2.6.35 used by Nook firmware has this problem, so now I take care of calling cache disable once again after disabling the Cache to be on safe side and it does help for NookTab (while on Beagle and Pandboard I didn't have this issue, it was a newer kernel which I had tried there so may be it has some additional effort put in wrt cache invalidation or it was pure luck, either way haven't debugged that aspect now).
So with this release, linboothkvc provides a better Nirvana environment, except for the SMC related stuff, which I am ignoring for now . So related to that there is some cleanup or bypassing required to be done in Kernel otherwise linux kernel should be pretty much ok in linboothkvc Nirvana environment, haven't had time to look at it fully yet. Will spend sometime in a day or two when a holiday is coming my way.
Check out the README file some of the same info as above and may be a few more things here and there. Also the new binary for NookTab is there in the source package within the release directory.
I've read every one of these posts and have no idea what is going on but I'm glad that it's all working. Great job!
Sent from my Nexus S using xda premium
Getting Linux kernel for NookTab up in LinBootHKVC - Step2 and 3
Hi All,
Step2
------------
There seems to be few race conditions in the linux kernel source and or some initialisations not being done properly in the kernel code, because of which by default the BN kernel source will fail in LinBootHKVC environment.
The below patch fixes 1 such race issue I have noticed wrt initial clock event handler for ipi timer (Have to debug this further later).
NOTE: A initialisation issue with the Cache, in that it not getting invalidated properly during booting was fixed in my v1.1 linboothkvc kernel module, by doing a additional flush before switching to Nirvana. Because that was also a appropriate stuff for linboothkvc also to do, independent of the kernel initialisation issue.
static void ipi_timer(void)
{
struct clock_event_device *evt = &__get_cpu_var(percpu_clockevent);
irq_enter();
- evt->event_handler(evt);
+ if(evt) {
+ if(evt->event_handler) {
+ evt->event_handler(evt);
+ }
+ else
+ printk("WARN:ipi_timer: event_handler missing\n");
+ }
+ else
+ printk("WARN:ipi_timer: evt not set\n");
irq_exit();
}
Beyond this any additional issues, I have to check yet. Also the reason for this race, I haven't debugged for now.
UPDATE1 (Step3)
----------------------
I have further cross checked that CONFIG_OMAP_RESET_CLOCKS causes some problem in linboothkvc Nirvana environment for few specific clocks, either way for now Disabling this config in BN NookTab kernel before compilation will allow the resultant kernel to run SUCCESSFULLY on NOOKTAB.
NOTE: As of now, even thou SMP is enabled, one of the Processors doesn't come up live. That has to be debugged later. But otherwise the Linux is FULLY running in NookTab from with in the LinBoothKVC Nirvana Environment and in turn the Linux User space is also running fine.
That sounds like a big step. Awesome work!

[KERNEL][01APR][JB][SAMMY&CM] SiyahKernel S3 v1.9.1

Please leave non-development related posts to the discussion thread in general section: http://forum.xda-developers.com/showthread.php?p=27389678
STOP! This kernel supports ONLY Samsung JellyBean or CM10.1 ROMs. It won't work on ICS, CM9.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Sources :-
Sources at http://github.com/gokhanmoral/siyahkernel-sgs3
Ramfs at http://github.com/gokhanmoral/ramfs-sgs3
Toolchain at http://github.com/gokhanmoral/android_prebuilt
Simply clone all to a directory and run build_kernel.sh in the kernel directory​Features :-
Samsung and CM10.1 support with a single kernel image
based on i9300 update9 sources
CPU OC/UC/UV
GPU OC/UC/UV (5 step GPU clock)
Audio enhancement and sound boosting for great headphone experience (partial-port of wm8994 based implementation from project-voodoo)
init.d support
Triangle-away app support
Auto-root
Adjustable charging speeds for AC and USB
Automatic EFS Backup
Samsung proprietary ExFat modules are loaded. Don't ask about ExFat support for aosp roms in this thread.
Kernel based gestures support by Tungstwenty. See http://forum.xda-developers.com/showthread.php?t=1831254
NTFS automounting for USB sticks, mounted to /mnt/ntfs folder in Read Only mode.
mDNIe negative effect toggle with 4 consecutive press of home button
mDNIe values can be adjusted using the interfaces in /sys/class/misc/mdnie.
Almost everything is configurable via simple and free STweaks (included in the kernel or from Google Play)
Dual-booting. You can have Samsung JB and CM10 ROMs on a single device at the same time.
slide2wake (WIP, still incomplete)
Known Problems :-
No known problems.
Thanks To :-
Chainfire, AndreiLux, Tegrak, Entropy512, Netarchy, Pikachu, Tungstwenty, Codeworkx, XploDwilD
This part will be expanded. most of the patches I applied are coded by someone else. please remind me if I forget to give credits to anybody..
Downloads :-
http://www.gokhanmoral.com/​
Changelog :-
See http://www.gokhanmoral.com/ for changelog.​
Todo:
these are my future plans and some of them are dreams only...
fix bugs
add optional teamwin recovery
implement BFN (BackFlashNotification)
...​
Video Review of v1.7rc1 by KingRamo
IRC support and chat:
Server: irc.FreeNode.net
Channel: #siyah-kernel
web client: http://siyah.twosx.net/ (thanks to omniwolf)​
READ THESE FIRST
First thing you need to have before posting to this thread is respect. If you don't have it for others you will regret leaving a post as people in this thread don't like disrespect. The items below are just detailed description of what "respect" means in this context. If you have common sense you probably won't need to read all the following items but please do read them anyway.
Never report any bugs to CM9/CM10 thread if you use it together with SiyahKernel
Do not ask questions to me directly. This is a common thread, not my personal inbox. Ask your questions in the thread and do not target them to anyone.
Do not expect answers to all your questions. There are some questions which nobody knows the answer of.
Do not forget that this is a development thread. There is another thread in general section for those who wants to discuss battery life and chats. If your post does not include a feature request, bug report or suggestion it should be posted to the other thread.
Make sure you state your ROM, settings and any other relevant information while telling about your problem/a bug. "I have lag", "I had crash" or any similar posts will be ignored if you don't give any more details.
No ETA for new version. Even if I sometimes talk about release dates those may change and they change for some good reason or because of my real-life obligations.
Make use of "Search this Thread -> Advanced Search". If you humiliate people and waste their time by asking a question which is answered in the last 3 pages I guarantee that you will be treated as you deserve.
You need STweaks app to configure/change most of the features in this kernel. However it is not required if you don't want to modify anything.
Never ever discuss anything deep-sleep related in this thread. I do not make modifications to prevent sleep and 99% of deep sleep problems are application/ROM related. discuss it in general section. I do not want any positive ("this kernel sleeps like a baby") or negative ("There is a big problem with deep sleep. Please fix it") messages in my development thread.
I am not interested in any bug reports if you undervolt your device. I don't want ANY kind of undervolting related discussions or bug reports in this thread.
Useful Links:
Almost everything that you need to know about Kernels, schedulers and so by droidphile
Another great post explaining more and ICS differences by droidphile
Although I put it in the first post, this is my github for kernel sources, initramfs and some more
You can find all the answers you need here, even those that I don't know
last one
FAQS and More
FAQS and More
In no particular order.
1. "How the heck do i flash the kernel.tar within device. I see a boot.img and recovery.img in the tar and not zimage like before?? I don't wanna increase flash counter by using odin from PC!"
A. Use mobile odin. (Paid on market, free on XDA).
Open the app, Click on "kernel", select the kernel.tar. Scroll down, select "flash firmware". Reboot.
2. "Why two mountable image files in tar?"
A. GS3 has separate kernel and recovery partition.
Kernel partition : /dev/block/mmcblk0p5
Recovery Partition: /dev/block/mmcblk0p6
Both partitions has a max size limit of 8 MB each.
3. "Does that mean i can flash only kernel/only recovery if i don't need the other?"
A. Yes. However, if recovery was modified to support a new feature in kernel, you may want to flash both.
4. "If i flash tar from Odin on PC, both kernel and recovery is flashed and i can't choose to flash only one?"
A. Yes, both are flashed.
5. "How to flash only kernel/only recovery with cwm flashable zip?"
A. If you know what you're doing, open updater-script in the zip and comment out the line that starts with write_raw_image for the one you don't need - kernel or recovery.
6. "Should i wipe cache and dalvik before flashing kernel?"
A. NO
7. "Best governor, best i/o scheduler for this kernel?"
A. Define best governor and best i/o scheduler!
Pegasusq is good enough to be responsive, battery friendly and quad core friendly if tweaked properly. Use any i/o scheduler. Sio/deadline are good.
8. "Why is Idle+Lpa default on STweaks and the recommended settings. In Siyah kernel for GS2, Aftr+Lpa was recommended!"
A. Aftr ofcourse saves more power than Idle if you consider what each of those low power state modes do. But combination of quad core architecture and pegasusq governor (or any external hotplugging logic combined with other governors) which need to respect rq values along with load thresholds makes it a little slower to turn off last 3 cores (if all the cores are ON obviously). AFTR requires that all cores except first (cpu0) be turned off - to kick in. So we're better off with Idle+Lpa.
However if you're using forced single core mode always (which is non sense in this powerful device), you can go for Aftr+Lpa.
9. "How do i overclock/underclock/undervolt GPU?"
A. Either use STweaks app or use a script
Ex:
#Frequency steps
echo 160 > /sys/module/mali/parameters/step0_clk
echo 266 > /sys/module/mali/parameters/step1_clk
echo 350 > /sys/module/mali/parameters/step2_clk
echo 440 > /sys/module/mali/parameters/step3_clk
echo 533 > /sys/module/mali/parameters/step4_clk
#Voltages
echo "875000 900000 950000 1025000 1075000" > /sys/class/misc/mali_control/voltage_control
10. "My device is not stable at 1.8 Ghz. But i still wanna overclock the device to possible maximum and show off to friends"
A. Try setting last frequency as 1750 mhz. (Modify 1.8 to 1.75 ghz with 1.7 ghz still in place)
Use kmemhelper interface. Put this line in your initd script.
kmemhelper -n exynos4x12_apll_pms_table -t int -o 0 14353152
11. "I OCed to 1.7/1.8 Ghz. My device is able to handle it. But i can't get high benchmark scores. Why?"
A. Your CPU is getting throttled during benchmark during benchmarking because of heating. This is a thermal safeguard measure. It might be getting throttled to 800 mhz or so.
Forget benchmarks, treat the overall responsiveness in daily usage as the criteria to determine if the device is fast enough for you or not.
12. "Any rule of thumb to increase life span of the battery? And I see percentage drops to 99 immediately after a charge till 100%"
A. Do not recharge to 100% often and even if you do, don't keep it plugged in 100% for long time. Best is to charge till 98%. And make sure charge does not drop below 10% while on normal use.
Charge dropping to 99% swiftly is a protection mechanism, not a fault with your battery or kernel or rom.
13. "I adjust the voltage by some mV in STweaks. I checked SetCpu and voltage has not changed!"
A. Voltage settings in STweaks follow VDD interface. They're applied ONLY during boot time. Why? The code is to reduce X mV specified by you in STweaks, for all voltages. If the settings is applied real time, it will cause reduction of voltage every time and instabilities.
14. "If I have no root, and flash this kernel using desktop odin will i get root?"
A. YES. However, if you don't see a CWM recovery, download and flash a recovery from Chainfire thread.
15. "Does the kernel backup EFS partition automatically?"
A. YES.
16. "Is there NTFS support?"
A. YES. Mounted to mnt/ntfs in Read only mode. Unmount and remount in Read Write mode if you need to.
17. "What voltage step does GS3 support while UV/OV?"
A. Regulator supports increments of +/-12.5 mV (Those who had GS2 will remember it's regulator supported +/- 25mV)
18. "Why is resetting STweaks profile recommended sometimes after a kernel flash?"
A. Your profiles are stored under /data/.siyah with ".profile" extension. ".active.profile" file under the same directory stores the name of your active profile. Contents in profiles are in the format parameter = <default_value>
There could be changes in Stweaks interface for a new build:-
i) Some new tunables were added
ii) Some tunables were removed
iii) Transposition of some tunables
iv) Default value of some tunable was changed.
When such a change occurs, your profiles should know it too so that it can contain all the parameters. That's why you have to reset profiles after a new kernel flash if it changes something in STweaks.
Resetting simply copies .profile files from /res/customconfig to /data/.siyah . You can do it manually using a file manager to avoid a reboot to recovery and back to rom. Kernel already detects STweaks changes to reset profile automatically on first boot after flashing.
19. "How to insert a module that's available in /system/lib/modules?"
A. Safe to be root. In terminal or adb
su
insmod /lib/modules/<module_name.ko>
20. "How to know which modules are pre-loaded by kernel?"
A. Terminal or adb:
lsmod
21. "I don't see an init.d folder in my rom. I wanna create some initd scripts. What to do?"
A. Using a root explorer create init.d directory under /system/etc. Set perm 777.
22. "After flashing a new kernel i see there are some stuffs missing from STweaks"
A. Either the support for those missing tunables were removed or just the STweaks interface was removed. The parameters might still be accessible through scripts. Check the file path to make sure.
23. "Does notification LED cause wakelock and lot of drain?"
A. Hm Yes and No. CPU has to wake to help turn on notif led and to turn off when it's timeout. When LED is blinking, no wakelocks are held. Notif led is controlled by a diff h/w and not directly by CPU.
24. "How do I know if my modified charge current settings (using STweaks) are effective?"
A. Use CurrentWidget from playstore. Monitor the reading while charging.
25. "What happens if my smooth scaling frequency is greater than my scaling max frequency?"
A. Smooth scaling will be inactive/disabled.
26. "Can I flash this kernel on a non-international variant - At&T/Korean/Japanese...?"
A. NO. Don't risk 800 dollars. Dev might release different variants for these devices later.
27. "I tried setting a negative value for a symbol using kmemhelper interface. I see the value is not applied properly. What could be wrong"
A. The negative value might be detected my kmemhelper as an argument. To prevent that, use two minus signs (--) before the negative value.
Ex: "kmemhelper t int -n touch_boost_level -- -1" (This resets touch boost frequency to default).
28. "I wanna disable all the audio enhancement stuffs. How?"
A. In your script
echo 0 > /sys/class/misc/scoobydoo_sound_control/enable
29. "Least voltage for a CPU frequency I can undervolt to?"
A. 600 mV. Maximum = 1500 mV
30. "Does sound enhancements in stweaks applies to bluetooth headsets?"
A. NO. Only for wired headphones.
31. "Do we have temperature sensor in our CPU?"
A. YES
32. "I have this habbit of unknowingly pressing home button multiple times and that result in inverting colors on my screen."
A. Disable "mDNIe negative toggle under Screen tab in STweaks.
33. "I sometimes get unexpected reboots. What could be wrong?"
A. Number of reasons.
- Problem from ROM side - wrong dpi setting for an app, wrong build.prop tweaks, etc.
- Too much UV on CPU/GPU
- Too much CPU OC/GPU OC
- CPU/Battery heated up too much because of weather/benchmarking/faulty charger, etc
34. "I want to help dev debug an issue providing a kmsg. How to?"
A. After the problem (random reboot/freeze/lockup), do not pull out battery to recover. Just long press power button so that device can reboot. Then connect device to PC, (provided you have setup adb), type
adb pull /proc/last_kmsg
Save the file as .txt and post in the thread along with description of the problem and possible way to reproduce it.
If you can't use adb from pc, just copy last_kmsg file from /proc directory to internal sd, copy it to your PC and post in the thread.
35. "I'm not able to copy Person X's undervolting settings. Why? Sometimes, across different builds of Siyah, my UV settings are stable in one version and not in another. Why?"
A. One or more of the following
- Every device is different - diff grades of CPU
- CPU drivers might change across different builds
- Power requirements may differ depending on the temperature, altitude or the defaults.
36. "GPU OC/UC range?"
A. 54 to 700 mhz. With voltage range of 600mv to 1200mv at 25mv steps.
more might follow..
Know the STweaks Tunables
You have a custom kernel and an app to control different tweaks. Read below to have a fair understanding of all the sliders and drop-downs in the app plus read some faqs.
Q. "What's STweaks?"
A. It's an app developed by GM to provide a simple interface for various kernel tweaks.
STweaks works using /res/uci.sh interface. (Universal Configurator Interface). Ideally when you run /res/uci.sh config you get an xml file. The app render that XML file to an UI. (The xml is customconfig.xml in /res/customconfig directory)
Q. "Where are profile files (default, performance etc) stored in my device?"
A. /data/.siyah with extension ".profile"
Contents are in the format <tunable> = <value>
Q. "How come STweaks takes a little long to load every time? Other CPU tuner apps like SetCPU opens faster!"
A. Stweaks needs to query the values of ALL tunables from the active profile file, then set the UI elements (sliders, checkboxes, dropdowns, etc) to match the values queried. Only after these it can expose itself for you. So yeah! Some time is needed.
It loads in about 2 seconds now.
Q. "So every tunable possible with SiyahKernel is included in STweaks?"
A. NO. That would make the app complicated and while some users like to have lotttsa tweaks in the app, some users prefer the opposite. So to be fair, STweaks will not be cluttered with way too many options.
For users who know what they're doing, there are scripts, and kmemhelper.
Q. "After flashing a new version of Siyah, I can't see STweaks in my app drawer. Help!!"
A. Using a Root File Explorer, copy STweaks.apk from /res directory to /system/app. Set permissions rw- r-- r--
Q. "I find that after flashing a new kernel version, while adjusting some tunables there's no effect."
A. In the app, under EXTRAS Tab, hit "Reset settings to default". Now reconfigure all your settings. Should be fine in most cases.
Q. "Sometimes, after flashing a new kernel build, i see all my settings are reset to kernel defaults. Is it normal?"
A. YES. It's just so that profile files contains all the tunables matching config XML in the latest build. If resetting is not done, some settings will not work.
Q. "Does that mean - every time I flash a new kernel build, I need to reset settings?"
A. NO
Q. "What should I change in STweaks to have best battery/best performance?"
A. Read below to know what each tunables do. If you still don't get it, don't change anything. Trust defaults. All will be good.
1) CPU Tab
Gentle_Fair_Sleepers:-
This is a CFS tweak. CFS aka Completely Fair Scheduler is your default Task Scheduler. Task Scheduler is responsible to manage task executions - decides what task to execute next from a queue. CFS scheduler tries to fairly distribute the CPU time among all tasks in such a way that each of them gets the same amount of the virtual run-time. CFS maintains two arrays - active and expired. Tasks once served from active array are placed in expired array. When there are no more tasks in active array, the two arrays are swapped. Sleeper Fairness means to consider sleeping tasks similar to the ones on the runqueue and credit the sleepers in a way that it would get CPU as if it were running. With Gentle_Fair_Sleepers enabled, sleeping tasks will get a little bonus time w.r.t to their virtual run time. While this may seem fair in some cases, disabling this tweak may possibly improve UI responsiveness:- may be because sleeping tasks are not given additional priority and the task that's responsible for UI do not sleep while screen is ON.
* Arch_Power:-
Another scheduler tweak. Helps in using specific ARM topology functions instead of generic functions. Benefits may include idle higher number of threads in a core, etc.
* CFS Tweaks:-
Three options which sets different value for your task scheduler's a) Minimum Granularity b) Latency c) Wake-up Granularity
A new "epoch" or a new time origin begins when scheduler swaps active and expired array.
Latency is the length of an epoch in nano seconds.
Minimum Granularity is the granularity of one epoch.
Wake Up Granularity is the ability of tasks being waken up to preempt the current task (5 ms by default). The larger the value the more difficult it is for the task to force the preemption.
- Samsung Defaults:- Leave it as Samsung defaults if you want higher benches.
-Linux Kernel Defaults:- My fav.
-Thunderbolt Scripts Defaults:- Pikachu's tweaks are aggressive low values for parameters. May improve UI responsiveness.
CPU Idle Modes:-
Leave it as Idle+Lpa. AFTR seems to be a difficult world to conquer for i9300.
* Smooth Scaling Level:-
Leave it as 1800mhz (which disables smooth scaling) if your governor has the parameter "freq_step" (ex: Pegasusq). Otherwise, the two concepts may conflict. Use smooth scaling for other supported governors. CPU driver scales CPU to frequency as defined by Smooth Scaling Level before jumping to Max Frequency.
Sched_mc:-
Leave it disabled = 0. 1 will overload first core, 2 will try to save power by biasing task-wakeups to semi-idle core.
CPU Undervolting:-
[Courtesy Andreilux for the info] 32 nm Exynos 4412 on our device decreases the need for higher voltages for transistors to switch and decreases voltage leakage. So they actually successfully switch more of the time compared to SiON on Galaxy S2 i9100 where leakage was big enough to not make a transistor switch and crash the system. In short, this is why GS3 supports higher UV compared to GS2. You might be lucky enough to UV more than 200mv on certain frequencies. Try on own risk.
Max CPU Lock:-
Defines no of cores to be used along with Pegasusq governor. Leave it quad core. You have beast of a phone. This parameter actually changes the max_cpu_lock parameter of your governor - pegasusq or lulzactiveq.
CPU Governor:-
Use Pegasusq.
CPU Max Frequency:-
Sensible OC for our device is 1.5 Ghz. You can try more and see what happens.
CPU Minimum Frequency:-
Use 200 or 100.
2) CPU_UV Tab
Like SetCPU or voltage control, sets voltage per CPU frequency. Note that the values DO NOT represent the actual voltage levels on the frequencies. If you UV in Stweaks and also use SetCPU to set voltage levels, SetCPU will over ride Stweaks.
3) GPU Tab
* Mali Touch Boost Level:-
If this option is enabled to any steps, when you touch on the screen/press soft back or menu keys/press homebutton - GPU voltage is set to the GPU step that match the step set by you here and frequency is set to that step. This may helps in better responsiveness of unlocking via lockscreen, etc. Note that, this doesn't mean GPU is locked to that forever. After one second, depending on thresholds and stepcounts, soon GPU is clocked down or up.
If Mali Touch Boost Level is disabled, GPU resumes at lowest frequency (your first step).
GPU Frequency Steps:-
Now we have frequency steps taken from Korean sources, as hard coded in clock-exynos4212 file. You won't find a formula to calculate valid frequency steps. (Unlike i9100 for which any GPU step was 800 divided by an integer)
GPU Voltage Levels:-
You may be able to UV a little more compared to GS2 if your ex device was GS2. Try and see. (Thanks to 32 NM SoC). Remember that you will know UV was too much only while GPU is being heavily used - like gaming.
GPU Thresholds:-
If you're not sure about this, use default thresholds. Wrong thresholds can cause lags.
* GPU Stay Counts:-
Stay count is the number of Seconds GPU should stay at a frequency level before it can scale up or down, overriding "load exceeds threshold condition". To avoid any possible stutters in gaming, use staycount = 1 second for the last step. May be for 4th step too, just to be sure.
If you don't find StayCount interface in the app, use script.
echo "0 0 0 0 1" > /sys/class/misc/mali_control/staycount_control
From left to right, each digit represents StayCount for lowest to highest GPU frequency steps.
4) AUDIO Tab
Speaker Tuning:-
Check to enable better bass response on speakers. Note that GS3 speakers don't play well with bass (even with open source audio HAL developed by codeworkx for CM10. So if you find sound distorting on speakers, uncheck this option instead of trying to play with some equalizer.
Speaker Amplification Offset:-
Default zero. Increase to amplify speaker volume. At level 5 or 6, speaker is most likely to distort playing ringtones/sounds.
Headphone Amplifier:-
Volume boost for your headphones. Level 0 = -57 dB. Level 63 = +6 dB which is the hardware maximum. Please take care of your hearing.
3D Effect:-
Stereo expansion may tighten the stereo field. In general, there are multiple techniques to achieve surround effect/3d effect/stereo expansion effect.
3D Effect Gain:-
Valid only if 3d effect is enabled. Higher value may not sound pleasant to most ears. 2-4 should do.
EQ Presets:-
Use inbuilt presets or use graphical equalizer bands to tune the 5 band equalizer.
Graphical Equalizer:-
The five band equalizer(with a range of -12dB to +12dB) is a hardware equalizer. So it controls all the sound coming from your headphones. Software equalizers such as inbuilt EQ of powerampp can only control the sound output 'formatted' by this 5 band h/w EQ. As you know, the first two bands - Lows/Bass. Middle one - Mids/Vocal and last two bands for - Highs/Treble.
Negative Digital Gain:-
Or dynamic range. Increase this to prevent distortion. It defines how much volume is to be digitally reduced from headphone amplification level.
FLL Tuning:-
Aka Anti Jitter is an audio enhancement technique as an internal clock optimization to reduce noise and produce a better quality sound.
DAC Oversampling:-
Increases dac oversample rate for a 48 khz rate and produce better outpund sound.
DAC Direct:-
Aka DAC ME, Bypass analog channels and redirect sound directly to output.
Mono Downmix/Force Mono:-
Force mono sound even if source is stereo.
5) SCREEN TAB
* MIN_BL, MIN_GAMMA, MAX_GAMMA:-
In simplest form, set this higher to have lower brightness at bright conditions on automatic-brightness settings. And vice-verse.
We have lowest brightness for a brightness level read from sensor less than min_bl. Any level higher than min_bl will be linearly mapped to min_gamma:max_gamma to interpret brightness of the display. Difference between min_gamma and max_gamma along with their values affect overall brightness response curve.
mDNIe Sharpness Tweaks:-
Makes thin fonts more readable. You're most likely to see weird display if you disable this option.
mDNIe Negative Toggle:-
If this is enabled, quickly pressing home key four times will invert all the colors on your scree. Useful for ex: Reading a webpage in the dark which has white background by default. By inverting colors to make it black, your eyes will strain lesser, plus it saves battery in such cases.
Touch Boost Level:-
Defines the frequency to which CPU is instantly ramped up to when we touch the screen. Advantage? UI responsiveness. Setting this too low might be a v bad idea on some devices.
Slide2Wake:-
If enabled, slide on screen in a straight fashion from left to right to wake your device. Helps prevent wear down of physical home/power buttons. If in doubt this drains more battery, leave it disabled.
FB Early Suspend Delay:-
Early suspend delay to run CRT off animation. If you're sure that Settings > Developer Options > Windows Animation Scale is 1x or higher (not 0.5x or off) and still can't get CRT-off animation to work, set this param to 100 ms or so.
6) MISC TAB
Android Logger:-
Enable disable android logger. Logger hardly uses any extra battery, and will be very useful if to pull a log after a crash or freeze. Leave it enabled.
* Insecure Adbd:-
Enables to run your Android Debugging Bridge Daemon (adbd) in root mode by default. Use "adb remount" command in a terminal to mount /system as r/w.
I/O Scheduler:-
Use any among deadline/sio/noop.
* Zram Size:-
Compressed swap space aka compcache aka zram allocates defined amount of space from your physical RAM as compressed swap space. You can debate all along to see if zram is useful on a fast device like GS3 with a fast flash storage inside. If in doubt, disable this option.
Notification LED Behavior:-
Force blinking/fading of notification LEDs. Useful for Sammy based roms. (aosp roms has blinking/fading setting inbuilt).
AC Charge:-
Charge current from your wall charger. Increase the value for faster charging at own risk. If you see currentwidget app displaying only 800/1000 mA (when you have set 1200 mA in stweaks) while connected to car charger - it's because the charger can not output more current than that.
USB Charge:-
Charge from usb charger. Increase at the risk of possible damage to PC motherboard. (if it's an old board)
Discrete Wakelock Status:-
Helps betterbatterystats app to report deleted and non-overlapping wakelocks. You may see new wakelocks like your mailclient-inbox-sync, etc if this option is enabled.
Remove Root:-
Some apps detect root and refuse to work if found (certain banking apps for example). To remove root, click this button, run your app and re-enable root when you're done.
Auto Install Root:-
Tries to install superuser apk and binary. If it fails, download latest superuser flashable zip from here and flash in recovery OR download SuperSU from playstore.
6) DUALBOOT TAB
Reboot into 2ndRom Utils:-
Reboots to alternate recovery where you can configure and play with dual boot options. This doesn't change your cwm recovery, but just runs an alternate recovery.
Reboot into 1stRom:-
As it says, reboot to 1st rom without displaying a timeout.
Reboot into 2ndRom:-
As it says, reboot to 2nd rom without displaying a timeout.
No boot logo:-
Check this to disable Siyah bootlogo displayed during dual-boot rom selection time out. (If you're dual booting, logo will be shown anyhow)
Default Rom:-
Specified the default rom (among 1st and 2nd) to which device will boot into, if no keys are pressed during boot. If 2nd rom is default, pressing home/vol down keys will boot 1st rom.
Hijack Recovery:-
We know the second rom utilities aka embedded recovery is a part of the kernel - it holds the same partition as kernel. You can use this button to flash the embedded recovery to main recovery partition (overwriting your existing recovery) so that 3 button method/booting to recovery using extended power menu will take you to Siyah recovery. This is NOT a dangerous operation. You can flash cwm/twrp recovery anytime if you need another recovery.
7) EXTRAS TAB
Reset Settings to Default:-
Reset the profile file, and resets all values in device files to kernel defaults.
Check for Updates:-
Checks and downloads a new build.
Flash Kernel:-
Flash a .tar kernel. Alternative to Mobile Odin!
* Indicates tunables removed from STweaks as of now.
Flashable Zips
Update: Find sample Stweaks Profiles as flashable zip here. http://forum.xda-developers.com/showthread.php?t=2034981. Profiles after flashing will be available in the profile app.
Here are 5 Governor Tweaks scripts as flashable zips.
Flash remove_governor_tweaks zip to remove init.d script that contains governor tweaks. One governor zip can be flashed over another and it will just replace the previous. All governor tweak scrips contains tweaks for pegasusq and luzactiveq. Gamerstweaks is also a governor script that's similar to extremeperformance script but does some additional GPU tuning (for which there is no interface in Stweaks) to enhance gaming experience.
Since order of execution is like this:-
1) STweaks applies its settings
2) Init.d scripts are executed
3) Apps such as SetCPU applies its "set on boot" options,
Script applies the tweaks to the governor selected in Stweaks (depending on if it's pegasusq or lulzactiveq). So if you want pegasuq tweaks to be applied, make sure pegasusq is the default governor in stweaks, and same for luzactiveq.
I will keep updating zips while new kernel builds are released - if it changes any tunable.
DualBoot FAQs
Dual Boot FAQs
* "Alternate Recovery" or "Embedded Recovery" is embedded recovery that's the part of kernel since 1.7.x versions when dual booting was introduced. It's the recovery you boot into using "Reboot to 2nd Rom Utils" in STweaks.
"Regular Recovery" or just "Recovery" is your CWM recovery in recovery partition (/mmcblkp06) which is accessed by 3-button method or "boot to recovery" in the extended power menu from your rom.
1. "Why would I wanna dual-boot?"
A. You don't have to.
Suppose you're more of an aosp rom fan. But misses the HDMI out, FM radio and love sammy camera more. Do a minimal installation of sammy rom and boot into it when in need of these features and use aosp rom otherwise.
Or you are a sammy rom fan but love the responsiveness and pure android feel of aosp roms.
And while you can dual boot two sammy or two aosp roms, it doesn't make any sense.
2. "What if I don't need dual booting?"
A. No issues. Kernel won't force to setup 2 roms. You can single boot as before. And if you don't want to see the Siyah logo as well, create a .nobootlogo file without any extension or content in internal SD.
3. "Will dual booting change my bootloader or do any dangerous stuff like setting my phone on fire?"
A. NO. Changes are at kernel and ramfs level only. Some space in your internal sd card is used, and also the unused hidden partition mmcblk0p10 is used to store cache of second rom. Dual booting doesn't repartition the filesystem or perform anything scary.
4. "I want to setup dual booting."
A. There are four situations:-
1) Sammy rom now. Want to use aosp as secondary.
2) Sammy rom now. Want to use aosp as primary.
3) Aosp rom now. Want to use sammy as secondary.
4) Aosp rom now. Want to use sammy as primary.
Special Cases:-
5) Use an existing nandroid backup as 2nd Rom (and existing rom as 1st)
6) Use an existing nandroid backup as 1st Rom (and existing rom as 2nd)
Prerequisites for any setup is
a) Flash latest Siyah
b) Atleast 90% battery left.
c) 2 GB free on internal SD.
d) Some spare time
1) Present sammy, setup aosp as secondary:-
i) Hit "Run 2nd Rom Utils" in Stweaks app from your current rom. This will run the embedded recovery in the kernel. Under dual boot options, wipe 2nd Rom data and cache+dalvik. Format 2nd Rom System.
ii) Using install zip to 2nd rom option, flash aosp rom as 2nd rom.
iii) Fix 2nd Rom permissions
iv) Flash Siyah again
2) Present sammy, setup aosp as primary:-
i) Hit "Run 2nd Rom Utils" in Stweaks app from your current rom. This will run the embedded recovery in the kernel. Under dual boot options, Clone 1st Rom to 2nd Rom.
ii) From recovery (your default cwm recovery which can be accessed from extended power menu or 3 button method), full wipe and install aosp rom zip as you'd normally do when you were single booting.
iii) Fix 2nd Rom permissions
iv) Flash Siyah again.
3) Present aosp, setup sammy as secondary:-
Same as (1), instead of flashing aosp to second, flash sammy to second.
4) Present aosp, setup sammy as primary:-
Same as (2), instead of flashing aosp to first Rom, flash sammy.
5) Restore the nandroid backup using "Restore as 2nd Rom" option in the embedded recovery. If there are problems while restoring, wipe 2nd Rom data, cache+dalvik, format second rom /system and try restoring.
6) Clone 1st Rom to 2nd Rom from embedded recovery then restore nandroid backup from your regular cwm recovery.
NOTE:
-To dual boot Two Aosp or Two Sammy roms, just follow (1) or (2) (depending on which one of them you want as primary/secondary), just flash Sammy instead of aosp or aosp instead of sammy.
5. "What things should I be taking care off while dealing with dual booting?"
A. - Make sure to fix permissions of second rom after setting up 2nd rom for the first time or else you're likely to see a black screen.
- If Wi-FI on aosp doesn't work, flash a sammy ICS rom (on to 1st rom or second rom depending on location of aosp) before flashing aosp rom.
- If NFC doesn't work, flash that NFC fix zip you can find on XDA which replaces ICS NFC firmware on aosp with JB NFC fw from sammy.
- Even if you're installing second rom for the first time, wiping data and cache+dalvik of 2nd rom and formatting system of 2nd rom is necessary; As it creates empty 1.5 gb system.img to be used as system partition for 2nd rom and also creates data directory of second rom in /.secondrom dir in the internal sd.
6. "How to boot into primary rom?"
A. Wait for the 3 second timeout or press volume up/power to skip the timeout. Or use the option in Stweaks if you're booted into second rom already.
7. "How to boot into secondary rom?"
A. During the 3 second timeout, press volume down or home button. Or use the option in Stweaks if you're booted into 1st rom already.
8. "Is kernel partition shared?"
A. Yes. Same kernel boots both roms.
9. "If I flash another kernel (that doesn't support db) do I lose dual booting?"
A. Yes
10. "I lost dualbooting after flashing another kernel. I didn't do anything to second rom files in sdcard/.secondrom. How can I get db back?"
A. Just flash the latest Siyah.
11. "Will there be any performance degradation on the rom used as secondary compared to primary?"
A. NO
12. "Will my phone run slow overall because of db?"
A. NO
13. "How to flash a newer version of 1st rom?"
A. As usual, just flash it from recovery. Flash Siyah again if Rom zip flashed another kernel.
14. "How to flash newer version of 2nd rom?"
A. Using stweaks, boot into 2nd Rom utils. Flash the rom using "Install zip to 2nd Rom" under dual boot options. Flash Siyah again if Rom zip flashed another kernel.
15. "Would upgrading 1st or second rom cause other rom to fail on boot?"
A. No. Partitions of other rom are not touched during upgrading.
16. "I miss the recovery I used before, so much.."
A. You can use any recovery. Alternate recovery can be just run using the option in STweaks.
17. "User apps of 1st rom are automatically available for second rom?"
A. NO. However, if you had backed them up using Titanium Backup or similar apps, just restore apps while on second rom.
18. "I wanna keep separate backup for apps in both the Roms, since I use one Rom for say entertainment and other productivity."
A. Setup different backup directory in Titanium Backup in 1st and 2nd rom.
19. "I don't see Stweaks app in second rom."
A. Delete /system/.siyah/stweaks-installed file in 2nd rom. Reboot to second rom.
20. "Do I need to anything special before flashing a newer Siyah?"
A. NO. Just flash kernel as tar or in recovery - whichever you used to do. Kernel image is copied to the unified kernel partition.
21. "How can I run same STweaks settings of 1st Rom in 2nd Rom?"
A. While on 1st rom, copy the file /data/.siyah/default.profile to /data/media/.secondrom/data/.siyah directory. If you modify STweaks settings in 2nd rom and want to avail same settings on first rom, do the other way around. (Copy "default.profile" from /data/media/.secondrom/data/.siyah to /data/.siyah while on 1st Rom)
22. "How do I remove everything related to DB and run single boot again?"
A. In recovery, under dual boot options - "delete 2nd Rom". OR Delete .secondrom directory in /data/media while on 1st Rom.
23. "If secondrom files are kept in /data/media, will wiping data in recovery erase second rom files?"
A. NO. /data/media is skipped in CWM recovery.
24. "I was using ExFat card on sammy rom without any issues. I have setup dual boot with aosp and now after booting into CM it says microSD card is corrupted."
A. Aosp roms doesn't support ExFat out of the box. The data was corrupted by aosp vold. Even if you boot back to Sammy rom, it still would be corrupted. To recover data, manually mount the card in recovery, copy contents to internal SD and reformat card to a Fat32.
Also try
chkdsk X: /f (where X is the drive letter of microsd), you may be able to copy data.
25. "I read somewhere that both rom data partition use the same space. Doesn't that mean my apps are shared across roms?"
A. NO. It just means they uses same partition. They're still different directories.
1st rom data = /data
2nd rom data = /data/media/.secondrom/data
26. "Will hitting "Reboot to 2nd Rom Utils" in STweaks change my recovery?"
A. NO. It just runs (not flash) an alternate recovery so that you can configure dualboot settings. Using extended power menu or 3 button method, you always lands in your own CWM recovery.
27. "How do I backup 1st Rom and 2nd Rom?"
A. To backup 1st Rom, do what you did to backup rom while you were single booting a while ago.
To backup 2nd Rom, use the feature embedded recovery, which can be accessed using "Reboot to 2nd Rom Utils" in STweaks app.
28. "I booted into recovery using 3 button method. But some dual-boot options are not working even though dev said they're implemented.
A. Use "Reboot to 2nd Rom Utils" in Stweaks app to boot to embedded recovery.
29. "DB architecture?"
A. Like you know, every rom has a /data, /system, /cache partition and a kernel to boot.
For primary rom, it's
mmcblk0p12 = /data
mmcblk0p9 = /system
mmcblk0p8 = /cache
And these won't change whether you're single booting or dual booting.
For secondary rom, data and system is stored in internal sd, cache in hidden partition. Note that internal sd in our device is mounted to /data/media.
We have data as a directory, System as an image in data/media/.secondrom. Cache in mmcblk10 which is hidden partition and not used otherwise.
- When second rom is booting, second rom data is bind mounted to mmcblk0p12 as /data/
- data/media/.secondrom/system.img partition is mounted as /system.
- mmcblk0p10 is mounted as /cache.
More FAQs will be added and the list will be updated as DB is improved.
Nice! I like your work on Galaxy S2 hope to see you here often and regulary updating your thread.! well done mate
Sent from my GT-I9300 using XDA
Thanks my friend
Inviato dal mio GT-I9300 usando Tapatalk
energie said:
Best kernel ever finally
Sent from my GT-I9300 using XDA
Click to expand...
Click to collapse
Absolutely
Gesendet von meinem GT-I9300
gokhanmoral said:
last one
Click to expand...
Click to collapse
This is gonna be HUGE!!!
Thanks GM
Sent from my GT-I9100 using XDA
+
siberian tiger said:
This is gonna be HUGE!!!
Thanks GM
Sent from my GT-I9100 using XDA
Click to expand...
Click to collapse
fully agree ...now i am using 0.94 and no problems at all
PS: just a USB Mass Storage is only little thing i miss...but DropBox and FTP are ok too
Looking forward to this. Using 0.94b now and it is oh so smooth. I'm sure 1.0 will be even better.
Cheers gokhanmoral.
/love....
Many thanks, the best kernal ever, is the focus on battery life on this release? can the kernal fix the high cell standby issue? i believe my device will keep your kernal until i sell the device !
Thank you
WOOT!
Where is the download link I opened the link above but there is no 1.0 only hv 94
Sent from my GT-I9300 using XDA
ThisIsIt...
saberzaid said:
Where is the download link I opened the link above but there is no 1.0 only hv 94
Sent from my GT-I9300 using XDA
Click to expand...
Click to collapse
compiling now.. I will edit the blog post after editing the first post in this thread.
As I tested v0.92b, this kernel is very promising ( of course because of Gokhan ) but not yet stable. I love to see @gokhanmoral progress like sgs2 kernel .
I will test v0.94b right now .

[FAQ] >> RBAP for miniCM10 by nAa, nAa's kernel X10mini/X8/x10miniPRO .:08/07/2013:.

[FAQ] >> RBAP for miniCM10 by nAa, nAa's kernel X10mini/X8/x10miniPRO .:08/07/2013:.
Read Before Asking Please
FAQ for MiniCM10, and nAa kernel
reading may answer to lots of your questions !
for X10mini, X8 & x10miniPRO
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
i decided to create a new thread dedicated to Q&A about miniCM10
this thread is the place of your questions, answers, tips about miniCM10 and nAa ics kernel
so please, as usual, read FAQ, use search option or anything else before asking commonly answered questions
the FAQ will be incremented when needed
the Q&A is written as Q are asked
Requirements:
Latest 2.1.1.A.0.6/2.1.1.C.0.0 SE firmware / Baseband: M76XX-TSNCJOLYM-53404015
Unlocked bootloader
Latest version of the JBnAa kernel
Instructions:
paste miniCM10-4.X.X on the root of your SDcard
backup
flash JB kernel
get in recevery and format /system ; /data ; /cache
flash rom
flash gapps
wait for the very long first boot
enjoy
Please make sure you followed the above steps before reporting any issues, especially 'wipe data/factory reset'
something else that is useful to read before asking :
Here we (nearly all? XDA members, regardless of being devs or only users [like me], me at least ) don't care about your good/bad English the important is trying to be understood and to understand the content of the threads
only ask things you can't find, or you don't understand, please if you don't understand something in any process tell us exactly where is your problem : it will optimize the answer
sometime rephrasing things can make you understand better, feel free to help us for making the most understandable sentence for anybody
i'm always trying to use a proper English (not so easy for a non native English ^^)
but if there's something misunderstood because of my English your are welcome to correct me
BUT if you don't make the effort to read, I won't make the effort to answer (ok, you can't read everything... but read the minimum )
that's it
miniCM website is now available (http://minicm.dyndns.org/site/Chat/ for chatroom)
clic on the red text above ​
register, and then enjoy
________________________________
bug tracking template :
twins.7 said:
#BUG Report
DO
Reboot - Recovery
BUG
the screen stuck in rebooting dialog. It should just rebooting
ACTION
press home key (or any key maybe) to make it reboot
Click to expand...
Click to collapse
________________________________
we seek for you, TESTERS, go there for helping : [DEV] miniCM10 debug only thread (shakira, robyn and mimmi)​
2nd part of FAQ
FAQ :
for miniCM7 refer to THIS THREAD PLEASE
for miniCM9 refer to THIS THREAD PLEASE​
for quick search, use ctrl+f and enter keyword, you should find an answer to your question
ok, let's start with some fun :
how to understand FAQ :
0/ question(which build(s) is(are) concerned with q/
answer to the question
old, wrong or obsolete answer
additionnal comments if needed​
__________________________________________________
nobodyAtall said:
about nAa JB kernel :
Preface:
Read through [that] post. Don't rush into flashing. Be sure you understand the process before you start
This is a custom kernel developed for Android Jellybean
Do NOT try this kernel on other Android versions - you are totally unsupported
This kernel introduces custom mtd partitioning with larger /system partition to hold the extra JB calories. If you are moving from another custom kernel to this one, you MUST first format /system /data and /cache via the embedded CWM recovery
Click to expand...
Click to collapse
1/ any problem with display overridding?( ? ; ? )
in settings > development settings :
_____________________
2/ wanna go back to a non jelly bean based rom?( all builds ; all devices )
go to CWM > mount&storage and format :
/system
/data
/cache
then flash the kernel you want, (press flash on flashtool, plug the phone to pc, force reboot by pressing home+power, press and hold back button)
==> you can now restore a backup of the old rom you were previously using or install another non JB based rom
_____________________
3/ hard/software keyboard isn't working properly??( ? ; mimmi )
x10man said:
Quick fix for the soft keyboard:
On the select input method screen turn the hardware keyboard to off like so:
The software keyboard will now appear but the hardware keyboard still works.
Basically this needs to auto-switch when the hw keyboard opens and closes.
X10man
Sent from my U20i using xda premium
Click to expand...
Click to collapse
DanielFran said:
Power off, then remove sim card. Reboot and select language, change keyboard layout in advanced definitions (mimmiparts). Then put again sim.
Sent from my U20i using Tapatalk 2
Click to expand...
Click to collapse
4/ why my wifi can't load? ( all builds ; all devices )
you may have that kind of logcat:
Code:
D/WifiService( 1694): setWifiEnabled: true pid=2095, uid=1000
E/WifiStateMachine( 1694): Failed to load driver!
E/WifiStateMachine( 1694): DriverFailedState
open terminal emulator :
Code:
lsmod
if it doesn't answer anything, maybe /system is out of space and kernel fails to copy wifi modules at boot (note that undervolt module wont work either)
try the following :
open any file explorer that is root capable,
go to /system/media/audio/ringtones
delete some ringtones (at least to recover about 3 or 4 MB free, the more is safer) [1.5 MB seems to be enough though ]
reboot
try lsmod and see, if the kernel succeeded to copy modules at boot it's ok and and lsmod outputs what you are waiting for, if not reflash kernel and/or try to install a reduced miniCM10 zip (by deleting ringtones as for the previous way, but in a zip editor)
hoping it will solve your problem
5/ you have various problems with wifi ? ( all builds ; all devices )
refer to miniCM7 and miniCM9 miniFAQs !!!
6/ what are I/O schedulers ? ( all builds ; all devices )
a kind of answer here
7/ i updated from miniCM10-4.0.0 to 4.0.1 and after updating the gapps to 20120923 i've lost the camera ? (miniCM10-4.0.1 ; all devices)
go to mount&storage
format /system (NO data lost )
install miniCM4.0.1 again
install gapps 20120923
reboot&wait
all should be back to normal : fast and feature full
8/ how can i set keyboard shortcuts on my hardware keyboard? (all builds ; mimmi)
just edit azerty.xml or qwerty.xml in system\usr\keyboard-config\layouts
9/ how can i fix my azerty/qwerty/qwertz... HardWare keyboard? (miniCM10-4.0.2+ ; mimmi)
first flash this : from here
and then the zip corresponding to your specific language : look here
/!\ choose "default input method" so that the KB works correctly, if you don't it will behaves strangely
/!\ do not modify keyboard_layouts and keyprints in any way if you want the above to work, edit: seems you can edit the xml finally
/!\ do not modify advanced>mimmiperts, make sure you have not touched it before processing the installs. it is recommended to start from a "fresh build" i.e. to wipe all user data, and so on.
defauld input and sym button should be back
/!\here is another way to fix it : follow allesand's instructions
10/ i wanna use a2sd, what is it and how to make it work? (all builds ; all devices)
refer to that short tuto & infos here by drfr
11/ my LED is not blinking properly is there any way to change that? (all builds ; all devices)
You must delete /system/lib/hw/lights.msm7x27.so with rootexplorer or any other file manager that allows you to explore and modify root files
handcent led settings does not work properly with lights.robyn.so
of course, you need to reboot your phone after that.
REDELETE AFTER EACH UPDATE if you have the same problem SINCE THE FILE IS REWRITTEN
12/ why flastool doesn't flash the kernel i choose? (any version)
when there are lots of kernel builds in flashtool firmware folder, flashed kernel might not be the right one,
to void this, create a folder in it, cut/paste all your previous kernel there
and only keep the one you want to flash in the firmware folder
then, start flastool and process flashing operations
13/ i'have some problem for sending mms (all builds until miniCM10-4.0.2+ ; all devices)
--> with CM7/9/10 you just CANT send mms without data enabled
if you can't even with data enabled:
DaRk_dOg said:
I think that this is a common issue with CM7 and not just MiniCM7 (I experienced it on my DHD too).
Here is a small workaround for now:
Before sending the mms, disable data traffic, then enable it again and then send your mms.
You have to do it every time, before an mms but it is working for me.
Regards, D_d
Click to expand...
Click to collapse
--> seems now, mms can be sent without enabling data or anything, just need to have correct APN set up
14/ CM file manager doesn't work well for no (not at all in fact) (all builds? ; all devices?)
see details here.
15/concerning brightness on MiniCM10-4.0.2 nightly 20130119 and higher, (MiniCM10-4.0.2-nightlies ; shakira, robyn, mimmi?
to get compatibility with .32 kernel, nAa needed to change some things related to brightness monitoring
and that's why some issues appeared with .29 kernel, and then were fixed, but with the drawback of light being at max for a short time before dimming when turning the screen on.
using .32 kernel solves this issue
with old .29 kernel, use MiniCM10-4.0.2-stable or nightlies until 20130114
for newer nightlies (especially 20130207+) prefer .32 kernel
16/ concerning Undervolting and newer .32 kernels : (MiniCM10-4.0.2+ and nAa .32-03+ ; all devices)
NobodyAtall said:
VDD levels
From 03 onwards, I've ported the vddlevels functionality from msm7x30
so that we can variably change the voltage level of the frequency we
want without the need for external modules.
The current voltage information is available at:
Code:
/sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
E.g. the defaults after flashing the kernel should be:
Code:
[email protected]:/ # cat /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
122880: 3
245760: 4
320000: 5
480000: 6
604800: 7
614400: 7
633600: 7
652800: 7
672000: 7
691200: 7
710400: 7
729600: 7
748800: 7
768000: 7
787200: 7
806400: 7
825600: 7
844800: 7
864000: 7
To change for example the voltage level of the 122880 frequency, you could do:
Code:
echo '122880 0' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
If you cat this file again, you should see that the voltage level is
picked up. The new voltage level is picked up when the CPU will scale
to the particular frequency level.
The undervolting tickbox in the 'Performance Settings' of the latest
MiniCM10 nightlies already uses the new interface. The values that are
set there are the same ones as those passed by the old undervolting
module:
Code:
[email protected]:/ # cat /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
122880: 0
245760: 2
320000: 3
480000: 5
604800: 6
614400: 7
633600: 7
652800: 7
672000: 7
691200: 7
710400: 7
729600: 7
748800: 7
768000: 7
787200: 7
806400: 7
825600: 7
844800: 7
864000: 7
Do I need undervolting?
You dont NEED undervolting. It can save though hours of some battery
life during the day.
Overvolting?
Even though the interface allows you to overvolt, I don't suggest
doing so. It will result to instabilities or crashes and is totally
unsupported.
Performance?
Undervolting decreases the performance results - this is to be expected.
Click to expand...
Click to collapse
17/ why can't i connect my device to USB on PC ? (MiniCM10-4.1.0+ & nAa05+ ; all devices)
SmG67 said:
That's because MTP (Media Transfer Protocol) is default now, so it gets connected as a media device. If you want Mass Storage, go into Settings-Storage on your ROM and press the menu-button, you can select USB-storage from there.
Click to expand...
Click to collapse
18/ where is my dualtouch?? (MiniCM10-4.1.0+ &nAa05+ ; all devices)
this is a copy of kernel OP, that you should have read before
nobodyAtall said:
Dualtouch (for synaptics):
By default dual touch is disabled for improved touch accuracy and avoidance of the 'ghost touch' side-effect.
If you want to enable the fake DT by andrej456, you have to insert the following line in the /system/etc/hw_config.sh file:
Code:
echo "1" > /sys/module/synaptics_i2c_rmi4/parameters/cfg_dt
If you want to enable the fake DT by dx, you have to insert the following line in the /system/etc/hw_config.sh file:
Code:
insmod /system/lib/modules/synaptics_i2c_rmi4_dt.ko
Dualtouch (for cypress):
Cypress supports dualtouch, so this is enabled by default
Click to expand...
Click to collapse
19/ why do i get a kernel version error (installation abort, status 7) while installing MiniCM10? (MiniCM10-4.1.0 up to 20130518-NIGHTLY &nAa06 ; all devices)
matmutant said:
change in rom zip to *.61 for kernel version if you want the installation to complete (in META-INF/com/google/android/updater-script)
Click to expand...
Click to collapse
3rd part
3rd part
usefull links and performance tricks
useful links :
[DEV] miniCM10 debug only thread (shakira, robyn and mimmi)
what CPU governors, and how do they work?
$find other useful link in miniCM7/9 miniFAQs $
Perfomance :
recomended settings :
perf related :
CPU: keep default, but enable UnderVolting (and set on boot if you don't OverClock) (settings>performance>CPU)
RAM : to optimize RAM usage, use KSM, zram (18%, default) and allow purging of assets (settings>performance>memory managment)
I/O : keep NOOP, this is the default and the best for flash memory
other :
in settings>developer options
enable USB debugging,
debug notification,
set all animations to 0.5 (electron beam CRT animation will happen no more)
enable "kill with back button"
________________
for whose who feel the system slow and laggy, just try the SWAP (SDcard class6+ recommended)
SWAP, there is two "kind" of swap : using a partition on the SDcard, or using a swap file
both are good, but some SDcard/phones react better with the one or the other​
let us start with the partition way : it is more complicated than the file method, but as some advantages
pros: once it is set up, no need to care about it anymore, the SDcard can be mounted to PC easily without latency
cons: a little complicated to set up, and once it's done, it is as complicated to revert as to set up; to change swap size, you need to repeat the process (formating and partitioning SDcard)
needs a clean install of miniCM10:
flash JB kernel
in CWM, go to mount&storage :
then, format /system, /data and /cache (so that kernel can use the new partitions size) any data on phone memory will be lost
set up your swap:
==> go to /advanced/Partition SD Card
if you don't want to use a2sd, then choose the minimal size for ext, and the size you want for SWAP
it will FORMAT your SDcard ! any data on SDcard will be LOST
and install the rom
swap partition should work
what doesn't work is the swap info menu
to revert : format SDcard in phone settings : it will FORMAT your SDcard ! any data on SDcard will be LOST​
____________________
now, the swap file way : it is really simpler than the swap partition, works great but has some drawbacks
pros: easy to set up, easy to revert, and the size can be choosen at wish at anytime (in settings>performance>memory>Swap settings)
cons: high latency when mounting SDcard to pc, it can take forever (really quicker to use CWM mount and storage capability to use the SD on the PC, than using android way)
you must perform a clean install of miniCM10 (by formating /system, /data and /cache) any data on phone memory will be lost
install the rom zip, the gapps, and boot up your phone
set it up
once your rom is ready to use,
go to settings>performance>memory>Swap settings
choose "enabled"
choose the size
allow system to get SU permissions
wait for the pop up "swap enabled"
enjoy, it is simple and can be disabled on wish​
for both :
to see if your swap works, open terminal, and type the following :
Code:
free
to see the swapiness :
drfr said:
To check in terminal:
Code:
cat /proc/sys/vm/swappiness
Default value is 30 if you have zram and swap enabled, or 60 if only swap without zram.
To change it TILL NEXT REBOOT:
Code:
echo X > /proc/sys/vm/swappiness
where X is your desired value
To change it PERMANENTLY:
add the above line to the end of your hw_config.sh (you can find it in /sýstem/etc)
Note: it is always way easier to type those things on PC keyboard, so you´d better do it in adb shell.
Click to expand...
Click to collapse
__________________
some usefull lines of commands for any user wanting to know what's going on :
in terminal, just type the lines,
in ADB, add "adb" before the commands
if you want not to siplay the output in terminal, specify the path :
Code:
command > /where_you_want_your_output_to_be_stored/name_you_want_for_the_log
to know how much swap there is (total and free are what you want to know), use the following command since the way using menu is broken :
Code:
free
to know if KSM is really turned on :
Code:
cat /sys/kernel/mm/ksm/run
to know what modules are running :
Code:
lsmod
install an app from terminal :
Code:
pm install /sdcard/app1.apk
from adb :
Code:
adb pm install /home/user/app1.apk
your kernel crashed?
Code:
cat /proc/last_kmsg
ex : from adb, and stored in /home/user/last_kmsg1
Code:
adb cat /proc/last_kmsg > /home/user/last_kmsg1
an app crashed, you want to know why?
Code:
logcat
ex : from adb and stored in /home/user/myfirstlogever
Code:
adb logcat > /home/user/myfirstlogever
don't have an USB cable ?or adb "other the air" :
connect to your home wifi network (both device and pc)
in settings/dev options/ enable adb on TCP/IP
Code:
adb connect xxx.xxx.xxx.xxx:5555
(the IP is the one displayed in the option you choose previously
and then, since it is connected, catch the log :
Code:
adb logcat > /home/user/myfirstlogever
Benchmarks, screenshots and thklist
to start with, some screenshots
MiniCM10 theme:
MiniCM10 Crystal2:
benchmarks :
MiniCM10-4.0.2-nightly, using .32 kernel :
all has been done at 729MHz, on robyn
on .32-02:
antutu : fps2D:​
I/O performance on miniCM10-4.0.2-20130120/nAaJB03 (2.6.29.6) :
conclude what you want
NOOP:- The NOOP scheduler inserts all incoming I/O requests into a simple, unordered FIFO queue and implements request merging.
The scheduler assumes I/O performance optimization will be handled at some other layer of the I/O hierarchy; e.g., at the block device; by an intelligent HBA such as a Serial Attached SCSI (SAS) RAID controller or by an externally attached controller such as a storage subsystem accessed through a switched Storage Area Network.​
ANTICIPATORY:- Anticipatory scheduling is an algorithm for scheduling hard disk input/output.
It seeks to increase the efficiency of disk utilization by "anticipating" synchronous read operations.​
CFQ:-CFQ, also known as "Completely Fair Queuing", is an I/O scheduler for the
Linux kernel which was written in 2003 by Jens Axboe.
CFQ works by placing synchronous requests submitted by processes into a number of per-process queues and then allocating timeslices for each of the queues to access the disk. The length of the time slice and the number of requests a queue is allowed to submit depends on the IO priority of the given process. Asynchronous requests for all processes are batched together in fewer queues, one per priority.​
BFQ:- BFQ is a proportional share disk scheduling algorithm based on the slice-by-slice service scheme of CFQ. But BFQ assigns budgets, measured in number of sectors, to tasks instead of time slices. The disk is not granted to the active task for a given time slice, but until it has exahusted its assigned budget. This change from the time to the service domain allows BFQ to distribute the disk bandwidth among tasks as desired, without any distortion due to ZBR, workload fluctuations or other factors. BFQ uses an ad hoc internal scheduler, called B-WF2Q , to schedule tasks according to their budgets. Thanks to this accurate scheduler, BFQ can afford to assign high budgets to disk-bound non-seeky tasks (to boost the throughput), and yet guarantee low latencies to interactive and soft real-time applications.​
I/O performances on MiniCM10-4.1.0 /w 2.6.32.60 nAa-JB-05 :
here is a chart showing scheduler specific results,
the benchmarks were based on Antutu, regarding IO and SDcard R/W
my settings are :
122~729MHz
smartassH3
undervolted
KSM
zram 18%
swap file 128MB​
all i can say for now, is that SIO is the more balanced scheduler, and CFQ/VR are the worst
here are the results
what does the chart shows us?
SIO is the more balanced scheduler, it has a good IO, and a good read/write
Anticipatory has the best IO, but a bad SDwrite
Deadline has the best SDwrite, but is quite average for IO and SDread
NOOP, CFQ and VR are a bit behind
for people using swap, i would say that they should use SIO or deadline, for others, Anticipatory or BFQ might be better
i ran the benchmark 4 times for each scheduler.​
source
Benchmarks history since stock rom here
MORE BENCHMARKS HERE
thanks to Heronger and some others helping to build this FAQ
are the reserved threads in x8 development for JB?
hetunandu said:
are the reserved threads in x8 development for JB?
Click to expand...
Click to collapse
where are the reserved threads you are talking about?
matmutant said:
where are the reserved threads you are talking about?
Click to expand...
Click to collapse
in x8 android development section
http://forum.xda-developers.com/forumdisplay.php?f=1704
hetunandu said:
in x8 android development section
http://forum.xda-developers.com/forumdisplay.php?f=1704
Click to expand...
Click to collapse
maybe
matmutant said:
maybe
Click to expand...
Click to collapse
arghhhh!! cant wait!!
BTW do u need testers? im in. I have an X8. PM me
Great job matmutant!:good:
I have questions/suggestion request about minicm 10 for xperia x8, i have a very little space to store applications, any suggestions? With GB I can use a lot of apps moving its in SD but with MiniCM 10 also moving apps I can install all the apps that I use before.
Use an ext partition for example it would be useful?
Another thing is the automatic conversion trom SMS to MMS when it exceeds a page in length. Only using another app for messages it wont be this way but i thing it would be great if we can use the stock app that I think is great!
A q aswell(actually I'm not sure of something)
nAa said it will repartition our space and said to uninstall we need to flash using seus or flashtool so that means to go back to stock partition we need to flash good ol eclair or any other kernel(eg. nAa gb) will get back our partition?
Sent from my heart™ using Xperia X8
X8invisible13 said:
A q aswell(actually I'm not sure of something)
nAa said it will repartition our space and said to uninstall we need to flash using seus or flashtool so that means to go back to stock partition we need to flash good ol eclair or any other kernel(eg. nAa gb) will get back our partition?
Sent from my heart™ using Xperia X8
Click to expand...
Click to collapse
I think he means that if we want move to another kernel we have to use seus or flashtool the way we always flash new kernel, for example flashing again naa-13 over jb kernel using flashtool without going back to eclair first.
I tried to make an ext partition in my sd card with CWM, now I have more memory to store my apps and system is so fast! This rom is great!
I only have sometimes random reboots and sometimes the screen crashes but now this is my daily rom!
Does swap partition works in MiniCM10 ?
I still don't quite understand about the meaning of clearing data, cache, etc...
Currently, I'm still at MiniCM 2.2, with a swap partition, EXT 4 partition, and FAT partition...
What is the correct sequence to run JB for the first time ?
Do I have to :
1. Reformat my MMC first + deleting the partition, go to recovery, format data, cache, etc, then make new partition (Swap, EXT4, and FAT)
OR
2. Format data, cache, etc, then reformat my MMC (as Swap partition gets changed to EXT3 automatically when doing factory reset), then make new partition.
Can somebody help ? Thank you in advance
StardustGeass said:
Does swap partition works in MiniCM10 ?
I still don't quite understand about the meaning of clearing data, cache, etc...
Currently, I'm still at MiniCM 2.2, with a swap partition, EXT 4 partition, and FAT partition...
What is the correct sequence to run JB for the first time ?
Do I have to :
1. Reformat my MMC first + deleting the partition, go to recovery, format data, cache, etc, then make new partition (Swap, EXT4, and FAT)
OR
2. Format data, cache, etc, then reformat my MMC (as Swap partition gets changed to EXT3 automatically when doing factory reset), then make new partition.
Can somebody help ? Thank you in advance
Click to expand...
Click to collapse
flash JB kernel
in CWM, go to mount&storage :
then, format /system, /data and /cache (so that kernel can use the new partitions size)
then set up your swap
and install the rom
swap partition should work
what doesn't work is the swap info menu
_______________________
benchmark of the day :
matmutant said:
flash JB kernel
in CWM, go to mount&storage :
then, format /system, /data and /cache (so that kernel can use the new partitions size)
then set up your swap
and install the rom
swap partition should work
what doesn't work is the swap info menu
_______________________
benchmark of the day :
Click to expand...
Click to collapse
Please show your settings.MATMUTANT
Sent from my U20i using xda premium
benchmark :
[/QUOTE]
SERIOUSLY. I haven't had a high score on my mimmi with my MiniCM7 with most of apps I need and apps for UI improvements(themes/widgets/etc). I also use v6 SuperCharger of zepplinerox. I only had a 1853 score. but this score is higher. does this have potential to overthrow the speed and performance of MiniCM7?
minicm10 doesn't have as much features as minicm7 or 9 but is much smoother and more powerful right now .
my settings are simple:
ksm on, disable hardware override on, swap file 128 , uv on, else: default
note that this screen shot was taken on a private nightly of the next release :

[porting help] Older kernels launch but newer kernels don't

Hello!
I was trying to port Vanilla Android to a tablet, but am finding it will not launch the kernel that would be required.
I have 3 kernels:
Kernel 3.19 (Aarch64, Gzipped, 2K pages, 7.8 MB, extracted from a lineage build from online) - Launches
Kernel 5.15 (Aarch64, Gzipped, 4K pages, 21.8 MB, from android/kernel/prebuilts/5.15) - Fails
Kernel mainline(Aarch64, Gzipped, 4K pages, 12.0 MB, built from source) - Fails
The 3.19 kernel successfully launches (but is too old to run the OS, and therefore libprocessgroup panics at exec)
Neither the 5.15 kernel nor the mainline kernel launch (they simply hang for a while then reboot, and fail to generate kmsg logs)
This is really confusing me, because all of the kernels target the same architecture, but only one of them actually launches. And the only differences in the generated boot image are the kernel and the page size header.
My only possible idea is maybe they have different built-in drivers? I can't tell because there are no kmsg logs.
The device's processor is a cortex-a7, if that info is of any use.
EDIT: Also, while gzipped Kernel 3.19 launches, it does not launch if it is gunzipped. Which makes me think maybe it's something to do with how much space it takes up? Or maybe the device is very particular about the format?
EDIT 2: Unzipping and re-zipping Kernel 3.19 with max compression and not keep name causes it not to work, making me think maybe it needs to be compressed in some weird method
Also, sorry if this is not the right place to get help with this. XDA is kind of hard to navigate

Categories

Resources