How to compile a kernel for Nexus S? - Nexus S Q&A, Help & Troubleshooting

Is it actually possible?
I only have some basic java experience. Let's say I have a little of everything but basic. There seems to be no actual tutorial. Now I was about to make a big manual for Android Developers using our device as an example to develop for.
Now I was wondering how to do the kernel part.
Is anyone willing to give me a brief tutorial or explanation where to start?
I hope to merge all scattered mods over XDA into one package for newcomers and including howto's and exxplanation of governors...
If there are people willing to help making the manual itself. Those are also welcome. I can use human spelling checkers !

I found a very good step by step guide here:
http://forums.androidcentral.com/t-.../48675-how-compile-nexus-s-kernel-source.html

veagles said:
I found a very good step by step guide here:
http://forums.androidcentral.com/t-.../48675-how-compile-nexus-s-kernel-source.html
Click to expand...
Click to collapse
this is great ! it says need 64 bits Linux , can it be running in VM ?

yessir you can vm it!
I'm running win7 and vm'ing ubuntu for phone stuff.
side note, you need a more than decent pc for it to not take 4 years... I'm running an I5 OC'd and 16gb ram, using a 250GB HD "os" space for linux. takes about 2 hours to compile a full rom with the pc doing nothing else.
FYI the install says you only need 18Gb when setting up..lol dont listen to them.. when compiling (roms especially) it gobbles up space.. last clean built i was testing ate 190GB for itself, and spit out a 109Mb rom
Kernels are far less demanding, but plan for the future instead of re-installing a vm box 2 weeks down the road

t3xboar said:
yessir you can vm it!
I'm running win7 and vm'ing ubuntu for phone stuff.
side note, you need a more than decent pc for it to not take 4 years... I'm running an I5 OC'd and 16gb ram, using a 250GB HD "os" space for linux. takes about 2 hours to compile a full rom with the pc doing nothing else.
FYI the install says you only need 18Gb when setting up..lol dont listen to them.. when compiling (roms especially) it gobbles up space.. last clean built i was testing ate 190GB for itself, and spit out a 109Mb rom
Kernels are far less demanding, but plan for the future instead of re-installing a vm box 2 weeks down the road
Click to expand...
Click to collapse
....
you use VMBOX?
i have VMware Workstation , seems it doesn't have 64 bits support ...unable vm 64 bits system...

qtwrk said:
this is great ! it says need 64 bits Linux , can it be running in VM ?
Click to expand...
Click to collapse
Download Ubuntu 10.04 LTS 64-Bit
Install that in either VMWare Player or Virtualbox. Both are ok.
I have 8GB RAM having 4GB RAM dedicated to my Ubuntu VM. Combined this with a 2630QM cpu compiling on 8 cores gives me also 1-3 hours.
Most of the time I play counter strike at the same time. Limitting my VM to 6 cores and counterstrike to my last 2 ones.
That guide looks like setting up an environment for compiling a ROM. But with few changes for the kernel. I will try this out as soon as possible! Thanks!
I will upload my manual when it is done!

Ya i use virtualbox its 64bit.
and no real need fora guide - there are tons out on the web. all basically the same.
get Vbox up and running (dont listen to them for HD space.. use an excessive ammount 150-200GB+) then pull your trees etc.. and have fun !

You could also install Ubuntu alongside Windows in dual boot. That's how I run it.
Sent from my Nexus S by using my thumbs..

Related

Only reading 620 MB of ram of 768?

Is there something going on here I don't know about after flashing roms and only reading 620MB of ram instead of the 768MB? I have dug into this thing 6 ways of sunday and I have installed several roms. I am currently running RCMixHD Kingdom sense rom.... with leedroid kernel. I am only seeing part of the RAM.... whats up with that?
The other RAM is not in fact "hidden" to my knowledge it is only nto appearing because it is taken by the core processes running the phone.
If you are familiar with Windows, and you have 4Gbs of RAM, in the end you will only have like 3.50...
some is reserved for the gpu, some reserved for the radio, etc. You'll never see the full amount of what any manufacturer states. Its all there, you just can't use all of it.
ThEiiNoCeNT said:
The other RAM is not in fact "hidden" to my knowledge it is only nto appearing because it is taken by the core processes running the phone.
If you are familiar with Windows, and you have 4Gbs of RAM, in the end you will only have like 3.50...
Click to expand...
Click to collapse
I figured this was the issue- I was just wanting to make 100% sure I was not missing something. Thanks for the replies!

[Q] Any SGS4G Kernels with Swap Support?

Are there any other existing kernels for sgs4g besides the ones on the first page?
Reason I ask is because I'm trying to use a swap partition, but it seems these kernels are not swap enabled.
Why has nobody bothered to compile any custom kernels for the sgs4g? I am trying myself, but no luck so far.
Any ideas?
Thanks,
S
sconsylman said:
Are there any other existing kernels for sgs4g besides the ones on the first page?
Reason I ask is because I'm trying to use a swap partition, but it seems these kernels are not swap enabled.
Why has nobody bothered to compile any custom kernels for the sgs4g? I am trying myself, but no luck so far.
Any ideas?
Thanks,
S
Click to expand...
Click to collapse
I'm not sure I can answer the whole question as to why we don't use swap, but I can say that we just got the GB kernel source, and people are still working on it and haven't posted anything.... yet. Patients...
But, I noticed that the Bali 3.3 kernel (KD1) also did not have swap. Maybe drhonk and Krylon360 tried it and swap didn't help or improve performance.
The rest of the kernels you'll find are either stock leaks, or modified stock leaks. Samsung doesn't like swap I guess. Or swapping on SD/MMC sucks hard.
I know in newer kernels (3.0 and greater), there is a new driver for mtd-swap, but it is still very new and I doubt anyone will use it in production for quite some time.
Using swap on Android is not such a great idea, it goes a little bit against native Android memory management. Then benefit can be that more programs will stay in memory and won't need to reload, but the phone will become a lot slower, even with small partitions like 32MB. With 128MB or higher it will become almost unusable. Ask me how I know
I think the need for swap was gone once phones started coming with 512mb+ ram. I used swap all the time (also required for GB) on my MT3G, since it only had like 192mb ram. It never made the phone work faster at all, in fact it usually slowed down over time running, it really just made it so stuff didn't force close due to running out of memory. This shouldn't be needed on this or any new phone.
So Bali 3.3 is a GingerBread build? Didn't know that. Kinda figures I guess. Thought I had already tried it though and couldn't bootload. I'll give it another whack. His stuff is awesome of course. I'm not demanding it, mind you, just trying to see why it would not be included. Kind of like not having a /proc/config.gz file in some Android builds, don't really know the reason why they're not included (results in not able to mount ubuntu builds, anybody have these let me know .
This appears to be the only source of kernels for our phones, no swap support enabled though. http://forum.xda-developers.com/showthread.php?t=1194032
(Thanks dr.honk!)
As for the swap partition not making sense, I have a hard time understanding why it wouldn't just provide a static and beneficial extended memory source. I am familiar with the memory management features of Android, and actually don't use any additional task killers as I've found them to be conflicting often.
But Android is built off the Linux system/kernel, so why does dedicated swap work with a large OS but not the smaller but similar Android OS/kernel?
Thanks!
sconsylman said:
As for the swap partition not making sense, I have a hard time understanding why it wouldn't just provide a static and beneficial extended memory source. I am familiar with the memory management features of Android, and actually don't use any additional task killers as I've found them to be conflicting often.
But Android is built off the Linux system/kernel, so why does dedicated swap work with a large OS but not the smaller but similar Android OS/kernel?
Click to expand...
Click to collapse
In short, the phone will become annoyingly slow.
Swap works on kernel level. Android will see this as additional virtual memory, so it will keep more programs alive and won't unload them. For example a browser will hog a lot of memory causing other programs' memory pages to be swapped. Kernel doesn't differentiate between programs, so, for example, the launcher memory pages will be swapped. Or even the active program you are currently working with can have part of its memory in the swap. Next time you try to do something (like scrolling), the memory pages will have to be brought back. Flash memory is not particularly fast (in fact for swap it is very slow), so you can we waiting for some noticeable time for many actions to complete. You'll have a lot of jerky movements, delays, temporary freezes, forget any smoothness. It is just annoying, trust me, I've tried
Ah, ok so the swapping is noticeably slower than the ram on the phone (512mb). I would not figure that it would be too much of a factor, especially on class 6+ sd cards. So there is absolutely no way of coding the system apps to be ram based, and everything else to be swappable? I'm surprised that this has not been done, but I assume that the reason is the expanding active ram capacities on new phones.
So were you experimenting on the sgs4g, or was it another model? And if so, what were you using? Froyo swap enabled kernel?
The HTC Thunderbolt has some similar specs.
http://forum.xda-developers.com/showthread.php?t=1106420
More ram 768mb vs 512mb, more internal storage 4g vs 1000mb, but uses a 1g single core scorpion processor instead of our 1g single core hummingbird. Some are having good luck with this device and swapping (taking all "facts" with a grain of salt). There is more like this too, with a number of market apps to support swapping: Swapper2, Swap for Root, Diaper swappers forum (oops, that one doesn't work for some reason).
sconsylman said:
So Bali 3.3 is a GingerBread build? Didn't know that. Kinda figures I guess.
Click to expand...
Click to collapse
No, Bali 3.3 is Froyo.
I did try it on this phone few months ago when I was still on Froyo with Bali kernel. Don't try to load in on GB, wait until DrHonk makes a new one, he actually may soon.
I personally can't imagine how anybody could use swap on Android and like it, but everybody's mileage varies. The benefit of using swap wouldn't be speed but rather less program reloads. For example you browse the web when a call comes. You answer the call, maybe go to address book, or take some notes, or send some pictures, etc. Everything will be a little slow and jerky, but with swap enabled you have better chance that when returning to the browser it will still be on the same page without reloading from the server.
Just checking again to see if anyone knows of any KJ6 kernels with swap enabled, as I'm currently getting memory warnings from running Backtrack 5 non-gnome. It works pretty well otherwise (besides the lack of space, thanks obsolete fat32).
??
sconsylman said:
Just checking again to see if anyone knows of any KJ6 kernels with swap enabled, as I'm currently getting memory warnings from running Backtrack 5 non-gnome. It works pretty well otherwise (besides the lack of space, thanks obsolete fat32).
??
Click to expand...
Click to collapse
No swap. what version of the kernel are you running?
bhundven said:
No swap. what version of the kernel are you running?
Click to expand...
Click to collapse
Sent from my SGH-T959V using xda premium
2.6.35.7 KJ6-CL694138
It has [email protected]#9 signature on it. I know we had spoken briefly about swap. What linux are you running?
I know that the Debdroid program is successfully running swap with good results, but it won't mount right with the specific scripts (our phones working mount scripts are different, I linked them in my linux post). I can take some coding from that programs scripts but of course it won't work without the kernel having swap built in.
Sent from my SGH-T959V using xda premium

[DEV][CONCEPT] Booting with an uncompressed kernel to get more RAM

Hi,
I have discovered that building a boot.img with a standard Image (instead of zImage) works out of the box. Booting time is (apparently, I didn't notice) a little slower since copying the full image to RAM is slower than decompressing the gzipped original.
Reference: http://free-electrons.com/blog/uncompressed-linux-kernel-on-arm/
Next task is modifying the kernel boot code to directly access the kernel rather than copying it to RAM, or something similar. I was thinking (rather, wishing) that using uncompressed Image would automagically give us a few extra MB of RAM capacity since it doesn't need to allocate any memory for both the compressed image and uncompressed Image.
Though I'm stuck on trying to find the code in the arm kernel (boot process) that I can play with. I've been reading this as a reference - ARM Linux Boot Sequence
Any help/ideas? Cheers!
P.S. I run an Xperia Play that is 512MB but only 362MB available in userspace, hence why I'm so determined to experiment with this. Getting an extra few MB would really help
To be executed the kernel must reside in RAM. Uncompressed or compressed the final size is the same as it will end up uncompressed in RAM.
Sent from my GT-I9100 running CM10
MemoryController said:
Uncompressed or compressed the final size is the same as it will end up uncompressed in RAM.
Click to expand...
Click to collapse
Yes but the zImage must be copied to RAM, then the zImage is decompressed to another RAM block. The ARM boot sequence says nothing about deleting/freeing the original zImage copied to RAM once decompressed. That's my main question, where do I check in code for this kernel decompression process.
Of course it gets deleted
Sent from my GT-I9100 running CM10
MemoryController said:
Of course it gets deleted
Sent from my GT-I9100 running CM10
Click to expand...
Click to collapse
How do you know that? It's not always the case. And why must it only be executed from RAM? How can I find how much dynamic RAM the kernel allocates using a compressed vs uncompressed image? Is it possible to use XIP and DRIP in Android like other ARM Linux?
Nevermind, I've found everything I need right here - http://elinux.org/Kernel_Size_Tuning_Guide
EDIT and here - http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html
CosmicDan said:
How do you know that? It's not always the case. And why must it only be executed from RAM? How can I find how much dynamic RAM the kernel allocates using a compressed vs uncompressed image? Is it possible to use XIP and DRIP in Android like other ARM Linux?
Nevermind, I've found everything I need right here - http://elinux.org/Kernel_Size_Tuning_Guide
EDIT and here - http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html
Click to expand...
Click to collapse
Well xip/drip would require nor flash and I don't think any phone has nor flash. Good thinking though
Sent from my GT-I9100 running CM10
MemoryController said:
Well xip/drip would require nor flash and I don't think any phone has nor flash. Good thinking though
Sent from my GT-I9100 running CM10
Click to expand...
Click to collapse
Yeah after reading more about it it's probably a dead end lol.... but I'm keen to squeeze out a tiny bit more RAM and will explore other options in compiling the kernel. The Xperia Play only has 344MB available to the user disabling 720p recording pushes that up to 362MB but I'm looking for more things to try.
CosmicDan said:
Yeah after reading more about it it's probably a dead end lol.... but I'm keen to squeeze out a tiny bit more RAM and will explore other options in compiling the kernel. The Xperia Play only has 344MB available to the user disabling 720p recording pushes that up to 362MB but I'm looking for more things to try.
Click to expand...
Click to collapse
Have you considered compcache? It won't actually increase RAM size but it will give you some ultra fast swap
Sent from my GT-I9100 running CM10
MemoryController said:
Have you considered compcache? It won't actually increase RAM size but it will give you some ultra fast swap
Sent from my GT-I9100 running CM10
Click to expand...
Click to collapse
Yeah I've got a ZRAM script in there using 10%, considering the Xperia Play can do 1.5GHz stable I have considered experimenting with higher percentages and swappiness values and doing benchmarks/real use tests. But that takes a lot of time, I'll fine tune that another time.
EDIT: I wonder if it's possible to use 100% zram with swappiness at 100.... lol....
CosmicDan said:
Yeah I've got a ZRAM script in there using 10%, considering the Xperia Play can do 1.5GHz stable I have considered experimenting with higher percentages and swappiness values and doing benchmarks/real use tests. But that takes a lot of time, I'll fine tune that another time.
EDIT: I wonder if it's possible to use 100% zram with swappiness at 100.... lol....
Click to expand...
Click to collapse
Lol I don't think so, you must leave enough ram for the kernel at least so that it can actually handle the page faults
Sent from my GT-I9100 running CM10
MemoryController said:
Lol I don't think so, you must leave enough ram for the kernel at least so that it can actually handle the page faults
Sent from my GT-I9100 running CM10
Click to expand...
Click to collapse
Haha. Well ive also been reading about new size optimizations in linaro toolchain too so im going to try building with that too, maybe hack-out some more things like bluetooth headsets and reduce pmem allocations. Gonna experiment with a lot of stuff.
Thanks for the tips and chat
Sent from Xperia Play (R800a) with Tapatalk
CosmicDan said:
Haha. Well ive also been reading about new size optimizations in linaro toolchain too so im going to try building with that too, maybe hack-out some more things like bluetooth headsets and reduce pmem allocations. Gonna experiment with a lot of stuff.
Thanks for the tips and chat
Sent from Xperia Play (R800a) with Tapatalk
Click to expand...
Click to collapse
No problem, hope you work it out.
Sent from my GT-I9100 running CM10

[Q][SOLVED]Compiling CyanogenMod from source...

I have read the instructions given at http://forum.xda-developers.com/showthread.php?t=2162951, and it is evident (from the given guide, and a few others) that, Cyanogenmod can be compiled only on 64-bit PC's.
My question is,
1. How much time would it take to compile CyanogenMod (particularly Jellybean) on a dual-core PC?
I am going to use the processor Intel® Core™ i3-540 , which has a dual-core, and four threads. (So, I may well use "brunch cm_pico-userdebug -j4".)
How much time would it approximately take, or should I consider upgrading to a better processor?:fingers-crossed:
If I must consider upgrading my processor, please recommend one.
2. Also, can I download the source given at (repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1) as a zip file?:silly:
I have seen that the drivers and other stuff, the vendor tree, device tree, kernel source, etc, can be downloaded as a zip file. In a similar way, can the source be downloaded as a zip file?
I tried going here (https://github.com/CyanogenMod/android/tree/cm-10.1), but the folder had only 4 files... So, what can be done?
The main reason I asked this question is that I have a slow internet connection... 4 Mbps (512 KBps) until 8 GB. But, I get only around 450 KBps. And, after 8 GB, the speed drastically reduces to 50KBps to 60 KBps (512 Kbps).:crying:
Thanks in advance to all the replies.
I have the same config.. almost ... people have compiled cm on 32 bit computers and p4s so I think though you will have to wait a lot.. it will be done.. if you upgrade your pc.. it will be compiled faster... and internet connection.. better get a better one..
What about pausing the download?
akshat.shenoy said:
I have the same config.. almost ... people have compiled cm on 32 bit computers and p4s so I think though you will have to wait a lot.. it will be done.. if you upgrade your pc.. it will be compiled faster... and internet connection.. better get a better one..
Click to expand...
Click to collapse
I read somewhere that repo syncing can be paused by using Ctrl+Z. I keep my computer running almost the whole day, and so, it wouldnt be much of a problem, even if it was only 50-60 kBps. Could I pause the downloads, so that, I can resume the download the next day, giving the computer a little bit of rest?
And, how is it compiled on 32-bits, and especially P4's? I got an old computer which is a P4. I could use it.
Replying to my own questions
vineethraj49 said:
I read somewhere that repo syncing can be paused by using Ctrl+Z. I keep my computer running almost the whole day, and so, it wouldnt be much of a problem, even if it was only 50-60 kBps. Could I pause the downloads, so that, I can resume the download the next day, giving the computer a little bit of rest?
And, how is it compiled on 32-bits, and especially P4's? I got an old computer which is a P4. I could use it.
Click to expand...
Click to collapse
Repo syncing sure can be paused But, problem is a project-wise resumable syncing is only supported.
In simple words, if you synced half-way through a project, you will not be able to resume it, end of story!
32-bit PCs, compilation, sure yes! ICS can (and has been) compiled on 32-bit PC's (example: Evervolv ICS by immortal_yash). Kernel compilation, 32-bit will do. But, the older your computer, the longer the compilation.
Example: An i3 3rd gen can compile a kernel in ~5 minutes, while it takes ~40 minutes in a Pentium 4 (personal experience)
Anyways, now that I got an Intel i3-3220 (3rd gen undoubtedly ), and have also compiled CM9 on it :victory: , thanks for awesome guides available in this forum and the help of many. :highfive:
I think it is time for this thread to be marked as [SOLVED]

[q] cyanogenmod support for one sv

Are there anyone trying to make CM for our One SV? There are some threads in here about CyanogenMod but no one is not posting any progress or if they had stop working on it. I thing our phone is capable of running Cyanogenmod but why is it that no one has success making the ROM? Can someone please tell me why?
luise_sarmiento said:
Are there anyone trying to make CM for our One SV? There are some threads in here about CyanogenMod but no one is not posting any progress or if they had stop working on it. I thing our phone is capable of running Cyanogenmod but why is it that no one has success making the ROM? Can someone please tell me why?
Click to expand...
Click to collapse
Why? Because nobody who has the device has the knowledge.
And to be honest: i also don't believe that there will be a usable cm for this phone. The guys who have it, don't know how and there will be not much new users, because the phone is running out of its lifecycle. So the people buying newer phones.
I agree with old.splatterhand. The biggest problem is that the source deals with a LOT of C which not too many people here know about or have years of experience dealing with it.
C isnt that hard to learn but if not careful or written out just right then you can get many errors, warnings, and conflictions while trying to compile.
Also, working with such source as CM puts a heavy load on your computer. So unless you have a machine packing in a lot of power, then you will most likely fry your PC. I had to abandon the project myself due to my PC not being powerful eough to handle its load and didn't want to take the chance of destroying my computer because I can't afford to get another one at the moment lol.
Sent from my C525c using Tapatalk
Destroying pc? Lol, it will only take more time on slower pc. If in some crazy scenario cpu fan stop, termal protection will showdown pc.
I was force to do some render (3ds max and V-Ray) on mine old Barton 3000+ it take more then 20h with cpu @100%. And nothing wasn't explode or burn.
bataya said:
Destroying pc? Lol, it will only take more time on slower pc. If in some crazy scenario cpu fan stop, termal protection will showdown pc.
I was force to do some render (3ds max and V-Ray) on mine old Barton 3000+ it take more then 20h with cpu @100%. And nothing wasn't explode or burn.
Click to expand...
Click to collapse
You were fortunate, but it can definitely destroy a computer if the work load is too great. Ask @russellvone what happened to his last pc lol, and if my memory serves me correctly he was just merely trying to build a kernel.
Sent from my C525c using Tapatalk
Modding.MyMind said:
You were fortunate, but it can definitely destroy a computer if the work load is too great. Ask @russellvone what happened to his last pc lol, and if my memory serves me correctly he was just merely trying to build a kernel.
Sent from my C525c using Tapatalk
Click to expand...
Click to collapse
I burnt 2 pc's
building cm and aosp.....
old Toshiba's that came with XP lol
but that won't happen again with my new system76 bonobo extreme!
Sent from my HTC6525LVW using Tapatalk
All in all its only one point, but yes, you need a powerful PC to build things. Not everybody can spend 20 hours to build a rom which isn't maybe booting.
At all it does not change the basic situation: you need free time and knowledge to do.
And there are newer devices coming, with actually still support from the manufactor, so "new/interested" people will not buy an outdated phone.
No consolation, but our device is not alone with this problem. Many other "midrange" devices have no real developer support. Everybody is concentrating on the flagships.
old.splatterhand said:
At all it does not change the basic situation: you need free time
Click to expand...
Click to collapse
That's why I am taking up on theming. Its less time constraining and even so, you can work with such projects on the fly using your device which is very convenient for those not by a pc all the time. Can even run your projects on the fly for the purpose of debugging which is REALLY nice. I work too much in real life and I have my family to be there for so I make due with what free time I can get.
Sent from my C525c using Tapatalk
Let someone gather the working tree. Project compile - not a problem.
Home PC1 - CPU - i5 3570K, RAM 16 GB, SSD 120 GB + HDD 500+500+1000 GB.
Home PC2 - CPU - i7 4770K, RAM 32 GB, SSD 120+240 GB + HDD 500 GB.
Compilation is very fast. Just show me, what code to compile.
^Nice setup.
BrateloSlava said:
Let someone gather the working tree. Project compile - not a problem.
Home PC1 - CPU - i5 3570K, RAM 16 GB, SSD 120 GB + HDD 500+500+1000 GB.
Home PC2 - CPU - i7 4770K, RAM 32 GB, SSD 120+240 GB + HDD 500 GB.
Compilation is very fast. Just show me, what code to compile.
Click to expand...
Click to collapse
You should give that to me hahahaha
Sent from my C525c using Tapatalk
Modding.MyMind said:
You should give that to me ...
Click to expand...
Click to collapse
Only if I come to visit my sister in Miami.

Categories

Resources