Follow the Australian Telecommunications scene NEWSLETTER- FREE TRIAL
The Linux distillery
Bringing the world of Linux to you, David cuts through the tech and shows you how it works and how to use it, in terms that apply to any distro. RSS
Technology news and Jobs arrow The Linux distillery arrow Developing for Linux netbooks
Developing for Linux netbooks E-mail
by David M Williams   
Monday, 07 July 2008
Now, netbooks are priced at a low level; I think that’s been said enough times already. Linux certainly was a major enabler in this because it eradicates any reason to pay licensing fees for the software driving the device. Yet, let’s be reasonable: Linux can’t take all the credit for the low price. The fact is netbooks have much lower specifications than any modern laptop.

This manifests itself in several ways. Firstly, the amount of available RAM is constrained. The Elonex ONE ships with a mere 128Mb RAM. Acer’s Aspire One carries by comparison a massive 512Mb RAM (as does ASUS’ Eee.) This doesn’t necessarily mean RAM levels are scraping the (bit) bucket; a popular and easy ‘hack’ for the ASUS Eee has always been to replace the built-in 512Mb RAM with a 2Gb chip instead.

Perhaps tellingly, the more expensive Windows XP version of the Aspire One is equipped with 1.5Gb RAM. One option canvassed on varying forums is to purchase the Windows XP version and then trash the Windows XP installation, replacing it with one’s preferred Linux distro, or perhaps BSD UNIX in some cases. This isn’t the best route given you’re not just paying for better hardware but also for Windows XP. Nevertheless, it emphasises the general consensus that netbooks aren’t typically regarded as having available memory in elephantine quantities.

Let’s get onto some actual matters of code. First, it may be helpful to work out how much RAM you have to play with so that your application can make different decisions. Say, for instance, you were writing a chess game. Your computer controlled player would want to make reasonably intelligence moves and you can achieve this by calculating the state of the chess board in advance and then placing pieces according to the routes which seem to lead to more favourable outcomes. Knowing the amount of RAM available will permit you to increase or decrease the number of moves ahead the computer player can peek.

Under Linux you can view the current state of memory on the running system by examining the plain text file /proc/meminfo. The format varies somewhat depending on the distro but if you inspect the version on your system now you will see it includes both some high-level statistics and then a longer list of individual statistics. The MemFree figure is, as you might expect, the amount of free memory at the time of checking. Check it out directly via the command grep MemFree /proc/meminfo.

To work out the available screen resolution you should inspect the output of the xdpyinfo command. Specifically, search for the line containing the string “dimensions:” like so:

[david@dmw ~]$ xdpyinfo | grep ‘dimensions:’
Dimensions: 800x480 pixels (283x170 millimetres)


xdpyinfo is a little-known utility that displays information about an X-Windows server. It examines the capabilities of the server and can give detailed information about the screens and visuals available. For our immediate purposes, being able to determine the screen size at run-time is very useful because an app can then sensibly resize itself to suit. Perhaps it may shrink the icons used on a toolbar, or make toolbars floating instead of docked or do other things to avoid the bottom of the window falling off the screen. It’s possible, depending on your needs, xdpyinfo has other valuable information for you too.

What else should you consider when coding for a netbook?

CONTINUED







 
< Next story in category   Previous story in the category >
iTWire user statistics Visitors last 30 days
694,279
Subscribers 15,210
#1 independent technology news advertise here
  •   *  
  • Search
  • AdvSeach
  • Login
  • Events
  • FreeStuff

- Advertisement -

Featured Whitepapers

Follow iTWire on Twitter

About iTWire

iTWire is all about technology news, information, jobs and community for the IT and telecommunications industry professional. Subscribe to our free ICT daily newsletter