Irfan’s Corner on the Web On Mac, Linux, Grid, Virtualization and Software Technology

17Dec/067

OpenSuse completely supports my Notebook!

Good news for Dell Inspiron Users: Your notebook is completely supported in OpenSuse 10.2

You can check out these tutorials for getting ubuntu run on Dell Inspiron and this one for Fedora. What do both have in common? Massive manual configuration encompassing kernel recompilations and what not.
However in OpenSuse 10.2, I didnt have to do any special configuration at all to get my hardware running. OpenSuse 10.1 supported everything except the MMC card reader (from Ricoh). Now this is supportedd aswell.

However one thing that is not supported is hardly openSuse's fault: The Connexant Modem. Connexant Modems are notorious for their proprietory hardware standards and focus on the Windows users! Besides I hardly use a dialup connection so this is irrelevant for me. For those reader who do use dial-up connections, I would suggest that you get those cheap external modems (hardly $30).

Ubuntu came to fame purely through marketting and hype! I believe that OpenSuse is the better Desktop/Notebook distro and without any proportional marketting/advocacy large parts of the human population will be deprieved of the 'better' Linux. I personally will soon get a pack of DVD's and spread it amongst my friends.

snapshot1.jpg

10Dec/0611

SuSe takes over my Desktop!

Since yesterday I've been evaluating SuSe, and I'm pretty impressed by the distro. It's not the first time I've used SuSe, I used it before Novell acquired it. It was one of the best one at that time, but not ready for the Desktop. After the Novell acquisition I think SuSe has improved greatly! It's an awesome distribution now. However the desktop installation did not go as smoothly as that installation on my laptop. I had to manually configure my soundcard, with alsaconf, that's it.

Now, I don't believe that noobs should use SuSe/Fedora etc. straight when they dive into Linux, yes these distributions make a life a lot simpler with Linux, but I believe that you dont learn much about GNU/Linux, the platform, while you are using these distros. For example, since I have installed SuSe I haven't as of yet needed to compile anything from the sources, and just used YaST. So if some software is not available there some noobs who could think that, that software is just not available on Linux, they will not learn about how to find software from sourceforge and compile it, handle dependencies, or if something is wrong with the graphics settings, how to change to xorg.conf file and make the appropriate changes, or if there some problems with iptables, how to delete/add rules manually. One experience I had with a noob, who was a fedora user, was when he had problems with his networking, and he was testing settings in the GUI tool which ships with Fedora/redhat. I investigated using the ifconfig and route tool, and found out there were problems with the gateway routing rules, within the next few seconds I fixed them. In Slackware there is no GUI tool for networking configurations, and you mostly use either the netconfig script or the ifconfig/route commands to get your network working. Using raw distros like Slackware/Gentoo hence has enormous advantages, and I believe every Linux user should use it atleast once to learn the platform.

9Dec/0613

Novel SuSe Linux: Most Laptop Friendly Distro!

I have years of experience in Linux, and have used countless distributions in the past. Slackware has been my all time favorite. Over the years I have finetuned it for my PCs that they exhibit performance which I could never dream of in Windows. The thing I really love about Slackware is that because it is raw, the amount you learn about GNU/Linux is enormous. So In desktops at least in my place Slackware rules. However I would not say that Slackware is for the Desktop, it is a raw distro, which requires a lot of expertise and time to fine-tune and get everything working. I initially used to pitch it to newbies, but they always ended up being disgusted with linux due to the amount configuration they had to do.

Recently I got myself a Dell Inspiron 6400 Notebook, and installing Slackware on it, was pleasant at first, but than soon I realized many things where not working, after extensive configuration messing with the xorg.conf, countless kernel recompilations and others I got everything to work and enjoyed Slackware on my Laptop.

Today, I thought for a change I'll try out OpenSuSe 10.1 from Novell out. And it has been a blast! From the first glimpses of the installer I said to myself "hmm.. 32 bit!" (slackware has DOS-like installer, I know its not the only one with a 32bit installer, I've used Redhat's anaconda, its good, but the SuSe one is impressive). Soon I was in for surprises, everything went well during the installation: At first my external mouse and the touchpad automagically worked! Even the scroll wheel did :) . Then as the installation proceeded, my sound card got detected (with which I had problems in Slackware, although I had compileed SND_HD_INTEL into the kernel, it still wouldnt work) , the graphics card (glxgears shows close to 900, thats 800 more than Slackware default :) ), along with the appropriate resolution (1280x800). Bluetooth, WiFi, firewire, everything was picked up by the installer automatically. This is how I expect a Linux installaton to be! SuSe really sets the standard here.

In Slackware, we have the very raw pkgtools package management system, which is simple and easy. But sometimes one runs into version conflicts, just as in Federo with "RPM-Hell". SuSe has perhaps one of the best package management system built into YaST. It handles dependencies transparently, and downloads and installs them without any special intervention.

So OpenSuSe is here to stay in my laptop! I know there are some political arguements against Novell for having struck a deal with Microsoft, and some are going as far as proposing a boycott of all Novell code. But the fact is Novell has made SuSe an extremely user-friendly distribution which really rocks on laptops! I'm sure it has the same performance on Desktops. So with OpenSuse and some other distros like Ubuntu etc. Linux is finally ready to enter mainstream desktop computing.

12Nov/060

Diving into Python

Recently due to a project(I am part of a group building a next generation operating system, which would allow seamless resource sharing on a global scale) complication I decided to ditch a particular component and implement it in another alternative language. I explored various possibilities. The component is a SOAP web service based thing. It was previously implemented in C, using the Axis2/C framework. The initial impetus to use the Axis2/C framework was to make a web service based component which was as fast as possible. But the problem is that Axis2/C is not mature, it hasn't even crossed the 1.0 milestone! The component was riddled with segmentation faults. It only worked in Slackware 10.2! When we upgraded to Slackware 11.0 in our lab, the component stopped working! I spent some 8 hours trying to debug it but to no avail! I finally decided to ditch the component and implement it another language which was more productive than C and didnt have manual memory management. I had numerous alternatives, Java, which I found to be too resource demanding; PERL, the problem with perl was that I am the only one in the team who knows PERL, and I would have to implement everything myself, I finally settled on a combination of Php and Python. I read somewhere that Python had bad performance as compared to php in hosted applications. So I decided that the server side portion of the component is to be php based and the client side portion is python based, and we have ample expertise in the group in both php and python.

With this effort I hope to dive into python and contrast it to Perl, I will write a subjective comparison of the two languages soon.

15Oct/0631

Happy birthday KDE!

10yearskde1.jpg

KDE just got 10 years old! The K Desktop Environment, is "one of" the best (the "one of" was put in order to stop a flame war in my blog) desktop environments for Linux. KDE has been crucial in introducing Linux to the Desktop, true a GNOME based distribution, Ubuntu has the taken the reign now (I believe this was due to marketing and hype), but KDE based distributions, Fedora, Kubuntu etc are not too far behind. Its been now 5 years that I've been using Linux, my first distribution was Redhat 7.2, which was running GNOME; KDE, due to Redhat's modifications had a similar look and feel in Redhat. So I couldn't get excited about Linux at all, it was a very boring interface for me. But in a random surfing session I came across screen shots of Slackware, which of course ships with unmodified sources, and the screen shots really appealed to me, I downloaded Slackware, and from that moment I've never looked to any other distribution, and use Slackware with KDE exclusively. So what is it that I really like KDE?

1. KDE look and feel

I really like KDE themes Plastik and Keramik. There are numerous innovations in KDE, for example the KMenu applets, which provides fast access to numerous highly useful features, like weather reports, dictionary, direct access to storage media (one click mount), information about my local wireless network etc..

Apart form the KMenu there is another toolbar which I really use a lot, the KasBar, its a toolbar which shows thumbnail views of opened windows, it helps my productivity especially during programming when I have multiple windows open, the IDE, the debugger, Mysql administrator, Mysql query browser, etc. Having thumbnail views allows me to navigate to the required window a lot faster.

KDE Icons look very very clean and well designed. KDE's file browser, Konqueror, in my opinion is the best one around. I've used GNOME's nautilus, and I cant figure out, why they have not included a "open terminal here" options in the popup menu, in any Linux system you have to turn to the command line frequently, because there are some tasks which are more suitably done in the commandline than in a GUI file browser.

2. KDE has tons of freebies!

KDE ships with tons of applications, many for similar purposes, all in all the bundled application mostly fill nearly all my needs, and very few extra software have to be installed, such as OpenOffice, GIMP, Firefox etc.

KDE's own webbrowser, although for a very long time couldn't even open Gmail, has come a long way, and often I prefer Konqueror over Firefox, because it is lightweight. But Konqueror has still some way to go to challenge Firefox on KDE desktops, because it doesn't support some AJAX functionality for example, in Konqueror I can't see the GMail integrated Gtalk client.

There are tons of KDE application which are not shipped along with KDE, but you can get them from here.

3. KDE application development is easy!

KDE is based on Qt/C++, which is one of the best GUI development toolkits for Linux and others. Its innovative 'signal and slots' based event abstraction makes development of GUI application very easy. KDE Desktop Communication Protocol (DCOP), allows KDE application to talk to each other. I really wished that there would be something similar in Windows (maybe COM, but majority of windows application are NOT COM enabled), because allowing application to application communication allows a developer to reuse the functionality of existing software. Then there is KParts, which is analogous to COM, which allows the developer to encapsulate a component which does some specific thing, and then reuse that component in other applications.

KDE comes bundled with some of the finest development tools around. KDevelop, is a very feature rich development environment, which allows you to do development of every type of application from simple BASH shell scripts to complex Kernel modules.

Quanta is an excellent web development environment, its hard to ignore when I'm doing php programming. I use it to complement Zend, a commercial php IDE I use, which lacks in website design capabilities.

If you want to learn Qt, you can consult this book its the best book I've come across, and covers a wide range of topics which help you to get productive with Qt quickly.

So these are my top 3 reasons why I prefer KDE, I'm very excited about KDE 4, and can't await its release, the screen-shots I've seen have been marvelous.

I would like to know from my readers what they like or dislike about KDE?

1Oct/060

Adding a System call (linux 2.4.x)

1. About This Document

This document explains a way to add a system call to linux kernel catered to the linux 2.4.x series. It is based on the guide by Worcester Polytechnic Institute available at here. The guide is for linux 2.2.x, some changes where to the cotents to make it a guide for linux 2.4.x. The reference kernel in this guide is linux 2.4.31

A system call is the standard way an OS service is exported to a user program. For example, to provide users a new semaphore like synchronization method, some system calls need to be provided to access it. Likewise, a system call may be used to give users access to internal information of a file system such as superblock or inodes. The following description is based on linux kernel version 2.2.14 on i386 machine architecture. Also, it is assumed that readers are familiar with Building Linux Kernel.

2. Preparing for A New System Call

A system call cannot be called directly from a user process. Instead, they are called indirectly via an interrupt and looked up in an interrupt table. Thus, when you define a new system call you insert a new entry in this table. You do this by editing the file linux/arch/i386/kernel/entry.S. Inside, you should see lines like:


.data
ENTRY(sys_call_table)
.long SYMBOL_NAME(sys_ni_syscall) /* 0 - old "setup()" system call*/
.long SYMBOL_NAME(sys_exit)
.long SYMBOL_NAME(sys_fork)
.long SYMBOL_NAME(sys_read)
.long SYMBOL_NAME(sys_write)
..
..
.long SYMBOL_NAME(sys_ni_syscall) /* sys_set_tid_address* /

After the "sys_ni_syscall" line, add your entries for your new system calls, with the words "sys_" prepended. For example, you might add the following line for your new system call "myservice":


.long SYMBOL_NAME(sys_myservice) /*259 */

You also need to generate a system call "stub" so that an ordinary user program can invoke your system call. You do this by editing the file linux/include/asm/unistd.h (In linux sources) where you will find lines like:


#define __NR_exit 1
#define __NR_fork 2
...
#define __NR_exit_group 252

You should add #defines for your new system calls at the end, with the prefix "__NR_" in front of it. For example, you might add the line:


#define __NR_myservice 259

3. Places for Your System Call Source Files

After inserting your new system call entry in the interrupt table and preparing a stub for it, you will need to define (or implement) the system call. It will be easiest to have the system call definitions in your own source code files, say myservice.h and myservice.c.

In general, header files for machine architecture independent system calls and functions are kept under linux/include/linux/ and machine architecture dependent ones are kept in linux/include/asm/. Therefore, it would be a good idea to follow this convention. For example, the header file for the system calls for your new synchronization method, of which the implementation is machine architecture specific, would be placed in linux/include/asm/, while the header file for your machine architecture independent system call that access the superblock of one or more of your file systems would be placed under linux/include/linux.

The place for actual implementation file (myservice.c in this example) could vary. For example, if you are implementing a new process synchronization method, linux/ipc/ would be the best place for it. If you are implementing a file system related one, linux/fs/ would be the best place.

Remember that you will need to modify the Makefile in the directory you placed your .c file so that your code gets compiled and linked in properly. Modify the Makefile line to have a .o of your source code. For example, adding myservice.o in linux-2.4.31/mm/


obj-y := memory.o mmap.o filemap.o mprotect.o mlock.o mremap.o vmalloc.o slab.o bootmem.o swap.o vmscan.o page_io.o page_alloc.o swap_state.o swapfile.o numa.o oom_kill.o shmem.o myservice.o

The rest of the Makefiles can remain untouched (Makefile changes will be similar if you choose to add your code elsewhere).

4. System Call Source File Basics

In order to be linked properly, your system calls need the word "asmlinkage" prepended to their function header and "sys_" prepended to the name. For example, you would have:


asmlinkage int sys_myservice(int arg1, char* arg2) {
/* implementation of myservice */
}

Also, you will have to have #include so the compiler will recognize the word "asmlinkage".

Lastly, the user "stub" can be automatically generated so that a user program can use your system call. There are some macros defined for this in . The format is "_syscallN(return type, function name, arg1 type, arg1 name ...)" where "N" is the number of parameters. For example, you might have the line:


_syscall2(int, myservice, int, arg1, char*, arg2);

to generate the stub (in this case, the 2 is for 2 arguments). Note, that your call to generate the stub (as above) should be put it in your header file for users(myservice-user.h). Also, you need to #include in myservice-user.h to make this work. A user program could then just call myservice() as they do other system calls.

Here is an example myservice.h, myservice.c, myservice-user.h and user-app.c assuming myservice.h is under linux/include/linux/ and myservice-user.h is under /usr/include/sys/

myservice.h (used within kernel only)

#ifndef __LINUX_MYSERVICE_H
#define __LINUX_MYSERVICE_H#include

#endif

myservice.c (system call implementation)

include
asmlinkage int sys_myservice (int arg1, char* arg2) {printk("My Service Called");
return(1);
}
myservice-user.h (for user application)

#include
#include_syscall2(int, myservice, int, arg1, char*, arg2);
user-app.c (user application)

#include
main() {myservice(1, "hi");
10Sep/065

Myths about Linux

This is my first article, and I was forced to write in response to a post in a local newspaper's (Dawn.com) Computer section, in 2004
The editor of the paper's Computer section had decieved a potential linux user, by replying negatively to his queries, saying such things such as :"Linux doenst have MSN support", "Linux doesnt support much hardware", "Linux has virtually no Software".

I was shocked, and wrote this article to address some of the most common misperceptions about linux in Pakistan and around the world in general.
////////////////////////////////////////////////////////////////////////////////////////
This article is about tackling the most common myths regarding Linux desktop distributions head on. These myths not only spread misinformation about Linux in general but also discourage potential users.

Introduction: Linux is just 'another' operating system, what's all the fuss about it?

Precisely Linux is not an operating system; rather it is the kernel of an operating system. A kernel is software that enables communications between computer applications and hardware, providing system services like file management, virtual memory, device I/O, scheduling and more. A complete operating system can be built using the Linux kernel, such an operating system is termed as a Linux distribution (popularly called 'distro'). Many flavors of Linux distributions have been built, ranging from high end super computer operating systems, to PC desktop operating systems. Although the uptake of Linux in enterprise and scientific circles has been promising, Linux suffers from certain myths spread by people who have never used it nor have any significant experience of Linux whatsoever. This article is intended to dispel the most popular myths about Linux desktop distributions. As a convention from now Linux will not refer to the kernel but to a general Linux desktop (PC) distribution such as Mandrake Linux, Red Hat Linux, Slackware etc.

Why use Linux anyway?

IBM studies on TCO (Total Cost of Ownership) show that Linux-based solutions are approximately twice less costly than Microsoft Windows-based solutions in a broad range of situations. Other studies from IBM show a Linux-based system's down-time(the time while a system is down) is approximately ten times lower than a Microsoft Windows-based system.
These studies are very interesting because Microsoft Windows and Linux run on the same hardware, allowing a very significant comparison of the operating systems.

Linux is often seen as a secure operating system as it does not suffer from the frequent Trojan, worm and virus attacks on the web, which can target Microsoft Windows Systems only. As a matter of fact last year Microsoft released a number security patches for there many of there Windows operating system, of which quite a few were critical updates, and many came after a major attack had been perpetuated.

Linux security is not perfect, but the new versions of Linux are immensely secure partly due to the United States National Security Agency’s project called SELinux (Security Enhanced Linux) which aims at creating a secure operating system for the United States Army and it’s sister branches currently SELinux version 2 is available. But according to philosophy a change in Linux kernel has to be returned to the community of the benefit of all. SELinux Security code has been in-cooperated into standard Linux kernel and distributions, and can be used to secure your home computer system.

Generally 8 points sum the 'Linux Advantage' up:

* Linux source code is freely distributed. Tens of thousands of programmers and various organizations have reviewed the source code to improve performance, eliminate bugs, and strengthen security. No other operating system has ever undergone this level of review.

* Linux has the best technical support available. Linux is supported by commercial distributors, consultants, and by a very active community of users and developers. In 1997, the Linux community was awarded InfoWorld's Product of the Year Award for Best Technical Support over all commercial software vendors.

* Linux has no vendor lock-in. The availability of source code means that every user and support provider is empowered to get to the root of technical problems quickly and effectively. This contrasts sharply with proprietary operating systems, where even top-tier support providers must rely on the OS vendor for technical information and bug fixes.

* Linux runs on a wide range of hardware. Most Linux systems are based on standard PC hardware, and Linux supports a very wide range of PC devices. However, it also supports a wide range of other computer types, including Alpha, Power PC, 680x0, SPARC, and Strong Arm processors, and system sizes ranging from PDAs (such as the PalmPilot) to supercomputers constructed from clusters of systems (Beowulf clusters).

* Linux is exceptionally stable. Properly configured, Linux systems will generally run until the hardware fails or the system is shut down. Continuous up-times of hundreds of days (up to a year or more) are not uncommon. Leading Internet Search Engine Google.com uses Linux to power its systems.

* Linux has the tools and applications you need. Programs ranging from the market-dominating Apache web server to the powerful GIMP graphics editor are included in most Linux distributions. Free and commercial applications included in most distributions are available to meet most application needs.

* Linux has a low total cost of ownership. Although the Linux learning curve is significant, the stability, design, and breadth of tools available for Linux result in very low ongoing operating costs.

* The Linux Philosophy: ``all for one and one for all´´ All changes one makes in Open Source software will benefit each and everyone, all over the world. Without exceptions or constraints.


Myth 1: Linux is too hard to use for the novice user or Linux is difficult to install!

To be honest any operating system being installed for the first time always seems difficult, we think Microsoft Windows is easy to install, because we all have done it so many times. Popular distributions such as Mandrake, SuSE, Red Hat, Lycoris DesktopLX or Elx offer complete graphical installations, with plenty of help at each screen and form, it is worth noting that even popular operating systems such Microsoft Windows XP and Apple MacOSX do not have a complete graphical installations. Some distributions such as Gentoo, SuSe and Slackware have complete near automated installers where all the user needs to do is keep pressing the enter button, because the installer sets default values it self.
As of ease of use is concerned Linux began as a programmer's operating system, written by and for those that like to get their hands dirty, so to speak, with the bits and bytes that make things happen on computers. Perhaps because of this beginning, ease of use has only recently become a consideration. Recently thanks to the GUI environments of Gnome and KDE which have been developed by thousands of volunteers across the world, Linux users enjoy the benefit of one of the best graphical interfaces. KDE is the most popular Linux GUI; it has numerous features which surpass even that of popular operating systems, while preserving the evolutionary stability Linux is loved for.

Myth 2: Linux has no technical support!

I am astonished to hear such notions; I believe that Linux has one of the most open help systems used by any operating system. Linux support comes in form of 200 MB documentation which comes with nearly all popular distributions such as Knoppix, and Slackware. A plethora of Usenet groups, IRC channels, and online help sites are available.
LinuxQuestions.org is one such site and claims the membership of one hundred thousand unique members, at an average a query, what ever the sophistication, is answered within 2 hours. See the end of the article for some help sites.

Myth 3: Linux has limited hardware support!

Modern distributions such as Knoppix and Redhat ( and its latest version called Fedora), and Mandrake have state of the art hardware detections, although support for Generic hardware, (hardware that is not attributed to any specific manufacturer) is limited. Win-modems are another problem; win-modems are modems where the manufacturers make Microsoft Windows drivers only. But branded hardware is fully supported, and furthermore as Linux spreads, USB Robotics, ATI, nVidia, Asus and other companies have started to issue Linux drivers for there respective hardware, even a Linux driver is available for Pentium 4 motherboards from Intel.
Although Most Linux systems are based on standard PC hardware, and Linux supports a very wide range of PC devices. However, it also supports a wide range of other computer types, including Alpha, Power PC, 680x0, SPARC, and Strong Arm processors, and system sizes ranging from PDAs (such as the PalmPilot) to supercomputers constructed from clusters of systems (Beowulf clusters).


Myth 4: There is not much software available for Linux

Linux enjoys multiple large online repositories of Linux specific software. As a matter of fact there is a Linux equivalent for nearly every Microsoft Windows software (except for those antivirus softwares since they are not required because for Linux the number of virus which have been created is nearly null), if not it is surely being developed, even MSN Messenger, Microsoft Office, Adobe Photoshop equivalents are available.
But most of these softwares are in the form of source codes, but this is one of the Linux advantages. Software coming in source code, or Open Source software, creates confidence of the user using the software, since he knows what the software is directly intended to do (sure you'll have to know the language in which the program is programmed, but fake programs are never found online). Advanced user may even improve the software and send if back to the community.
User-site compiled software also performs better since the compiler compiles the source using optimizations which support only your processor instruction set. Generally, Closed Source software (nearly all Microsoft Windows software), where only the executable file is available, are only optimized for Intel processors, but people using AMD Athlon or K6 processors are at a disadvantage since there processors are not being completely supported.

Myth 5: You cannot run Microsoft Windows programs or MacOSX programs on Linux

Generally there is no need to run programs from alien operating system in Linux however
Linux uses Microsoft Windows emulators such as VMware, Win4Lin and WINE which can run any Microsoft Windows software on Linux.
Vmware is capable of running any operating system in a window in Linux be it BeOS, JavaOS, MacOSX or Microsoft Windows. It is even possible to run four or more different operating systems at the same time, if your system hardware allows it. An extension of WINE, called WineX, is capable of running Microsoft DirectX based games on Linux at near Microsoft Windows speeds. OpenGL support in Linux is native. Heavy 3D animation software such as Maya is available for Linux and used by graphics professional’s world wide. The animation work for the movie Titanic was done in Redhat Linux, a popular Linux distribution with the help of Maya for Linux.
VmWare and Win4lin are commercial programs, with free trial downloads. WINE however is completely free.


Final Comments

After reading this article if some of these above mentioned myths have been dispelled in your mind, try out a Linux distribution, If you need to know more about Linux before trying it, check some of the links appended at the end of the article. If you want to try Linux but are concerned about installing another operating system to your computer, try one of the distributions that runs from a cd, without installing permanent files to your hard drive. Two of these are the Knoppix and DemoLinux.

General Software Sites

http://www.sourceforge.net

http://www.gnu.org

http://www.savannah.net

http://www.kde-apps.net

http://www.kde.org (a popular Linux GUI, found in most Distributions)
http://www.winehq.com (The Free WINE Windows Emulator)

Distributions

http://www.distrowatch.com

http://www.nsa.gov/selinux (The NSA’s SELinux, the homepage of one the most secure operating system)
http://www.slackware.com (my favorite distribution)
http://www.knoppix.com (a popular distributions which runs from a CD, no installation required, excellent for trying)
http://www.linuxISO.org (a site where CD images of most popular Linux distributions are available to download)

Help

http://www.linuxquestions.org

http://www.tldp.com (The Linux Documentation Project, visit here to get the most genuine help)
http://www.linuxpakistan.net (A local Linux site)