What’s going on inside my computer?

We all ask this question now and then, particularly when the computer or its application software is not working as it should. Or at least when it’s doing things we don’t understand.

Our smartphones are no different – they are primarily computers, with some radio communications thrown in to connect them with the world. Of course, those radios include 3G and 4G cell phone bands, WiFi and Bluetooth.

JLC desk v1Let’s focus for a moment on what every computer has to deal with inside its “kernel” – the core of the operating system. No matter what else is happening at the application level, here are some of the events and processes going on underneath the apps.

1. Memory management – keeping track of who is using which parts of RAM and ROM (often Flash memory). Not only is there constant competition among the applications for RAM space, the operating system itself has to allocate space for its own processes. Furthermore, applications often are using more RAM space than is actually available in hardware. How is this possible? By using “virtual memory” which means that some of the “space” is actually on disk or in Flash or Solid-State Disk (SSD) memory. Only the active “pages” of an application are actually in RAM, while others are “paged out” to disk.

2. Disk Input/Output (I/O) – whether it has a real spinning disk or an SSD, an operating system has to manage the traffic in and out. Since it takes a lot longer to move data to and from disk that it does to compute anything, scheduling has to happen for multiple such transfers at the same time. This means building queues of pending I/O operations, dealing with retries if there are errors, and cleaning up the queues when they are finished.

3. File System – on top of the disk I/O, an operating system usually provides a file system. This creates named collections of data, allocates space for them on disk, and keeps track of all the pieces of a file. Sometimes it also manages redundant file information (such as RAID or block replication) to guard against data loss.

4. Network protocols – there is a separate protocol for each network, such as GSM phone, CDMA phone, WiFi (to Internet), and Bluetooth. Each protocol has multiple layers of interactions going on. The system has to manage each layer by generating and responding to messages coming and going on the network.

5. Error recovery – not all operations in the computer are successful. Here are some of the ways they can fail.

a. When a transmission over a radio link or a disk I/O operation is initiated, there is always a timer set up that counts down and fires off an interrupt when it gets to zero. The interrupt means that the operation has failed, because it didn’t complete within the allotted time.

b. There are other ways to fail, too. Sometimes, a radio transmission will be garbled. This gets detected when a checksum or other code check finds a mismatch in the message. Then the recovery involves sending a reply message that says, “I didn’t get that last message.” And there are multiple layers of network protocol at which such messaging is being done.

c. The hardware of the computer itself fails. A bit gets dropped in the memory, or a bus from one part of the computer to another part loses a pulse and sends the wrong data. This gets detected when the data is checked and found to be an impossible value (a value that is not normal). In this case, the whole operation has be repeated, or else the program that was running and using this data has to be terminated.

6. Power management – in addition to turning the system on and off, mobile systems, such as smartphones, are actively managing power to various subsystems so as to minimize the load on the battery. Most systems also manage screen brightness (more in bright light, less in dim light) and disk spinning (turn off when not in use).

7. User interactions – A user may be typing on a keyboard, moving a finger around on a touch screen, pressing buttons, and reading what is displayed on a screen. There can also be other attachments, such as fingerprint readers or credit card readers, providing data to the system. There is also sound output and voice input. Determining what the user is asking the system to do may require sophisticated software, including motion detection on the touch screen and parsing the voice input.

To support application software, the system may include “frameworks,” such as a Java language framework, which is a collection of facilities that enable programs in Java to be run using a Java Virtual Machine. And there may be other facilities provided by the system, such as an indexing and search capability for emails, calendar items, address book items, web pages, and files. These require sophisticated data structures to be built and added to whenever a new item arrives in the system.

These are a sampling – but not all – of the activities and facilities in your system. There may be hundreds of thousands of lines of code involved in them. And someone – a team of someones – is maintaining that code as it evolves from generation to generation.

Is it any wonder that software project management – and particularly software lifecycle management – is a critical part of a successful vendor’s technology?

What’s different about mobile apps?

The adoption of smart phones across a wide cross-section of the world has opened up a new arena for business application software: mobility.  This article outlines what’s different about mobile “apps” – and what remains the same as desktop PC software.

Small screen

In the world of media (such as movies), the big screen is in a movie theater, the small screen is a television set, the smaller screen is on a PC, now the tiny screen is on your mobile phone.  While you may be able to watch a movie on a mobile phone, you can’t expect to interact with business software the same way on this tiny screen as you do on a PC.

On the other hand, you’re not always sitting in front of your PC.  But your mobile phone is nearly always at hand, so this makes it attractive as an “always on” device that you can use for interacting with your business.

Since the introduction of the Apple iPhone, the underlying operating system software of the smartphone has had nearly all of the capabilities of a PC operating system, with one exception:  only one app can run at a time (up to now).

Aren’t mobile apps and PC applications the same?

Some characteristics of apps are the same as for PC.  For example, apps must be developed to match the specific operating system found in the smartphone.  This means that a iPhone app has to be deliberately designed for the Apple IOS system, an app for a Samsung phone has to be designed for the Android system, and so on for Nokia and Blackberry apps.

The people who develop apps have to use a development environment (a bunch of software tools) specific to the target OS, or else use an environment that is “cross-platform,”  so that their resulting app is adapted to the target OS.  There are many of these cross-platform tools.  If you’re interested in them, see http://en.wikipedia.org/wiki/Mobile_application_development .

Other restrictions

Each target operating system may have other restrictions, such as the requirement that all apps for the iPhone be reviewed and approved by Apple.  This makes the job of the developer harder if he is trying to make an app that runs on any phone.

A mobile app is software that runs on the phone and uses the underlying operating system to perform certain functions, such as interacting with the user and communicating with a website or the telephone system.  Some of the functions available in a smartphone are unique to the mobile environment, such as being able to find out where the phone is right now from the GPS.

Browser-based interactions

Just as with a PC-based user, one way to implement business functions is to use a browser to access a server offering the functions.  In fact, a server can implement both PC and mobile versions of its user interface in order to offer the same – or nearly the same – features to both PC-based and smartphone-based users.

One of the current developments in browsers is the HTML5 language, which allows a single software package to offer adaptable results that can make mobile/PC apps easier to move around to different phones and/or PCs.

Of course the designer of the user interaction has to be aware of the size of the screen.

What about security?

Whether an app is PC based or smartphone based, security is still an issue.  And moving the functions into a browser-based app in a server does not take care of all the security issues, either.  We’ll take up the question of security in a future blog entry.

 

For more information about app development, here’s a link to one of the commercial companies that do mobile application development.