Thursday, February 27, 2020

Disk Scheduling



FCFS Scheduling
The simplest disk scheduling algorithm is First Come First Serve Scheduling algorithm.
<diagram>

SSTF Scheduling
SSTF stands for Shortest Seek Time First algorithm. The SSTF selects the request that have smallest seek time from the current head position. The algorithm have better performace over FCFS scheduling algorithm
<diagram>

SCAN Scheduling
In SCAN algorithm, disk arm starts moving from one end of the disk to other end. While moving, it services along the way. On reaching other end, direction of head movement is reversed and while coming back, it again services the request in the path. This algorithm is also known as elevator algorithm.
<diagram>

C-SCAN Scheduling
C-SCAN stands for Circular SCAN Scheduling. In this scheduling algorithm like SCAN algorithm, head moves from one end to other and services the request  along the way. But on reaching the other end, the head immediately returns to the beginning of the disk without service request while coming back.
 <diagram>


Monday, February 17, 2020

Linux Directory Structure

In a hierarchical inverted tree like structure, the Linux provides following directories under the /directory to store a specific type of file.

1. / – Root
    Every single file and directory starts from the root directory.    
    Only root user has write privilege under this directory.
     /root is root user’s home directory.

2. /home – Home Directories
    Contains all the HOME directories of users.
    Home directories for all users store particular user personal files.
    For example: /home/teachers, /home/students, /home/mhcollege

3. /bin – User Binaries
    Contains many utilities as binary executables.
    The utilities are common linux commands you need to use in single-user modes
    Commands used by all the users of the system are located here.
    For example: ps, ls, ping, grep, cp.

4. /dev – Device Files
    Contains device files.
    These include terminal devices, USB, or any device attached to the system.
    For example: /dev/tty1, /dev/usbmon0

5. /etc – Configuration Files
    Contains configuration files required by all programs.
    Stores system related data which users and the system need to refer.
    This also contains startup and shutdown shell scripts used to start/stop individual programs.
    For example: passwd, /etc/resolv.conf, /etc/logrotate.conf

6. /lib – System Libraries
    Contains library files for the compilers installed in the system 
    Library filenames are either ld* or lib*.so.*
    For example: ld-2.11.1.so, libncurses.so.5.7

7. /sbin – System Binaries
     Just like /bin, /sbin also contains binary executables.     
     But, the linux commands located under this directory are used by system aministrator, for system            maintenance purpose.
      For example: iptables, reboot, fdisk, ifconfig, swapon

8. /boot – Boot Loader Files
    Contains boot loader related files.
    Kernel initrd, vmlinux, grub files are located under /boot
    For example: initrd.img-2.6.32-24-generic, vmlinuz-2.6.32-24-generic

9. /usr – User Programs
    Contains operating system files which are not involved in the boot process. 
    /usr/bin contains binary files for user programs. For example: at, awk, cc, less, scp
    /usr/sbin contains binary files for system administrators. For example: useradd, userdel
    /usr/lib contains libraries for /usr/bin and /usr/sbin
    /usr/local contains users programs that you install from source. 

10. /var – Variable Files
    var stands for variable files.
    Content of the files that are expected to grow can be found under this directory.
     Includes system log files (/var/log); packages and database files (/var/lib); emails (/var/mail); print         queues (/var/spool); lock files (/var/lock); temp files needed across reboots (/var/tmp);

11. /tmp – Temporary Files
    Contains temporary files created by system and users.
    Files under this directory are deleted when system is rebooted.

12. /media – Removable Media Devices
    Temporary mount directory for removable devices.
    For examples, /media/cdrom for CD-ROM; 
                           /media/floppy for floppy drives; 
                           /media/cdrecorder for CD writer


Sunday, February 16, 2020

vi Editor

The vi editor is visual editor used for creating and editing text files containing data, document or programs. 

It is like Notepad we use in Windows.

It display content of files on the screen and allows user to add, insert, delete or change text. 

Some of the other editors for Linux are

ed (line editor)

emacs(edit macros editor)

red (restricted line editor) etc.


Starting vi editor

SYNTAX: vi filename <Enter>

EXAMPLE: [root@localhost student]# vi msg.txt

-

-

-

-

-

-

-

-

-

-

“msg.txt” [New File]

             To end insertion or append mode, Press <Esc> and type vi editors command.


Commands of vi editor

The vi editor works in two mode insert mode and append mode. After starting vi editor, Press I to add text. The other commands are

:wq<Enter>                         save all changes and quit

:w<Enter>                         save file

:e<filename><Enter>    open specified file

yy or y                     marks current line as line to be copied

                            paste marked text after current cursor position

P                            paste marked text before current cursor position 

Functions of vi editor

1. Vi editor allow user to create a file and write data to it.

2. It allow user to open existing file, modify content and save changes in file.

3. It allows user to copy and paste text from one position in a file to another.’

4. It allow searching for a particular expression or word.

5. Large amount of data can also be handled using vi editor.


Tuesday, February 11, 2020

The History of Linux

1991: Linus Torvalds announced Linux

Linux Torvalds, a student of Helsinki University, Finland, introduced linux in 1991. He worked on the Linux project and write the source code for the Linux kernel. He made Linux available on the Internet. Many programmers added to the code, changed it and built in support for all kinds of hardware. Linux 0.02 was introduced in 1991.

On 25 August 1991 sent a mail to a newsgroup on Usenet. He talked about developing a free operating system.

1992: Linux became Open Source

Linux was not always Open Source. The first few licenses of Linux forbid commercial redistribution. It was with version 0.12 in February’92 that Linux Kernel was released under GPL.

1993: Slackware Linux released

The oldest currently (as of 2018) existing Linux distribution, Slackware version 1.0 was released for the first time on 17th July 1993. Later in the same year, the Debian project is established. Today it is the largest community distribution.

1994: Someone registered Linux trademark and it was not Linus Torvalds

Torvalds and hundreds of developers from across the world worked on it and in March 1994, version 1.0 of Linux kernel was released.

Linux trademark was registered in 1994 by a William R. Della Croce, Jr.

1995: First Linux Expo

First Linux specific tradeshow and conference series was launched by people at North Carolina State University. This became one of the most attended annual Linux show for next several years.

Linux is also ported to the DEC Alpha and to the Sun SPARC.

1996: Tux gets to be the symbol of Linux

Linus Torvalds recommended a penguin as the mascot of Linux. Tux was created by Larry Ewing in 1996. Tux has been unchanged for last 19 years.

Version 2.0 of the Linux kernel is released. The kernel can now serve several processors at the same time using symmetric multiprocessing (SMP), and thereby becomes a serious alternative for many companies.

1997: GNOME Project is born

GNOME is one of the most successful open source projects. It has been crucial to the spread of desktop Linux. It has given us a number of programs that we use today on desktop Linux.

1998: KDE 1.0 released. Many major companies such as IBM, Compaq and Oracle announce their support for Linux.

2000: Dell announces that it is now the No. 2 provider of Linux-based systems worldwide and the first major manufacturer to offer Linux across its full product line.

2002: Red Hat Enterprise Linux released

The first commercial Linux for Business IT was released in the year 2002. RHEL is one of the few Linux distributions that changed Linux forever.

2003: Attempt to install backdoor in Linux kernel

An attempt was made to insert a backdoor in the Linux kernel source. Disguised as an innocuous error checking routine, the backdoor was designed to obtain root privileges under specific conditions. Linux Kernel maintainers caught it before it could made to mainline Linux kernel.

2004: Ubuntu 4.10 released

On 20th October 2004, Ubuntu 4.10 was released. This new Linux distribution marketed itself as Linux for human being.

2005: Linus Torvalds created Git

In 2005, BitKeeper decided to not provide the free version to the community anymore. This forced Linus Torvalds to work on his own version control system and thus Git was born.

2006: Oracle releases its own distribution of Red Hat Enterprise Linux. Novell and Microsoft announce cooperation for a better interoperability and mutual patent protection.

2007: Linux powered netbook arrived

In a time when Windows came pre-installed on majority of personal computers, Asus launched Eee PC, a lower end, lightweight netbook series. It came preinstalled with a custom version of Linux called Xandros. Dell also started distributing laptops with Ubuntu pre-installed on them.

2008: Android version 1.0 released

With the release of Android, a mobile operating system based on Linux Kernel, Linux took the first step in the world of mobile OS. While desktop Linux might not have been that big a sucess, with Android, Linux is dominating the world of mobile OS.

2009: Google announced Chrome OS

Google announces its own  desktop operating system Chrome OS, based on Linux kernel. Later on, Google also started releasing Chromebooks, dedicated devices to run Chrome OS. Chromebooks have grown in popularity in recent years and last year it outsold MacBooks in the US.

Red Hat's market capitalization equals Sun's, interpreted as a symbolic moment for the "Linux-based economy".

2010: Red Hat became first billion dollar open source company

Red Hat Linux became the first billion dollar open source company in 2010. The success of Red Hat breaks the myth that open source companies cannot make money.

2011: Version 3.0 of the Linux kernel is released.

2012: The aggregate Linux server market revenue exceeds that of the rest of the Unix market.[60]

2013: Ubuntu Phone announced

2014: Ubuntu claims 22,000,000 users.

Microsoft’s new CEO Satya Nadella shocked the tech world with his “Microsoft loves Linux” remark. As we see later that this was just the beginning of Microsoft’s grand design to rule cloud world. However, this actually brought a shift in Microsoft policies and for the first time Microsoft started open sourcing its products and bringing it to Linux.

2015: Version 4.0 of the Linux kernel is released

Microsoft has its own version of Linux. A of software meant for network switches that required Linux.

2019: Version 5.0 of the Linux kernel is released.