Archive for January, 2009

WHY LINUX IS A SUPERIOR OPERATING SYSTEM

January 25, 2009

The issues I wish to discuss in this article are mostly technical, but the technical infrastructure is what operating systems are all about. Let’s take a look under the hood.

First, a bit of history. Linux is a UNIX clone or variant, first written from scratch by Linus Torvalds in 1991, and is free to use by anyone. UNIX was written at Bell Labs over 40 years ago and was a proprietary operating system owned by AT&T, now by other companies. Originally, it ran only on mainframe computers, and only recently with the advent of powerful 32-bit microcomputers could UNIX variants be brought to the desktop. No original UNIX code is in Linux, so there is no copyright violation. All UNIX variants are very similar in their underlying structure. Most of the commands and the file system structure are the same, but these things can be implemented in many different ways.

Other open source UNIX variants are Free BSD, Net BSD, PC-BSD, OpenBSD, Solaris, but Linux has become the most popular. Mac OS X is partially based on BSD; only their GUI interface and some applications are proprietary.

The programs or applications run by Linux and other free UNIX variants are not Linux, only the kernel, the core of the system is actually Linux. The programs are mostly open source clones of original UNIX programs or completely new ones from the Free Software Foundation GNU Project, founded by Richard Stallman in 1985, and are written by thousands of programmers simply for the love of it. Open source means that you, the end user, are entitled by the license to have access to the original source code that a program is written in and may be modified by that user. Most of these programs are free. Many of these open source programs have been ported to Mac OS X and Microsoft Windows.

There are many, perhaps 300, distributions of Linux. A distribution is the Linux kernel with hundreds or even thousands of GNU programs included. The look and feel of distributions are decided by one person or a group of people. Because there are many programs that do the same thing, their inclusion into a distribution is made by personal preference in an attempt to make a distinctive whole. In this way Linux distributions can be created for anyone’s needs.  There are very small distributions, such as Puppy Linux, which works well on older, limited hardware, all the way up to enterprise servers from Red Hat. This tends to be confusing for those only familiar with Windows or Macintosh, which offer one way. Linux is having it your way. The advent of Linux has caused more development and advancement in ease of use in UNIX variant operating systems than any other.

The following are the major technical issues that make Linux a superior operating system, compared with Microsoft Windows.

All UNIX-type operating systems are multi-user systems wherein each user has a private, password-protected account that cannot compromise other user’s accounts or the underlying  system. The user can corrupt or destroy only his account. Only a knowledgeable system administrator should have access to the whole system. Users can choose to share some files with other users.

Scalability:

UNIX operating systems are extremely scalable. From embedded devices that do one thing, i.e., a cell phone or MP3 player, to multi-user systems in corporations, universities and government or enterprise servers that can simultaneously serve thousands of people over the Internet.

DOS was not scalable, but extremely limited; it couldn’t do multitasking, the running of more than one program at the same time. Windows has suffered from this legacy and was forced to create many addon kluges to make multitasking work. With Windows NT and its heirs (XP, Vista) some of these problems have been reduced.

File systems:

UNIX has long had file systems that were superior to the Microsoft DOS fat-16 and later fat-32 and NTFS file systems, even before DOS was born. Particularly, there are symbolic and hard links and permissions native to the file system. Early UNIX file systems used long file names greater than the eight character limit of DOS. Now, filenames can be 256 characters. In Linux, even the original ext2 (extended file system) did not have to be defragmented, as does even the updated NTFS in Windows Vista. Defragmenting a file system is simply not an issue in UNIX variants. Journaling, that ability to record operations on files, so that there is a database of operations in progress, allows for more stability and recovery should there be a power failure or other hard disk problem, was an early introduction in UNIX file systems. Microsoft’s NTFS was the fat-32 file system with journaling added. Windows cannot natively recognize any UNIX file system. Linux and most other UNIX variants can read and write to the vast majority of file systems.

There are many file systems to choose from:  ext2, ext3 (journaling added), the just released ext4, JFS (Journaling File System from IBM, released in the mid-1990s as open source), XFS from Silicon Graphics, ReiserFS, ZFS from Sun Microsystems (although there is an incompatible licensing problem that probably will be worked out), the soon to be released Btrfs and Tuxfs are all journaling file systems that are faster, more reliable, more secure and can handle larger partitions and files than Microsoft’s NTFS. Each has its strengths for particular uses.

All of these file systems will format a large drive in seconds. Just try that with NTFS – go take a long nap.

Linux and UNIX variants can also read, write and modify hard disk partitions of many operating systems.

The layout of the UNIX file system structure that is seen by users is far more logical and rigorously maintained than in Windows. Programs, configuration files, data files, etc. are assigned to particular directories by a standard known as POSIX. The file system(s) are unified into one tree structure. Users do not see separate hard drives or partitions.

Recognizing File Types:

Linux and UNIX variants use MIME types to  recognize file extensions for programs and users, but extensions are not recognized by the operating system. The file data type is read from the file header. Extensions are not needed, except as a convenience for the user. Windows requires extensions to recognize executable programs and data types as a legacy holdover from DOS.

Command Line:

Yes, the dreaded command line. It’s pretty well hidden in Windows now, but it’s still there, although you can’t do much with it. In UNIX variants it’s an incredibly powerful way to operate your computer. There are potentially thousands of commands. The problem with the command line is that the user needs to memorize commands; it’s not intuitive like GUIs, but there are “man pages” (manual) that offer help using the command “man programname”. The UNIX command interpreters also support fairly complex scripting commands and running script files, which make the old DOS .bat files look like primitive children’s toys. Most of the system configuration is done from script files on bootup. Almost anything can be programmed with scripts.

Some command line knowledge can be very handy if you need to find errors about why a program won’t run or malfunctions or if you lose your GUI desktop.

Networking:

Networking was first created on UNIX and built in at kernel level, as was the Internet. The syntax of Internet commands, email addresses, web URLs is UNIX syntax. Networking on Windows was an afterthought, an add-on. About half of the Internet now runs on UNIX variants, with Linux predominating.

Installing Software:

In UNIX variants the installer is built into the operating system, enforcing one way of installing programs, very unlike Windows or Macintosh where software comes with its own installer. This system reduces the chance for conflicts or missing library dependencies. When you install software you don’t need to reboot your computer.

Most Linux distributions now have specific Internet repositories for their software that is known to work correctly.

Security:

UNIX variants are more secure than Windows because of permissions and separate password-protected user accounts. This hierarchy of privileges and permissions makes it much more difficult for a hacker to gain access to the system. Certainly, a careless user might download malware and have his account corrupted, but a virus or malware can’t spread throughout the entire system. Most viruses, worms, trojans and malware are written for Windows, but they can’t run on Linux. There are a few viruses, worms and malware that can infect Linux, but they are rarely seen. Most Linux users never use an anti-virus program and don’t get infected. If Linux were to gain a greater market share, then more miscreant programmers might be given the incentive to write infective programs for Linux.

Stability:

Linux and UNIX variants do not use shared memory, as does Windows, so a program crash cannot crash the system or interfere with any other running program. Everything, even the kernel, runs in a separate virtual machine in its own memory space. It is almost impossible to crash a Linux machine unless you really know what you are doing or if there is hardware failure. Many Linux machines have been running for years without rebooting.

Configuration Files vs. the Registry:

Windows uses a single file known as the “Registry” to store all system and program configuration data. Much of this file is cryptic, using 32-bit hexadecimal numbers and other technical text not understandable to most users. If this file becomes corrupted, which it frequently can, Windows may not work at all. Windows does backup an older version of the file that can be used to return to a known good configuration, but often that file has been rewritten with the corrupted data before the user knows it. The only solution is to reinstall Windows.

In Linux, configuration files are all separate, human-readable text files, often having explanatory comments to suggest how to configure. The system configuration files are primarily stored in the /etc directory, can be read but not written to by users. In each user’s account are stored program environment variables in separate configuration files exclusively pertaining to that user’s preferences. It would be difficult for all those files to be corrupted or destroyed.

Memory:

Windows Vista requires at least 2GB of memory to run well. Most Linux distributions require only a quarter as much (512MB), unless you are doing high-level graphics, audio or video work. Some of the smaller distributions can run in 128MB! All of these are at least as powerful if not much more powerful than Windows. Linux has much more efficient memory management.

Error Logging:

All UNIX variants record system processes, errors and warnings to log files that can be very helpful in debugging problems.

Drivers:

In Linux all hardware drivers are included as kernel modules. There is no need to search for and install a driver for a new hardware peripheral. There are some peripherals that only have proprietary Windows drivers and will not work on Linux, but those are becoming fewer as more manufacturers release their hardware specs to the open source community.

Live CD:

Many Linux distributions are now available on CD or DVD in a runnable live format that can boot your computer and run the operating system as if it were installed, but without altering anything on your computer. This way you can test the OS before you decide to install.

In the early days of Linux and most UNIX variants there was no automatic detection and configuration of hardware and software. Users had to know a lot of command line terminology and had to spend hours configuring their system. I know this well, because I have been running Linux for over 15 years. Those days are past. The ease of installing many of the major Linux distributions now surpasses Windows. In the majority of cases everything works.

There are many graphical desktops to choose from in Linux, some simple and basic, others very powerful, with their own suite of integrated programs. Each has its own look and feel. Most of then are far more configurable than Windows and Mac. This situation can be a cause of confusion to Windows and Mac users who are used to a limited palette.

Now there are alternative GUI applications that substitute for almost all Windows and Mac applications that are as good or better than those commercially produced programs.

Linux is more flexible than Windows. That means it has more power but greater complexity. I can’t believe how much Windows Vista has been dumbed down from previous versions. It may make it easier for the average user, but for the computer savvy, it’s lack of configurability and informative error messages makes it a blank wall if you want to fix it.

I am a supporter of the “just works” philosophy for those computer users who can’t or won’t bother learning about computers in general and just want to get work done. This could be achieved in Linux. Linspire and Freespire were attempts to do this, but haven’t been successful because they’re still too complex. Such a system would come preinstalled and configured on a computer and much access to the working innards of the system would be turned off or not provided so that the user simply wouldn’t be allowed to make changes that might possibly bork the system. For instance, no program development applications would be installed. The only extra software would be available through a well-controlled repository. Technical assistance would be available through telephone or online, where a technician might be able to control the user’s computer through a secure connection and make repairs for a fee. Still, the user must learn how to use the software. Making more interactive tutorials available should be the solution.

Advertisements