December 13, 2009

OS Woes....

If you've been scouring the market lately, searching for a new portable device (cell phones, smart phones, portable media players, netbooks), you've definitely noticed the plethora of options and choices you've got. Oh joy! It's a consumer's paradise, the economist would tell you. But, now that you have the power to choose, how do you choose, or perhaps, the more apt question is, "who" do you choose? Now, yes, we all could first narrow down our brand of choice or maybe base our choice on what bells and whistles we'd like (3G, Bluetooth, A2DP, Wi-Fi, Hi-res cameras, etc). Some of you are carrier specific (personally, I prefer the pricier unlocked edition) but irrespective of who or what you choose, you're going to find yourself facing the ultimate demon: the Operating System (OS). The problem is that most people underestimate the importance and significance of an OS, to the extent that most people mistake the OS to be nothing more than a graphical interface! No! No, the OS is not about aesthetics! You can stop holding your breath. Steven Spielberg is NOT releasing his own OS (yes, there were actually rumors running around!). What's the deal with all these Operating Systems running around there anyway? Well, let’s have a little look under the hood of your device. Yes, there is a lot of silicon, there are funny green chips with silver dots all over them, and there is the occasional black object on the surface that seems to look a lot like that mole on your great-aunt's hand. Yes, the internal circuitry is a delight for some of us, but for the rest of us? It's all too daunting! But switch on the device and we see the familiar logo, a welcome chime or perhaps a personalized welcome message. Now how on earth did that come to be?! The devil's work your great-aunt would tell you. But ask any geek and he'd give you a technically sound explanation in some language that you surely wouldn't understand. So let me break it down.

Let us assume that your device/computer is an office. Now everybody in the office has their own job to do. Accountant handles the accounts, the typist does the typing, someone handles sales, and somebody answers the calls. The modern corporate office is complex environment, serving several purposes all at the same time. But obviously someone smart needs to manage all of this. Who is this manager? The operating system. Your device is nothing but a collection of smaller and less complex devices or “modules”. Each of these modules has their own function. For example, take the modern cell phone. You obviously have a module to handle the communication (incoming and outgoing calls, SMS, MMS etc), another module serves as an interface to the user (buttons, LCD screens), another module handles the camera, while another handles the music player. These modules comprise of both the core hardware (that weird green chip with silver dots and black moles...) as well as the software required for these modules to run. The job of the operating system is to make sure that all these modules can “talk” to each other and work in tandem. The most important job, however, of an operating system is to ensure that the user (you) is able to “talk” to the device. Now, when I say “talk”, I basically mean communicate, but in a less technical sense. So whenever an “event” happens, your operating system kicks into action, coordinating the resources in your devices to get the job done. What is an “event”? It could be you making a phone call or, perhaps, you turning on the music player, or you starting to play a game! Let’s take an example. You’re taking a photo with the built in camera and you suddenly receive a phone call. What is happening in your device?
  • Initially, your OS has been told to turn on your camera, so it activates the required drivers and instructs the controller to turn on the camera.
  • Then the OS waits for your command to instruct the camera to capture an image.
  • Upon receiving your signal the OS instructs the camera to capture the image. This image needs to be stored and at this instant, so it's dumped in the temporary memory (storage area of an electronic device).
  • Now the OS directs the memory to send the image to the specified location on your permanent storage device (a memory card perhaps).
  • Suddenly, someone calls you. The communication module, tells your OS, that there is an incoming phone call.
  • The OS first pauses all other processes (your camera is put on hold).
  • It then notifies you of the incoming call.
  • Assuming you answer it, the OS activates the microphone and speakers and redirects their data to the communication module.
  • Voila! You’re in a call.
  • Once the call is done, the OS resumes all the processes that were paused.
So, that’s what is happening in your cell phone. For all other devices, the processing is identical with a few modifications. A quick search on Wikipedia would tell you “An operating system (OS) is an interface between hardware and user which is responsible for the management and coordination of activities and the sharing of the resources of a computer that acts as a host for computing applications run on the machine. As a host, one of the purposes of an operating system is to handle the details of the operation of the hardware.” Your OS determines a few things:
  • Performance
  • Expandability
  • Usability.
Let me discuss that a bit more. How your OS decides to handle inputs, how it handles the memory, events, the decision making time and the amount of resources (processing power, memory) that the OS itself requires, will determine how you device performs. I.e. how much time it will take to start an application, how much time it takes to switch between applications, how it slows down while multi-tasking etc. Basically, a better OS has lesser chances of causing your phone to freeze or crash unexpectedly. But keep in mind that the performance goes hand in hand with the phone hardware as well! The OS is only as capable as the hardware on which it runs! Also, most mobile OSes allow you to install new applications on them. The number of applications available and the type of applications available vary from OS to OS; however the functionality of the application is also dependent on the OS. Finally, the OS’s main job is to act as an interface between the user and the device. The better the interface, the easier it is for the user to use the device. While the OS does have its own native graphical interface, almost all manufacturers customize it to their own interface. For example, both the HTC Touch and the Sony Ericsson Xperia, run on Windows Mobile 6.1. However, they have drastically different user interfaces. What’s the point? Well there is a war out there, a war to determine who will emerge as the number one OS. Who decides the winner? You do! For now, you should have some clue as to what’s happening under the hood of you phone, and hopefully you’ll think a little more about the OS next time you buy a device. I’ll be back soon with an in depth analysis of the various mobile operating systems out there and how they compare to each other. Till then, feel free to leave your comments and/or any questions you may have. I'll get back to you on them as soon as possible!

4 comments:

  1. @Ashutosh

    Nice write up. Could be a little more technical though. Try looking a little more in depth into process scheduling in the OS. Different operating systems (Android, Windows Mobile, Symbian etc, Palm) have very varied process scheduling polices.

    Ex. The Palm Pre OS lets you open and run any of its apps simultaneously. From a workflow perspective, this is essential and something the Blackberry gets right as well. The iPhone? Not so much.

    The Android on the other hand has a totally different policy all together. Probably something to check out for your next post!

    ReplyDelete
  2. Also, a small correction to your post :-

    "Upon receiving your signal the OS instructs the camera to capture the image..."

    It's not really the OS instructs the camera. When you click the capture button, a device interrupt is called which executed the capture command. This Interrupt service request(ISR as they are called) aren't really a part of the OS. They are more associated with specific devices, for this instance, the click button or the camera driver.

    ReplyDelete
  3. @Aditya: Thanks!

    I didn't make the post technical on purpose. I wanted this post to serve as a primer for my forthcoming posts. There are loads of people out there who really don't know anything about mobile OS. This post was for them. Most other people also do not want to get into the technical details and are simply just interested in the implications

    "ask any geek and he'd give a technically sound explanation in some language that you surely wouldn't understand"

    I didn't want to be that geek. Hence, i kept it on the ground level.

    About the camera bit. Yes, the interrupts aren't generated by the OS, they are purely hardware oriented. But again I didn't want to baffle the common reader with technical terms. Hence the usage of "signal" and "events". Its not entirely wrong. The in modern mobile devices, there isn't a well defined BIOS-like system. It's an embedded system. In such cases, the interrupts are handle by the OS kernel itself.
    eg. Android is a linux based system, and it implements a similar interrupt handling. While the iPhone runs on the MacOS and hence we've got all the problem of the MacOS with it as well!

    Thanks for the feedback! Appreciate it! I'll try and come out with a few more technical posts next time.
    Keep reading!

    ReplyDelete
  4. I enjoyed your post! I am glad it wasn't to technical as a lot of us wouldn't understand!

    Looking forward to many more interesting and humorous posts!

    ReplyDelete

Related Posts with Thumbnails