TimeLinux1

Monday, April 9, 2012

Linux and Android Kernel Merge

Recently, Tech circles especially the Opensource ones were abuzz with a news that caught many eyes. The creator and top level maintainer of Linux kernel, viz., Linus Torvalds merged the code base of Android into Linux kernel in March 2012. This was after over 2+ years when he had dropped the Android drivers from Linux previously in late 2009.
As you are perhaps already aware, Android is a fork of Linux kernel codebase. It has actively been developed by Google. The initial seed source code came from Linux kernel but over time, as with all forks, it diverged greatly. As a result they were not compatible with each other natively, not atleast you were a kernel developer and had no problem getting hands dirty in the guts of Linux/Android kernel programming; not until now at least.
The kernel is the heart of the OS. Inside all the Linux out there, the kernel is the piece of the OS that is downright closest to the hardware with complete control of all the hardware interface and system calls. As an end user, one hardly notices it since almost all of our time and interactions are spent on the user interface of the OS which represents the so called 'user space'. Remember, a complete OS is comprised of 1) the kernel running in the 'kernel space' of your computer's-memory and 2) the user interface (Applications like browser, spreadsheets, documents etc) that run in the 'user space' of your computer's-memory. The kernel is the first thing that runs after a system boots up and like I said earlier, manages all the hardware and operations native to the OS. In other words, kernel is indispensable to the proper functioning of the OS.
Going back to our topic, although once upon a time, Android codebase originated in Linux, over time, they diverged resulting in several incompatibilities. However, with the explosive growth and popularity of Android on the mobile phone and tablet segments, it was a matter of time that it was considered a suitable candidate to return home to Linux codebase.
Now why is that important? Well, the reason it is important is because, Linux kernel dominates the Enterprise computing. There is hardly any organization from a Fortune500 to a one man shop in a garage that does not have awareness of  the relevance of Linux in Business. It is the most secure, stable, scalable, networked and yet surprisingly affordable Computer Operating System on the planet. On the other extreme of the spectrum, Android is the most popular Operating system on the mobile segment. Where Linux lacks is the personal computing or desktop segment. Even after 20 years of existence, the share of Linux Operating system on the desktop computing segment is a sad 2% or less. In other words, Linux dominates on the Large and the small computer segments but is missing in the middle (desktop segment). Now with the merger, it would be safe to say that there would be a sizeable concentration of Linux/Android kernel developers who would go creative and start porting the best features of both Linux and Android into the desktop Linux segment. Who knows in a short time, you may have OEM vendors ready to pre-install Linux onto their desktops/laptops resulting in the obvious increase of Linux market share from 2% to 25%. or 50%? or even 90% one day? We certainly would love to wait for that to happen..

Friday, April 6, 2012

Fedora 16 on Sony Vaio S series Laptop - Part 2

Ok. So after settling down on Sony Vaio S, here is my experience of the Fedora 16 install and why I would give it 7 out of 10 (instead of 10 out of 10).
As you know the overwhelming majority of OEM laptops come pre-installed with Windows. Therefore its always a could be/should be guessing game when trying to reverse engineer and installing Linux -- you have to take the chance and its better to have a clear idea of what you want.
And so here was the plan:
1) Download and create ISO image of the Linux Distro of choice
                      (I tried both Ubuntu 11.04 AND Fedora 16)
2) Run the ISO image as a LiveCD to test compatibility -- if that goes fine,
3) Use a Partition tool like GParted  (or Windows native disk utility) to resize the Windows Partition.
4) Install the Linux distro of choice (Ubuntu / Fedora in this case) to dual  boot with Windows
5) Check everything (all devices / apps) run fine in Linux.

Step 1 was no brainer, it depends on your Internet connectivity to download. Both Ubuntu 11.04 and Fedora 16 are about 700 MB in size (much smaller than the 3+ GBs of Windows7). Make sure when you try to burn the ISO to a CD, you dont see any weird errors. In my experience the download was fine but when I tried to burn using Windows Disk Burner utility, there were errors and I had to reject that disc and retry the burn.

Step 2 of the process (Live CD) was a little hiccupy with both Ubuntu and Fedora. When I ran the Ubuntu Live CD, the machine just froze and I had to abort it (even with 8 GB of RAM!!). It worked the 2nd time though. Its slow but it works. With Fedora, the disc could not be recognized. At this point, I had to decide whether to for Fedora at all and I decided that I will try nevertheless (it was a good decision in the end and I will explain shortly).

Step 3, I resized the disk space. Factory installed Windows was occupying all of the 256 GB with about 25 GB occupied by Windows itself (ie about 225 GB usable -- isnt Windows bulky occupying 25 GB?). I used the windows disk manager utility (Start > Computer > Manage > Disk Management) to shrink the Windows partition/volume to 100 GB. So therefore I made 250 - 100 = 150 GB for Linux.

Step 4 is the fun step. I first tried Ubuntu. The installer runs like a charm. Make sure you choose 'Run Ubuntu alongside Windows' option during the Installation Options screen. You breeze past the usual installation questions around disk configuration, computer name, locale, timezone, users yada yada and within 15 minutes (if you have an SSD and 8GB RAM like mine), the install is done. But wait, dont jump in excitement just yet. When you reboot the machine, there comes the problem. The computer just wont show the GRUB Boot loader and hence you cannot boot -- neither Windows nor Ubuntu. Oops? Why is that? Thankfully I had another computer that still worked and with that I googled and found out that GRUB version 2.0 which comes with Ubuntu 11.04 is incompatible with SSD on the Sony VAIO. It cannot locate the boot sector. Bummer! So at this point what to do, do I try to fix GRUB by re-configuring it or try Fedora instead? Well I decided I will give Fedora a try.
OK so there I insert the Fedora Disk and after afew clicks get to the desktop which shows the 'Install Fedora' icon on desktop. First time I click it, I get a weird error at the bottom of the screen "Cannot detect Media" which is odd, since I AM using the media at that point. and I cannot proceed. So I abort the install (by hard booting the laptop) and insert the Fedora 16 disk again. This time when I click the 'Install Fedora' I didn't get the error. The install is fairly simple with usual questions on disk config, locale, users etc. After the 'Installation succeeded' message, I pray that I dont get the same error as I got with Ubuntu. And I reboot.
And yess, Fedora 16 comes with GRUB 1.99 (not 2.0 like in Ubuntu) and yess I see the Grub options -- Fedora 16, Fedora 16 Rescue and Windows.
In nutshell on Step 4, I would say the install process is at best a 8/10. I wish I did not have to reinstall over Ubuntu and abort Fedora in the first attempt.

Step 5 is interesting; being a heavily web oriented user, I tried to load up my favorite web pages. One of the first things you notice is the fact Fedora comes with Firefox preinstalled and it is missing some of the plugins to run Flash. You can bypass this using either the yum or manually by downloading the rpm.
I chose yum --- yum install flash-plugin -- as root.
After that I check the device. All the devices (including webcam, microphone, wireless etc) work except the SD card reader. Sony has proprietary drivers needed which are not part of the Fedora base yet.
But the most prominent thing you notice is how loud the fan runs with Fedora 16 on Sony VAIO. Turns out the AMD catalyst video drivers are not compatible with Fedora 16. I Downloaded and installed the Catalyst drivers 11.11 from http://support.amd.com/us/gpudownload/linux/Pages/radeon_linux.aspx but on reboot, the login screen never shows up. Halfway through the boot up, the screen goes blank and hangs. The only way out is to login via a console as root and uninstall the driver to return the system to the initial state with the opensource drivers. Well, while the opensource drivers allow gui login and all it kills the battery life due to cpu/gpu overheat and excessive fan noise. :( We hope that the opensource drivers are rendered compatible to catalyst in a soon to be released Fedora. So why is it bad? Well its bad because it causes the battery to drain profusely. If the fan runs crazy due to over heating, the battery runs out in 1 hour 30 minutes instead of the 6 hours that Sony says on its website, its bad, really!!
Some websites talk of Intel PowerTop utility to tune some of the power usage. I actually downloaded Powertop from http://www.lesswatts.org/projects/powertop/ but not too much avail. The Fan noise and heat  still persists.
Another thing you will notice with Sony VAIO is that it comes with InsydeH2O BIOS. So if you are planning to run a virtual machine software (like Virtualbox) and want to turn on the Power AT features in the BIOS, you can't do it. I could not get to the BIOS screen no matter which key I pressed at the boot time (usually F12, Esc, Delete etc work) but no luck here. I think this is the result of Microsoft SecureBoot feature and basically it is designed to deny you from running anything else on the computer that you own but Windows. What a shame.

Soooo, in the nutshell, there are some BIOS issues, GRUB 2.0 doesnt work, SD card reader doesnt work and there is overheating in the CPU/GPU (which causes the fan to run like a crazy turbine). Other than that Fedora 16 on Sony VAIO S series is not bad. I hope in the next release of Fedora, they will be able to fix the Fan issue at least. Until then it is 7/10 for me.