The Virtual Memory Concept

Virtual Memory is a cost effective solution to slake the thirst of memory hungry applications for a seamless experience with your operating system. To understand the concept of virtual memory you need a little knowledge about the memory organization and working. There are basically two types of memory you need to know. Random Access Memory (RAM) is faster but costly. Memory like hard disk is slower but relatively cheaper. Virtual memory is a stratagem to utilize the hard drive memory to achieve enhanced performance from the random access memory.

Whenever you run multiple programs/applications in your desktop, you will be working on only a portion of a particular application at an instant. Therefore it is a waste of resource to load the entire memory required for a particular application into the limited size random access main memory. In a virtual memory environment each page of a process is brought to main memory only when it is needed on demand.

Virtual Memory Block Diagram Working

Data is stored in any memory in the form of binary digits. The operating system handles memory management in the form of chunks of memory called pages. A page is nothing but a contiguous block of memory. One process might require multiple pages of memory but only a few pages might be active at a time. Virtual memory uses a technique called demand paging to effectively use the available RAM memory. Every page has an address which may be a virtual or logical address. The main memory is divided into equal size chunks called page frames and each page frame has a unique physical address. So whenever a page needs to be accessed, the operating system has to translate the virtual address into a physical address and this is done by a Memory Management Unit (MMU) with the help of mapping in a page table. The virtual address corresponding to a page is mapped to a physical address corresponding to a page frame in main memory. Whenever a page is not in memory the operating system fetches the page from hard disk in response to a page fault exception. The operating system usually makes a prediction based on past history using intelligent algorithms regarding those pages that are least likely to be needed again and places them in the hard disk.

A-GPS for the Novice

Assisted GPS is an improved version of conventional GPS and it has revolutionized mobile navigation systems across the globe. The A-GPS system relies upon an assistance server to accurately resolve the location of a device. A-GPS system is commonly used in mobile phones to provide real time navigation services. The Global Positioning System works on the principle of trilateration to determine the coordinates of a point on earth. In this principle a satellite is considered to be at the center of a sphere and the mathematical treatment of three such spheres/satellites gives the intersections of the spheres which are used to determine the coordinates. By including one more sphere/satellite in the analysis the point can be located more precisely. The distance between the point on earth and the satellite is computed by transmitting a packet of data tagged with the sent time and by subtracting this from the time the packet was received, we get the time of transit. Assuming the packet traveled at the speed of light, we can estimate the distance of the satellite which serves as the radius of the sphere.
Assisted GPS Working Block Diagram
The standalone GPS system is susceptible to atmospheric conditions and multipath errors which tend to prolong the time to first fix. This is not appropriate for real time navigation and emergency applications. A-GPS offers a solution to this problem with an architecture that makes use of data connectivity to an Assistance server located at a place with strong signal connectivity with the satellites. There are two possibilities here.

  • The assistance server may transmit orbital parameters and atomic time information to the mobile phone via the network. The GPS receiver in the mobile phone correlates this data with the fragmentary data received directly from the satellites thereby increasing its sensitivity and resulting in a quicker time to first fix.
  • The mobile phone with limited processing capabilities can delegate the processing function to the more sophisticated assistance server by sending the weak fragmentary data to the processing server that has good satellite signal and receive the position information from the server through the network.

A-GPS is a feasible option to provide navigational services in an urban environment with tall buildings and high radio interference. On the flipside the service provider will charge the subscriber for network data traffic using GPRS/3G.

Linux Server Time Zone $TZ Problem - Yesterday Date Script

I encountered a peculiar problem in a shell script that was used to find the yesterday's and tomorrow's date using the environmental variable TZ. The script that was previously written to find yesterday's date on a server that was located in EDT time zone was

YesterdayDate=`TZ="EDT+24" date`

But unfortunately the code failed to give the correct date of yesterday and instead it gave today's date. I thought of digging deep into this issue and logged in to a linux server to investigate the matter. After some long manipulations I observed something.

Unix server time zone $TZ

BST is 1 hour ahead of UTC $ YesterdayDate=`TZ="BST+23" date`

The script "EDT+24" gave only GMT/UTC time and inorder to get the correct timezone I needed to add the offset value for the particular time zone. After I made the changes the script seems to be working fine.

EDT is 4 hours behind of UTC $ YesterdayDate=`TZ="EDT+28" date`

CDT is 5 hours behind of UTC $ YesterdayDate=`TZ="CDT+29" date`

MDT is 6 hours behind of UTC $ YesterdayDate=`TZ="MDT+30" date`

PDT is 7 hours behind of UTC $ YesterdayDate=`TZ="PDT+31" date`

I'm still a bit confused as to why the $TZ is behaving so unexpectedly.

Note: I'm just a novice and not an expert in Unix or Shell Scripting. I just wanted to share my experience with timezones on linux servers.

Nokia 5130 Express Music - Mobile Review

Nokia 5130 Xpress Music Colors

Last week I wanted to buy a mobile phone for my father and I was hunting for an economical music phone with camera and GPRS. Since I was buying it for my dad, I preferred Nokia because of the user friendly interface their phones have. When I inquired my friends, almost everyone suggested the Nokia 5130 Xpress music phone. I was convinced with the looks of the phone and bought it.


The Price of the phone is the crowd puller. With a 2.0 Megapixel Camera, 1GB microSD card storage, Bluetooth, GPRS and a sleek design, Nokia 5130 is a smart buy option.

I would give 9 out of 10 for the design and form factor. Everything is neatly packed, smoothly finished and custom fabricated with the buttons ideally located for a perfect music phone. The backlighting effect is appreciated.

I'm a person who prefers phones with a bigger display. Nokia 5130 display area is not the largest ever but definitely satisfying for a budget phone with compact design.

The music quality and stereo effects are good to hear in the headphone. The keypad is robust and comfortable to type.

Initially when the phone was introduced people complained about hanging problems and phone getting automatically restarted issues. Its been a week since I bought the phone and there are no issues till now.


The battery was a bit of a let down by Nokia. When I opened the back panel and found that the battery is the same old BL-5C that created a hullabaloo not long ago was psychologically disappointing.

The microUSB data cable that came along with the phone was incredibly short and there is absolutely no way I can place my phone on the table once I plugged it in the PC's USB slot.

Bluetooth is the only plausible data transfer option. The microUSB cable is short and there is no software CD in the package.

Inability to connect to Wi-Fi networks, lack of office tools, cheesy loud speakers at high volume, etc are desirable features missing on the phone.

What is a VPN?

Virtual private network is a cost effective solution for companies to extend network connectivity to its employees in every corner of the globe. Consider a company sends an employee to another country that is far away from the company headquarters on a secret mission. There must be some way for the employee to retort to the company and access the private network of the company in a secure way. The company cannot install a private network across countries because it would be expensive. Therefore they must find a way to communicate with the employee in a secure manner using the internet. This is were a virtual private network comes in to the picture. A VPN is a private network connection that is virtual in the sense that there is no dedicated private physical network connecting the entities. But the traffic is sent via the public internet that is vulnerable to attack in a secure manner. Private traffic is carried on the public network in a safe manner using several technologies like encryption, firewalls, authentication, IPsec, etc. VPN gives an organization the freedom to clandestinely communicate with its outbound employees in an economical fashion.