Journey From Unix to Linux and Booting Process of Linux

Afridi ShaikAfridi Shaik
8 min read

Unix History

  1. Development and Founders:

    • Unix was developed by Ken Thompson, Dennis Ritchie, and others at Bell Labs, a research and development subsidiary of AT&T, in the early 1970s.
  2. Birthplace and Initial Release:

    • Unix was first developed at Bell Labs in Murray Hill, New Jersey, USA.

    • The initial version of Unix, known as Unix Version 1 (V1), was released in 1971.

  3. Hardware Platforms:

    • Unix was originally developed on the DEC PDP-7 minicomputer.

    • Over time, Unix has been adapted to run on various hardware platforms, including DEC PDP-11, VAX, Sun Microsystems' SPARC, IBM's AIX on Power Systems, and x86-based architectures.

  4. Creation of Linux Kernel (1991):

    • Linus Torvalds, a student at Helsinki University in 1991, developed the Linux kernel, aiming to create a Unix-like operating system compatible with the Intel 386 processor.
  5. Inspiration from MINIX OS:

    • Torvalds drew inspiration from MINIX, a Unix-like operating system, as he began working on Linux. His goal was to create an open-source alternative with features similar to MINIX.

Is Linux the Same as Unix ?

Yes:-

  • Unix-Like Structure:

    Linux follows a Unix-like structure, incorporating similar concepts and design principles.

  • Command-Line Interface (CLI):

    Linux provides a command-line interface similar to Unix, allowing users to interact with the system using commands.

  • API Conventions:

    Linux supports API conventions similar to Unix, enabling the running of programs that adhere to Unix-like standards (e.g., Postfix).

  • Look and Feel:

    Linux shares a similar look and feel with Unix, making it familiar for users accustomed to Unix environments.

No:-

  • Linux Kernel Innovations:

    The heart of the Linux kernel introduces new features beyond traditional Unix kernels, incorporating advancements to enhance performance, scalability, and support for a wide range of hardware.

  • Open Source Community Development:

    Linux is developed collaboratively by a vast open-source community, allowing for rapid innovation and adaptation to new technologies, a characteristic that sets it apart from traditional Unix development models.

  • Extensive Hardware Support:

    The Linux kernel has evolved to support a diverse array of hardware, making it versatile and adaptable to various computing environments.

  • Containerization and Virtualization:

    Linux embraces modern technologies like containerization (e.g., Docker) and virtualization (e.g., KVM), offering solutions that extend beyond the capabilities of traditional Unix systems.

Flavors of Unix

Features of Linux

  1. High Security [Virus Free ]

  2. High Stability

  3. Ease of Maintanance

  4. Hardware Independent

  5. Freely Available

  6. Distributed OS

  7. Supports All the File systems

    i. Physical FS:- ext2, ext3, ext4, XFS,ZFS....etc

    ii. Network FS:- NFS, CIFS etc..

  8. Multiuser, Multitasking OS

  9. Open Source

  10. Easy to Use

  11. Customization

  12. Education

  13. Support

  14. Better Process Handling

Linux Kernel

OS is broken into three pieces

  • Kernel:

    Responsible for low-level hardware communication.

  • Shell:

    Provides a user-friendly interface for human users.

  • Built-in Utilities:

    Offer basic tools for performing tasks and getting work done.

UNIX/Linux Shell

  • Powerful Interface:

    UNIX/Linux Shell provides a robust interface to the operating system, allowing users to manipulate data and execute various applications based on specific conditions.

  • Command-Line Interface:

    Commonly referred to as the 'command-line' interface, it resembles the old "Command Prompt" in Windows/DOS systems, although it differs in functionality and usage.

  • Diverse Flavors:

    The UNIX/Linux Shell comes in different flavors, each performing similar tasks in slightly different ways. Despite these variations, the core purpose remains consistent.

  • Navigating System Efficiency:

    A profound understanding of the shell is essential for unlocking the full potential of a UNIX system. Although it may pose challenges initially, mastering the shell transforms it into a reliable companion for efficiently addressing a myriad of computational problems.

Logging Into The Shell

  • to use the UNIX shell, you will have to authenticate yourself (tell the system who you are). This process is commonly called the 'login' process, and it involves two steps.

    1. Know your username and a password.

    2. Have a means of communicating with the UNIX shell, so you can provide this kind of information.

    The first step is quite easy. You contact your system administrator or relevant authority and you obtain a login name and a password for the system. The second step requires a little bit more attention.

Linux Booting Process

Ever thought about what happens when you turn on your Linux computer? ๐Ÿค” This blog will help you understand what goes on behind the scenes in simple steps.

  1. BIOS + UEFI

  2. Master Boot Loader [MBR]

  3. Boot Loader

  4. Kernel

  5. Intial RAM disk - initramfs Image

  6. /sbin/init -----> init [Parent Process ]

  7. CLI

  8. Systemd

  • BIOS + UEFI :

๐Ÿ”ง BIOS Introduction: BIOS, or Basic Input/Output System, is a crucial part stored in a chip on your PC's motherboard.

๐Ÿ–ฅ๏ธ Hardware Emphasis: This stage of the Linux boot process is more about the computer's hardware than Linux itself.

๐Ÿ’ป Power On Self Test (POST): When you power up your computer, the BIOS kicks in and promptly runs POST (Power On Self Test).

๐Ÿ› ๏ธ Diagnostic Tests: POST, a part of BIOS, conducts various diagnostic tests on hardware components like SSD/HDD, RAM, Keyboard, Mouse, USB, etc.

โœ… Hardware Operability Check: Once POST confirms the basic operability of the hardware, the BIOS begins searching for the Boot Loader, typically stored on one of the hard disks.

UEFI:

UEFI can be seen as a newer version of BIOS. ๐Ÿ”„

Short for Unified Extensible Firmware Interface, it does the same job as BIOS but with a big difference: it keeps all the startup information in a .efi file instead of the firmware. ๐Ÿ–ฅ๏ธ

(Firmware is like the device's built-in programming stored in its memory.)

This .efi file is saved on a special disk called EFI System Partition (ESP), and it holds all the details about starting up in UEFI. ๐Ÿ“

Most modern devices use UEFI because it comes with cool features like Secure Boot, Quick Boot, and more. โš™๏ธ

  • Master Boot Loader [MBR]:

    The MBR (Master Boot Record) is like the address card at the very start of your computer's hard drive. It tells the computer where to find the operating system (OS) so that it can start up.

    ๐Ÿ–ฅ๏ธ Depending on your computer's hardware, the MBR can be found in /dev/hda or /dev/sda.

    ๐Ÿ’ฝ This small 512-byte space contains important code and a short table of partitions. Its main job is to help load and run GRUB (Boot Loader), which is essential for starting up your computer.

  • Boot Loader:

    There are different bootloaders for Linux, like GRUB and LILO. GRUB2 is one of the latest ones.

    GRUB, short for GRand Unified Boot loader, is usually the first thing you see when you turn on your computer.

    It's like a simple menu that shows up, and you can use your keyboard to pick which version of the Kernel you want to use if you have multiple installed.

    When you have two operating systems on your computer, GRUB2 helps you choose which one to start up, kind of like picking from a menu. ๐Ÿš€

  • Kernel:

    The Kernel has complete control over everything in your system, leading it to be known as the core of the OS. ๐Ÿง 

    Kernels are self-extracting and stored in a compressed format to conserve space. ๐Ÿ“ฆ

    Once the chosen kernel is loaded into the memory and begins execution, it starts extracting itself before performing any useful task. ๐Ÿš€

    Once loaded by the bootloader, it mounts the root file system and initializes the /sbin/init program, which is commonly referred to as init. ๐ŸŒ

  • Initial RAM disk - initramfs Image:

The initial RAM disk is an initial/temporary root file system that is mounted prior to when the real root file system is available. ๐Ÿ 

This initramfs image is embedded in the Kernel and contains minimal binary files, modules & programs required for mounting the real root filesystem. ๐Ÿ•ต๏ธโ€โ™‚๏ธ\

  • /sbin/init -----> init [Parent Process ] :

๐Ÿš€ The "init" command takes the spotlight as one of the first tasks executed by the Kernel once it's loaded.

This command plays a crucial role in managing the entire booting process, creating the right environment for the user.

During system initialization, "init" handles essential tasks like checking file systems, configuring the clock, and initializing serial ports. It's the go-to hero for everything your system needs at this early stage.

Not just for startup, the "init" command also lends a helping hand in keeping the system running smoothly and ensuring a proper shutdown. ๐Ÿ”„๐Ÿ’ป

  • CLI using Getty:

"Getty" is short for "Get tty" (tty - teletype). It's a UNIX program on the host machine responsible for handling physical or virtual terminals.

When activated, "Getty" opens TTY lines, configures their modes, displays the login prompt, collects the user's name, and initiates the login process.

After successful authentication, users can then access and utilize the system. ๐Ÿš€๐Ÿ‘ค

  • Systemd:

The traditional startup method, associated with the System V variant of UNIX, followed a sequential process. However, a significant shift occurred with the controversial replacement of SysVinit by systemd.

SysVinit (Traditional init system - System V) adhered to a step-by-step approach. In contrast, systemd leverages the parallel processing capabilities of modern multi-core computers.

Important Note: systemd kicks in after the Kernel is loaded, initiating necessary dependencies and managing the subsequent processes.

By launching multiple processes simultaneously in parallel, systemd streamlines the startup process, leading to a reduction in boot time. ๐Ÿš€๐Ÿ•’

Linux Run Levels

> Run Level 0 = INIT 0 -----> Shutdown

> Run Level 1 = INIT 1 ------> Single User Mode Without GUI & NFS

> Run Level 2 = INIT 2 -------> Multi User Mode Without NFS

> Run Level 3 = INIT 3 -------> Multi User Mode with NFS

> Run Level 4 = INIT 4 --------> Reasearch Purpose

> Run Level 5 = INIT 5 ---------> X11 [ Linux Graphics ]

> Run Level 6 = INIT 6 ---------> Reboot

Linux File System Hierarchy

source:- https://linuxfoundation.org/blog/blog/classic-sysadmin-the-linux-filesystem-explained

Rhel Installation Guide

Vbox:-

https://medium.com/@selvarajk/install-redhat-enterprise-linux-9-in-virtual-box-d98edb7daa68

VMware:-

https://medium.com/analytics-vidhya/installation-of-red-hat-enterprise-linux-on-virtual-machine-vmware-372339fab02d

Playground:-

Linux Playground:-

https://www.redhat.com/en/interactive-labs/install-software-using-package-managers

0
Subscribe to my newsletter

Read articles from Afridi Shaik directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Afridi Shaik
Afridi Shaik