Software Programming and Cooking


Apart from the incidental choice of word “Cooking” to describe Windows Mobile ROM development process, I found out that recently there is really a great similarity between software programming and cooking.

With cooking, you master the science of key culinary skills, and then with some creativity,  you venture into dishing out different cuisine. I am not a food connoisseur, so you don’t expect me to go into details on this, but you should get the point.


 

Now, turning over to software programming (oh my, I suddenly feel so at ease), there is alot of similarities. You need to master the fundamental programming techniques, and you exposed into different type of programming; UI programming, Web programming, Data integration programming, Kernel programming .

And yes, recently I had ventured into kernel programming, something I have never imagined in the past. The reality though is that I was just meddling around with the Linux kernel source, thanks to  Opensource.

So I looked at the various kernel source codes published by various xda-developers, each of which addresses different aspect of kernel improvements. I decided to make a kernel that takes the best of all. The end product is one kernel that incorporates sztupy‘s Universal Lagfix, supercurio‘s Voodoo display tweak (Gamma and Sharpness enhancement), raspdeep‘s overclock and undervolt, and hardcore/ykk_five 341MB memory hack.

Universal Lagfix addresses the poor performance  inherent in Samsung’s original RFS-based storage. The fix is about reformatting specific data partitions into Linux ext4 format, and by doing that, you can expect 200-300% of improvement. The applications no longer run with intermittent freezes (caused by the lag in the file system access), and responses are therefore almost instantaneously.

So one would think, with a 200-300% improvement in performance, what is there to optimise further?

Now Samsung Galaxy S comes with 512MB of RAM, as you would expect from a top tier smart phones in the market. The problem with Galaxy S, is that the amount of RAM available for end user, is only 304MB. There are more than 200MB of RAM reserved for the system, such as video, android OS, etc. It didn’t help when Android has a bad habit of loading installed applications and widgets on start up, which means by the time your phone boots up successfully, you would be lucky to have 80MB RAM free for use. Now in Froyo, the memory management is far more robust than Eclair, but still, with a limited amount of free memory, you end up having frequent memory clean up performed by the OS, resulting in unnecessary instability in the system.  Both ykk_five and hardcore researched and figured out the kernel configuration for reserved memory. With some trial and error (as eliminating memory reservation causes problem with certain applications such as video recording or 3G video call), the folks in xda-developers established the optimal memory configuration. The result is 341MB of available memory (as compared to 304MB). That ensures some stability much needed in the Samsung Galaxy S.

And you would think by now; Samsung must have done something wrong if any more tweaks can be uncovered. You bet! The question now is how much have we optimised the  Cortex A8  processor, i.e. the brain of Galaxy S.  When looking at the kernel source code, folks have figured out that there are compiler flags we could use to compile the kernel to take advantage of the A8 Cortex CPU architecture. Not only that, the team has figured that the CPU can be over-clocked, just like how the PC geeks would have done to their desktop processors.  Additionally, the CPU is currently running at a voltage level that can be further tweaked, i.e. reducing the voltage consumption value  for each CPU frequency step. The end result, is a turbo-charged but super “air-cooled” (and efficient)  Galaxy-S. Unfortunately, there is no real tool out there to measure CPU voltage consumption scientifically, so one can only rely on feel (e.g. lower temperature) and experience (battery consumption level). That said, the under-volt tweak is still being refined as we speak, just to determine the optimal level of voltage that is low enough but not at the expense of CPU running reliably at the desired frequency.

The final installment of the tweak is display. supercurio had definitely done far more research than anybody in xda-developers, and probably even in Samsung development team, to improve on the display gamma and sharpness. More explanation can be found in his web-site, so I wouldn’t regurgitate what has already been documented.

And of course, there are some minor tweaks I did along the way, as I touched the source code for the above tweaks. However, these are experimental at this point, it’s probably not smart for me to disclose until I can conclusively determine the value of such tweaks.

Did I mention the code name of the kernel I have customised? Yet Another Optimised Kernel (YA OK!) … So go flash this kernel  if you happen to own a Galaxy S (sorry only for Europe and Asia Galaxy S owners) and want to turbo charge your phone. You will be surprise how buttery smooth your phone is, and it is definitely much faster than the Voodoo’ed Galaxy S I had awhile back.

Here’s a quick video capture of my Galaxy S running on YA OK Kernel. Enjoy.

114 thoughts on “Software Programming and Cooking

  1. Jennie says:

    I was curious if you ever considered changing the layout of
    your site? Its very well written; I love what youve got to say.
    But maybe you could a little more in the way of content
    so people could connect with it better. Youve got an awful lot of text for only having
    1 or 2 pictures. Maybe you could space it out better?

  2. Currently it looks like WordPress is the top blogging platform out there right now.

    (from what I’ve read) Is that what you’re using on your blog?

  3. Have you ever thought about including a little bit more
    than just your articles? I mean, what you say is fundamental and everything.
    But just imagine if you added some great pictures
    or videos to give your posts more, “pop”! Your content is excellent but with images and video clips,
    this website could undeniably be one of the most beneficial in its field.

    Good blog!

  4. An impressive share! I have just forwarded this onto a co-worker who
    was conducting a little homework on this. And he in fact ordered me breakfast due to the fact
    that I found it for him… lol. So let me reword this….
    Thanks for the meal!! But yeah, thanks for spending time to talk about this matter here on your web page.

  5. It’s actually a great and helpful piece of info.

    I am satisfied that you simply shared this useful info
    with us. Please keep us informed like this. Thank you for sharing.

  6. Hmm it seems like your site ate my first comment (it was
    extremely long) so I guess I’ll just sum it up what
    I submitted and say, I’m thoroughly enjoying your blog.
    I too am an aspiring blog blogger but I’m still new to everything.
    Do you have any suggestions for rookie blog writers?
    I’d really appreciate it.

  7. My partner and I stumbled over here by a different website and thought I might as well check things out.
    I like what I see so i am just following you. Look forward
    to looking into your web page again.

  8. With havin so much content and articles do you ever run into any problems of
    plagorism or copyright infringement? My site has a lot of unique content I’ve either created myself or outsourced but it
    looks like a lot of it is popping it up all over the web without my authorization. Do
    you know any methods to help protect against content from being ripped
    off? I’d genuinely appreciate it.

  9. Thanks for some other magnificent article. Where else may anyone get that type of information in such a perfect approach of
    writing? I have a presentation subsequent week, and I am on the search for such info.

Leave a comment