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. Nice post. I was checking continuously this blog and I am impressed!

    Extremely helpful info particularly the closing phase 🙂 I deal with such info a lot.
    I used to be seeking this certain info for a very lengthy
    time. Thank you and best of luck.

  2. Hi there I am so delighted I found your website, I really found you by mistake,
    while I was researching on Google for something else, Anyways I am here now and would just like to say thanks for a
    fantastic post and a all round enjoyable blog (I also
    love the theme/design), I don’t have time to read through it all at the moment but
    I have book-marked it and also added in your RSS feeds, so when I have time I will be back to read a lot more,
    Please do keep up the fantastic work.

  3. Heya! I’m at work surfing around your blog from my new apple
    iphone! Just wanted to say I love reading through your blog and look forward to all your posts!
    Carry on the outstanding work!

  4. Howdy! This is my first comment here so I just wanted to give a quick shout out and say I genuinely enjoy reading through your blog posts.
    Can you suggest any other blogs/websites/forums that cover the same
    topics? Appreciate it!

  5. I seldom drop comments, but after browsing a ton of remarks
    here Software Programming and Cooking | zen online journal.
    I do have 2 questions for you if it’s allright.
    Could it be only me or does it look like like some of the remarks appear like they are left by brain dead people?
    😛 And, if you are writing on other social sites, I’d like to follow anything new you have to post.
    Could you list of all of all your social community sites like your Facebook
    page, twitter feed, or linkedin profile?

  6. It’s the best time to make some plans for the future and it’s time to be happy.
    I have read this post and if I could I wish to suggest you some interesting
    things or tips. Maybe you can write next articles referring to this article.
    I want to read even more things about it!

  7. Woah! I’m really loving the template/theme of this site.

    It’s simple, yet effective. A lot of times it’s very difficult to get that “perfect balance” between superb
    usability and visual appearance. I must say you’ve done
    a very good job with this. Additionally, the blog loads very
    quick for me on Chrome. Exceptional Blog!

  8. Howdy! I know this is kinda off topic but I’d figured I’d ask.

    Would you be interested in exchanging links or maybe guest writing
    a blog article or vice-versa? My site covers a lot of the same subjects as yours
    and I think we could greatly benefit from each other.
    If you might be interested feel free to send me an e-mail.

    I look forward to hearing from you! Terrific blog by the
    way!

  9. Hello There. I found your blog using msn. This is
    a very well written article. I’ll be sure to bookmark it and return to read more of your useful information. Thanks for the post.
    I’ll certainly comeback.

  10. Hello! I know this is kinda off topic but I was
    wondering if you knew where I could find a captcha plugin for
    my comment form? I’m using the same blog platform as yours
    and I’m having trouble finding one? Thanks a lot!

  11. Hey! I could have sworn I’ve been to this site before but after checking
    through some of the post I realized it’s new to me.
    Anyways, I’m definitely delighted I found it and I’ll be book-marking and checking back frequently!

  12. An impressive share! I’ve just forwarded this onto a colleague who has been conducting a little research
    on this. And he in fact bought me dinner because
    I discovered it for him… lol. So allow me to reword this….
    Thank YOU for the meal!! But yeah, thanks for spending
    time to discuss this subject here on your web site.

  13. I am not sure where you’re getting your information, but great topic.
    I needs to spend some time learning much more or understanding more.
    Thanks for wonderful information I was looking for this information for my
    mission.

  14. Wow that was odd. I just wrote an incredibly long comment but after I clicked submit my comment didn’t appear.
    Grrrr… well I’m not writing all that over again.
    Anyway, just wanted to say superb blog!

Leave a comment