Showing posts with label Operating System. Show all posts
Showing posts with label Operating System. Show all posts

Saturday, 12 December 2020

Introduction to Linux Operating System

Linux Operating System, LPI Exam Prep, Linux Tutorial and Material, Linux Guides, Linux Certification

Linux is a community of open-source Unix like operating systems that are based on the Linux Kernel. It was initially released by Linus Torvalds on September 17, 1991. It is a free and open-source operating system and the source code can be modified and distributed to anyone commercially or noncommercially under the GNU General Public License.

Initially, Linux was created for personal computers and gradually it was used in other machines like servers, mainframe computers, supercomputers, etc. Nowadays, Linux is also used in embedded systems like routers, automation controls, televisions, digital video recorders, video game consoles, smartwatches, etc. The biggest success of Linux is Android(operating system) it is based on the Linux kernel that is running on smartphones and tablets. Due to android Linux has the largest installed base of all general-purpose operating systems. Linux is generally packaged in a Linux distribution. 

Linux Distribution

Linux distribution is an operating system that is made up of a collection of software based on Linux kernel or you can say distribution contains the Linux kernel and supporting libraries and software. And you can get Linux based operating system by downloading one of the Linux distributions and these distributions are available for different types of devices like embedded devices, personal computers, etc. Around 600 + Linux Distributions are available and some of the popular Linux distributions are: 

◉ MX Linux

◉ Manjaro

◉ Linux Mint

◉ elementary

◉ Ubuntu

◉ Debian

◉ Solus

◉ Fedora

◉ openSUSE

◉ Deepin

Architecture of Linux

Linux architecture has the following components: 

Linux Operating System, LPI Exam Prep, Linux Tutorial and Material, Linux Guides, Linux Certification

1. Kernel: Kernel is the core of the Linux based operating system. It virtualizes the common hardware resources of the computer to provide each process with its virtual resources. This makes the process seem as if it is the sole process running on the machine. The kernel is also responsible for preventing and mitigating conflicts between different processes. Different types of the kernel are: 

◉ Monolithic Kernel
◉ Hybrid kernels
◉ Exo kernels
◉ Micro kernels

2. System Library: Isthe special types of functions that are used to implement the functionality of the operating system.

3. Shell: It is an interface to the kernel which hides the complexity of the kernel’s functions from the users. It takes commands from the user and executes the kernel’s functions.

4. Hardware Layer: This layer consists all peripheral devices like RAM/ HDD/ CPU etc.

5. System Utility: It provides the functionalities of an operating system to the user.

Advantages of Linux


◉ The main advantage of Linux, is it is an open-source operating system. This means the source code is easily available for everyone and you are allowed to contribute, modify and distribute the code to anyone without any permissions.

◉ In terms of security, Linux is more secure than any other operating system. It does not mean that Linux is 100 percent secure it has some malware for it but is less vulnerable than any other operating system. So, it does not require any anti-virus software.

◉ The software updates in Linux are easy and frequent.

◉ Various Linux distributions are available so that you can use them according to your requirements or according to your taste.

◉ Linux is freely available to use on the internet.

◉ It has large community support.

◉ It provides high stability. It rarely slows down or freezes and there is no need to reboot it after a short time.

◉ It maintain the privacy of the user.

◉ The performance of the Linux system is much higher than other operating systems. It allows a large number of people to work at the same time and it handles them efficiently.

◉ It is network friendly.

◉ The flexibility of Linux is high. There is no need to install a complete Linux suit; you are allowed to install only required components.

◉ Linux is compatible with a large number of file formats.

◉ It is fast and easy to install from the web. It can also install on any hardware even on your old computer system.

◉ It performs all tasks properly even if it has limited space on the hard disk.

Disadvantages of Linux


◉ It is not very user-friendly. So, it may be confusing for beginners.

◉ It has small peripheral hardware drivers as compared to windows.

Is There Any Difference between Linux and Ubuntu?


The answer is YES. The main difference between Linux and Ubuntu is Linux is the family of open-source operating systems which is based on Linux kernel, whereas Ubuntu is a free open-source operating system and the Linux distribution which is based on Debian. Or in other words, Linux is the core system and Ubuntu is the distribution of Linux. Linux is developed by Linus Torvalds and released in 1991 and Ubuntu is developed by Canonical Ltd. and released in 2004.

Thursday, 11 April 2019

Operating System - The Linux Kernel

The main purpose of a computer is to run a predefined sequence of instructions, known as a program. A program under execution is often referred to as a process. Now, most special purpose computers are meant to run a single process, but in a sophisticated system such a general purpose computer, are intended to run many processes simulteneously. Any kind of process requires hardware resources such are Memory, Processor time, Storage space, etc.

Operating System, Linux Kernel, Linux Command, LPI Study Materials

In a General Purpose Computer running many processes simulteneously, we need a middle layer to manage the distribution of the hardware resources of the computer efficiently and fairly among all the various processes running on the computer. This middle layer is referred to as the kernel. Basically the kernel virtualizes the common hardware resources of the computer to provide each process with its own virtual resources. This makes the process seem as it is the sole process running on the machine. The kernel is also responsible for preventing and mitigating conflicts between different processes.

This schematically represented below:

Operating System, Linux Kernel, Linux Command, LPI Study Materials

Figure: Virtual Resources for each Process

The Core Subsystems of the Linux Kernel are as follows:

1. The Process Scheduler
2. The Memory Management Unit (MMU)
3. The Virtual File System (VFS)
4. The Networking Unit
5. Inter-Process Communication Unit

Operating System, Linux Kernel, Linux Command, LPI Study Materials

Figure: The Linux Kernel

For the purpose of this article we will only be focussing on the 1st three important subsystems of the Linux Kernel.

The basic functioning of each of the 1st three subsystems is elaborated below:

◈ The Process Scheduler:

This kernel subsystem is responsible for fairly distributing the CPU time among all the processes running on the system simulteneously.

◈ The Memory Management Unit:

This kernel sub-unit is responsible for proper distribution of the memory resources among the various processes running on the system. The MMU does more than just simply provide separate virtual address spaces for each of the processes.

◈ The Virtual File System:

This subsystem is responsible for providing a unified interface to access stored data across different filesystems and physical storage media.

Wednesday, 13 December 2017

How OpenBSD and Linux Mitigate Security Bugs

At Open Source Summit in Prague, Giovanni Bechis will discuss tools that improve software security by blocking unwanted syscalls.

Bechis is CEO and DevOps engineer at SNB s.r.l., a hosting provider and develops web applications based on Linux/BSD operating systems that is mainly focused on integrating web applications with legacy softwares. In this interview, Bechis explained more about his approach to software security.

Linux.com: What’s the focus of your talk?


The talk will focus on two similar solutions implemented in Linux and OpenBSD kernels, designed to prevent a program from calling syscalls they should not call to improve security of software.

In both kernels (Linux and OpenBSD), unwanted syscalls can be blocked and the offending program terminated, but there are some differences between Linux and OpenBSD’s solution of the problem.

During my talk, I will analyze the differences between two similar techniques that are present in Linux and OpenBSD kernels that are used to mitigate security bugs (that could be used to attack  software and escalate privileges on a machine).

Linux.com: Who should attend?


The scope of the talk is to teach developers how they can develop better and more secure software by adding just few lines to their code. The target audience is mainly developers interested in securing applications.

Linux.com: Can you please explain both solutions and what problems they actually solve?


The main problem that these solutions are trying to solve is that bugs can be exploited to let software do something that it is not designed to do. For example, with some crafty parameters or some crafty TCP/IP packet, it could be possible to let a program read a password file; it should not read or delete some files that it should not delete.

This is more dangerous if the program is running as root instead of a dedicated user because it will have access to all files of the machine if proper security techniques have not been applied.

With these solutions, if a program tries to do something it is not designed for, it will be killed by the kernel and the execution of the program will terminate.

To do that, the source code of the program should be modified with some “more or less” simple lines of code that will “describe” which system calls the program is allowed to request.

A system call is the programmatic way in which a computer program requests a service from the kernel of the operating system it is executed on, by allowing only a subset of the system calls we can mitigate security bugs.

Last year, for example, memcached, a popular application designed to speed up dynamic web applications, has suffered by a remote code execution bug that could be exploited to remotely run arbitrary code on the targeted system, thereby compromising the many websites that expose Memcache servers accessible over the Internet.

With a solution like seccomp(2) or pledge(2), a similar bug could be mitigated, the remote code would never be executed, and the memcached process would be terminated.

Linux.com: What’s the main difference between the two solutions?


The main difference (at least the more visible one without viewing under the hood) between Linux and OpenBSD implementation is that, with Linux seccomp(2), you can instruct the program in a very granular way, and you can create very complex policies, while on OpenBSD pledge(2) permitted syscalls have been grouped so policies will be simpler.

On the other hand, using seccomp(2) in Linux could be difficult, while OpenBSD pledge(2) is far easier to use.

On both operating systems, every program should be studied in order to decide which system call the application could use, and there are some facilities that can help understand how a program is operating, what it is doing, and which operations it should be allowed to do.