Close or Esc Key

Arduino Projects   |   Raspberry Pi   |   Electronic Circuits   |   AVR   |   PIC   |   8051   |   Electronic Projects

Introduction to Linux

Written By: 

Hari Prasaath K.

The computing devices have evolved to great extent in the past decades and so the software technology too. The computing devices all over the world can be broadly classified as Desktop computers & Laptops, Mobile devices, Servers, Mainframes, Supercomputers and Embedded devices. Any computer has two essential components - Hardware and Software. The software is broadly classified to two types - Operating System and Applications. Operating System is the type of software that controls the hardware of the computer.  Without operating system, application softwares cannot use hardware and so cannot run on a computer. Of all the types of computing devices, only a share of embedded devices run applications directly on hardware where the application software is hard-coded to the firmware of the device itself. All complex computing devices essentially need an operating system to run applications and manage hardware resources.

At present (by August 2018), Mobile devices constitute 52.61 %, Desktops & Laptops 43.15%, Tablets 4.13 % of all the computing devices around the world. There are few number of mainframes and supercomputers globally. There are billions of embedded devices but there is no exact mechanism to track their numbers and software technologies running them.

Among Desktop Systems (including Laptops), Windows, MacOS and Linux are the most popular operating systems with usage share of 82.45%, 12.64% and 1.7% respectively (Courtesy StatCounter). Among mobile devices, 72.46% use Android (which is based on Linux Kernel), 22.78% use iOS (which is based on Unix) and 0.52% use Windows (Mobile) Operating System. Among servers, 66% use Linux distributions (Like Ubuntu, Debian, CentOS, RedHat, Gentoo, Fedora etc), 1% use BSD (which is based on Unix) and 33.5% run Windows Server. Almost all supercomputers run on custom Linux variants.  Among Mainframes, 28% run Linux based OS while rest use Unix based operating systems. Even 29% embedded devices (running OS) are using Android or non-Android Linux operating systems. Obviously, Linux has widespread presence among all sorts of computing devices. The open-source nature of Linux has helped in leveraging it to such popularity and no doubt, its usage share might further increase exponentially edging out any competitive operating system.

So, importance of learning and mastering Linux is undisputed for any software developer. This series is designed for any aspiring engineer to develop basic understanding of Linux as operating system and equip one to common use of Linux both as user and developer.

Role of an Operating System -

As mentioned before, a computer has two basic components - hardware and software. The processor, physical memory (RAM), motherboard, secondary storage devices (like hard disks and solid state disks), sound card, video card and input/output peripherals (input devices like keyboard, mouse, touchpad, touch screen, microphone and, output devices like display and speakers) are common hardware devices in any computer.

The software can be of two types - Applications and Operating System. Applications are programs that allow hardware to manipulate data. Like a word processor reads data input through keyboard, display typed data through a graphical interface on display, save word files to secondary storage and let print those word files by a printer. The data (or information) in case anytime can be runtime data or data stored in files on storage devices. The applications are stored on secondary storage as files called programs. These files in action or programs while runtime are called processes. The processes cannot directly access the hardware components. They need another software that would manage hardware resources, physical memory, data files and data transfer from one hardware to another. This software is called operating system.

The operating system is responsible for managing hardware resources, allocating physical and virtual  memory to applications, maintain file systems and manage all the processes running on the computer at a time. The person using the computer is called user. User may need to login the operating system to use the computer and applications installed on it.

The user interact with the applications (that are installed over operating system) by input/output peripherals. The operating system has device drivers installed for each hardware connected in the computer system. The device drivers are programs that dictate data communication with a hardware component. Each hardware connected in the computer system has its own device driver that must be explicitly installed on the operating system to let operating system interact with the hardware in case.

The operating system also provides an user interface which is projected on a display (LCD, LED monitor or projector screen). The user interface allows user to access files stored on connected secondary storage or removable storage devices and interact with the application programs. The user interface can be textual in nature. Such interface is called command line interface. In command line interface, user needs to type commands to run application programs or access files and their content. Or the user interface can be graphical in nature. Such interface is called Graphical User Interface. In graphical user interface, the user can access the programs and data files as clickable icons on the screen.

The operating system also provides system services or utility services. These services include scheduling of programs (processes), file handling, manipulation of text, printing, networking etc. These services run as separate processes and are initiated as the operating system is booted. The application programs may need to access or interact with one or many of these services for specific tasks.

So, in a computer system architecture, hardware lies at the lowest level. Over hardware, runs the operating system which interact with the hardware as well as manage application softwares. The application programs run over operating system and they are controlled and managed by the it. Above all is the human user that login to operating system to access application programs and interact with them through input/output peripherals.       

Role of Operating System in Computers

Fig. 1: Basic Architecture of any Computer

Linux Operating System -

Linux is an open source operating system available for a variety of computing platforms. It was originally developed by Linus Benedict Torvalds, then a student at University of Helsinki and now a Finnish American software engineer, as Linux Kernel. After developing the Linux Kernel, Torvalds released it on internet for suggestions to improve it. Soon, he started receiving suggestions from students as well as professional software developers from around the world.

Initially, Linus himself managed to incorporate the changes which later became a community project with source code of Linux Kernel available to anyone without any license fee. Anyone can download the source code of Linux Kernel, test it for bugs and improvements, make changes to it and release own customized version of Linux. The Linux Kernel is written in C which is the most popular and widely used programming language. The Linux Kernel along with system utilities (GNU utilities), Shell (special utility for user to manage files and programs), desktop environment (which adds a graphic user interface to the Linux Kernel) and default application softwares (written for the Linux Kernel) form a complete operating system ready to use. The Linux Kernel, GNU utilities, Shell, desktop environment and default application programs are packaged as Linux Distributions that can be downloaded and installed by anyone without any license fee.

There are hundreds of Linux Distributions. One might need to update the Linux Kernel after installing a particular distribution to correct some bugs or make specific application programs run. There are thousands of software developers and hundreds of companies that are contributing to the development on Linux. The ]]>Linux Kernel]]> is periodically updated and made available for download. Each release of Linux Kernel is identified by a version number. The version number is made up of three components - Major number, Minor number and Revision Number. Major number indicates major revision to the Linux Kernel. The minor number indicates minor revisions and stability of the version. If the minor number is odd, it indicates that it is a development kernel and if it is even it indicates that it is a production kernel. Development kernels are not fully tested and can be unstable. The Production Kernel are fully tested and stable release of Linux Kernel. The revision number indicates minute changes to the Kernel. For example, the latest stable Linux Kernel version is 4.18.10 (as on September 26 of 2018) in which 4 is the major number, 18 is the minor number and 10 is revision number.  The latest development kernel available is 4.19.5.          

History of Linux -

In 1965, Massachusetts Institute of Technology (MIT), General Electric and AT&T Bell Laboratories started development of an operating system called Multiplexed Information and Computing Service (MULTICS). MULTICS was a test project to improve time sharing of the processor among processes. The project was abandoned in 1969. However, Ken Thompson, who was a member of the development team for MULTICS, continued working on it and developed an operating system called UNIX.

Ken Thompson who developed UNIX and B Programming Language

Fig 2: Ken Thompson, who developed UNIX and B Programming Language 

At the same time, C programming language was developed by Dennis Ritchie. At that time, computers were usually programmed in assembly languages and there was no platform independent programming language. C was a revolutionary development as it was platform independent and could be used to write programs for any processor family. The UNIX was re-written in C language by late 1970s. So, UNIX became popular as portable operating system among the software community.

Dennis Ritchie who developed C Programming Language

Fig. 3: Dennis Ritchie, who developed C Programming Language

Due to a federal court order, AT&T could not market UNIX, so it sold the UNIX source code to several companies in compliance to a set of standards. Each company could develop its own version of UNIX as far as it adheres to the standards agreed upon. AT&T also gave free source code of UNIX to several colleges and universities for educational purpose and to promote UNIX at the first place. Throughout 1980s, UNIX remained confined to large software companies as any typical UNIX system would cost hundreds of thousand dollars. The different variants of UNIX (developed by individual companies) are still used by major software companies. Oracle's Solaris, Apple's Macintosh OS X and iOS, Hewlett-Packard’s HP-UX, IBM’s AIX and many other operating systems sold by major software companies are all based on UNIX.

In mid 1980s, Richard Stallman who was a famous hacker, formed Free Software Foundation (FSF) and founded GNU project to build a free operating system that was not UNIX. The GNU project introduced GNU public license under which software could be developed by free collaborative contributions and its source code could be available for free without any license fee. Any developer could get source code for free softwares under GNU, modify it and distribute it provided under the same license which implies that source code of the modified version must also be made available by the developer. This collaborative software development without any attached license fee became popular by name hacker culture.

Richard Stallman, Famous Hacker and Founder of Free Software Foundation

Fig. 4: Richard Stallman, Famous Hacker and Founder of Free Software Foundation

In 1991, Linus Benedict Torvalds, a student at University of Helsinki while working on MINIX (Mini UNIX) developed first Linux Kernel. MINIX was an educational version of UNIX developed by Andrew Tannenbaum  for Intel x86 platform. In 1990s, the Intel x86 platform was becoming a norm in homes and offices with Microsoft's Windows Operating System running on it.

Linus Benedict Torvalds who developed first Linux Kernel

Fig. 5: Linus Benedict Torvalds who developed first Linux Kernel 

Soon Torvalds published Linux Kernel under GNU Public License and hacker culture started contributing to it. The Linux Kernel combined with GNU system utilities become a complete and free operating system. Later, desktop environments and free applications written for Linux further expanded its use and scope. By 1998, hacker culture began to be known by term OSS (Open Source Software) developers. There are thousands of software developers (OSS developers) and hundreds of companies (including major software companies) that have been contributing to the development of Linux Kernel and associated software applications.

By 2007, development of the Kernel has shifted from top 20 developers writing 80 percent of the code to top 30 developers writing just 30 percent of the Linux code. The Linux Kernel is available under GNU Public License and there are hundreds of Linux Distributions currently available. All the Linux Distributions have common Linux Kernel and GNU utilities and only differs in their desktop environments and add-on packages (default applications that come installed with the distribution).

While OSS developers were focussed on developing networking softwares in 1980s, they concentrated their effort to Linux development throughout 1990s. At present, the open-source software community is focussed on development in Embedded Linux as years of 2010s are witness to unprecedented growth and popularity of Android operating system for mobiles. Android is an open-source mobile operating system based on (of course) Linux.     

Licensing of Linux -

Linux is available under GNU Public License which was developed by Free Software Foundation (FSF). Under GPL, any software and its source code must be freely available. If someone modifies the source code, it should also be redistributed without any license fee. So Linux is Open Source. Under Open Source license, the software and source code must be available free of any charge. The software itself is freely developed and improved under collaboration. Open Source Software (OSS) has several advantages like rapid development by collaboration, continuous bug fixes, development of the software as per user needs and suggestions.   

Another type of software license is closed source license. A closed source software can be distributed free or with attached license fee but its source code is not available. The type of closed source software that is given free of charge is called freeware. The type of closed source software that is available for free of charge but requires payment after a period of its use is called shareware.

The software companies and developers cannot generate revenue on open source software as the software as well as its source code must be distributed free under open source license. So, OSS developers (and so Linux developers) generate revenue by selling hardware that run OSS, selling closed source softwares that run on OSS like on Linux and by providing customer support related to an OSS.  

Advantages of Using Linux -

Linux offers several advantages like low cost of operation, flexibility of hardware platforms,  stability and security, multithreading, multi-user capability, multi-tasking, flexibility of file systems, monolithic kernel and ease of customization.

Applications of Linux -  

Linux is used on variety of platforms and applications. Linux can serve as operating system on numerous hardware platforms like Intel x86/x64, ARM, MIPS, Itanium, Alpha, PowerPC, SPARC, Ultra-SPARC, M68K, Mainframe etc. It is used on desktop computers (home and office workstations), internet servers, supercomputers, cloud systems, file and print servers, application servers, scientific workstations, mobile phones and embedded devices. Linux is freely available for both users and developers. Its open-source nature has let it grow and advance rapidly. Embedded Linux has even more prosperous future. Android, the most common mobile operating system on earth at present is Linux at its core as it is based on Linux Kernel.

Any Linux Operating System or Linux Distribution is often called a Linux System. In the next tutorial - Any Linux System at a Glance, the building blocks of any Linux System (i.e. Linux Kernel, GNU Utilities, the Shell, CLI/GUI Desktop Environments and Applications) will be explored and various Linux Distributions will be examined.