0% found this document useful (0 votes)
11 views15 pages

OS case study

The document is an Operating System Lab Report for a BSc in Computer Science and Information Technology, detailing the Linux operating system's history, kernel modules, process management, inter-process communication, memory management, file system management, and device management approaches. It outlines the evolution of Linux since its inception in 1991, various scheduling algorithms, and the structure of file systems in Linux. The report serves as a comprehensive guide to understanding the functionalities and management techniques of the Linux operating system.

Uploaded by

wonderwasper
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views15 pages

OS case study

The document is an Operating System Lab Report for a BSc in Computer Science and Information Technology, detailing the Linux operating system's history, kernel modules, process management, inter-process communication, memory management, file system management, and device management approaches. It outlines the evolution of Linux since its inception in 1991, various scheduling algorithms, and the structure of file systems in Linux. The report serves as a comprehensive guide to understanding the functionalities and management techniques of the Linux operating system.

Uploaded by

wonderwasper
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

NAGARJUNA COLLEGE OF

IT

(BSc.CSIT)
Operating System Lab Report
Subject Code: CSC 259

Submitted By: Submitted To:


Name: Sadhana Khadka Bipin Timalsina
Roll No.: 20
Semester: Fourth
Table of contents

1. Introduction
2. History
3. Kernel Modules
4. Process Management and Scheduling Approaches
5. Inter-process Communication
6. Memory Management Approaches
7. File System Management Approaches
8. Device Management Approaches
9. Summary
10. Reference

1
Abbreviations

1. OS: Operating System

2. GNU: GNU’s Not Unix

3. GPL: General Public License

4. KDE: Kool Desktop Environment

5. AMD: Advanced Micro Devices

6. CPU: Central Processing Unit

7. RAM: Random Access Memory

8. CFS: Completely Fair Scheduler

9. NFS: Network File System

10. PC: Personal Computer

11. SCSI: Small Computer System Interface

12. SSD: Solid-State Drive

13. FAT: File Allocation Table

14. NTFS: New Technology File System

15. I/O: Input-Output

16. USB: Universal Serial Bus

2
1. Introduction
Linux is an open-source Unix-like operating system-based family on the Linux
kernel, and the OS kernel was first published on 17 September 1991 by Linus
Torvalds. Typically, Linux is packaged as the Linux distribution, which contains the
supporting libraries and system software and kernel, several of which are offered by
the GNU Project. [1]

Fig 1: Linus Torvalds

Linux has around 600+ different distributions and some of the popular Linux
distributions are: MX Linux, Manjaro, Linux Mint, Ubuntu, Debian, Solus, Fedora,
openSUSE, and Deepin. [2]

2. History
In 1991, Torvalds began the development of the Linux kernel on MINIX and
applications written for MINIX were also used on Linux. Later, Linux matured and
further Linux kernel development took place on Linux systems. Initially, Linux was a
command- line interface operating system that was based on the UNIX operating
system. Over time, Linux became more powerful and user-friendly, thanks to
contributions from a large community of developers around the world. Today, Linux
is used in a variety of devices such as servers, supercomputers, smartphones, and
even in automobiles. [3]

Some major developmental changes in the history of Linux are as follows:


 1991: LINUX was introduced by a Finland student Linus Torvalds.

3
 1992: The next version of Linux was released under GNU General Public
License (GPL).
 1993: Over 100 developers worked on LINUX kernel creating a large
spectrum of application types for LINUX
 1994: The Linux kernel was updated to version 1.0, and Red Hat distribution
was introduced.
 1995: The Linux community started to grow rapidly, with many developers
contributing code to the project.
 1996: Version 2.0 of LINUX Kernel was released and became a serious
alternative for many companies.
 1998: Many major companies like IBM, Compaq and Oracle announced their
support for Linux. A group of programmers began to work for Graphical User
Interface.
 1999: The first version of the GNOME desktop environment was released,
providing an alternative to the popular KDE desktop environment.
 2004: Ubuntu Distribution was released
 2006: Oracle released its own distribution of Red Hat Enterprise.
 2007: Dell started distributing laptops with Ubuntu pre-installed on them.
 2008: Android, a mobile operating system based on the Linux kernel,
was released.

 2011: The Linux kernel reached version 3.0, with many new features and
improvements.

 2013: Google Linux-Based Android system claimed 75% of full-on


smartphone market, in terms of number of phones shipped.
 2014: Ubuntu claimed 22 million users.
 2015: Version 4.0 of Linux Kernel was released
 2019: The Linux Kernel reached version 5.0, with AMD display support,
Raspberry Pi Touchscreen support, etc.
 2021: Linux turned 30 years old, with a global community of developers
and users.
 2022: Linux Kernel reached version 5.16, with new features for security,
performance, and hardware support.
 2023: Linux continues to evolve and innovate. [4]

4
3. Kernel Modules
Kernel modules are pieces of code that can be loaded and unloaded into the kernel
upon demand. Kernel modules extend the functionality of the kernel, such as device
drivers, network protocols, and file systems without the need to reboot the system.
A module can be configured as built-in or loadable. To dynamically load or remove a
module, it has to be configured as a loadable module in the kernel configuration. [5]
The Linux kernel is a monolithic kernel, which means it is one single large program
where all the functional components of the kernel have access to all of its internal
data structures and routines. Kernel modules are usually stored in the /lib/modules
subdirectories. [6]

The Kernel Module includes:

Fig 2: Kernel Module

i) Applications and OS services:


These are the user application running on the LINUX system. OS services
include utilities and services like shells, libraries, compilers, etc.

ii) LINUX Kernel:


Kernel abstracts the hardware to the upper layers. It mediates and
controls access to system resources.

iii) Hardware:
This layer consists of the physical resources of that system that finally do
the actual work. It includes the CPU, the hard disk, system RAM, etc. [6]

5
4. Process Management and Scheduling Approaches

4.1 Linux Scheduling:


A process is a program in execution. Process management refers to the
techniques and strategies used by organizations to design, monitor, and
control their business processes to achieve their goals efficiently and
effectively. It involves identifying the steps involved in completing a task,
assessing the resources required for each step, and determining the best way
to execute the task. [7]

The Linux operating system uses a preemptive multitasking approach to


process management and scheduling. This means that the operating system
can switch between multiple processes at a very high frequency, giving the
illusion of multiple processes running simultaneously. Linux uses several
scheduling algorithms, including the Round Robin Scheduling Algorithm.

There are two types of processes in Linux:


i) Foreground Process
By default, all the processes run in the foreground. Such processes are also
known as interactive processes. These are the processes which are to be
executed or initiated by the user or the programmer; they cannot be initialized
by system services. Such processes take input from the user and return the
output. While these processes are running we cannot directly initiate a new
process from the same terminal. [7]
ii) Background Process
Background processes are also known as non-interactive processes. These are
the processes that are to be executed or initiated by the system itself or by
users, though they can even be managed by users. These processes have a
unique PID or process if assigned to them and we can initiate other processes
within the same terminal from which they are initiated. [7]

6
Fig 3: foreground and background processes

We activate foreground process by exceuting the sleep command. Contrarily, adding


‘&’ at last of a foreground command makes it a background process. In the above
example: “sleep 50” is a foreground process while “sleep 100 &” is a background
process. [8]

4.2 Linux Scheduling:


Scheduling of processes is one of the most important aspects or roles of any
operating system. A Process Scheduler deals with processes scheduling in
Linux. Process Scheduler uses Scheduling Algorithms that helps in deciding the
process to be executed. [9]

LINUX Scheduling Approach is based on time sharing technique: several


processes run in “time multiplexing”. If a currently running process is not
terminated when its time quantum expires, a process switch may take place.
Time sharing relies on timer interrupts and thus transparent to processes.
Every Linux process is always scheduled according to one of the following
scheduling classes:

i) SCHED_FIFO
It is a First-In, First-Out real time process scheduler. When the scheduler
assigns the CPU to the process, it leaves the process description in its
current position in the run queue list. If no other high-priority real-time
process is runnable, the process continues to use the CPU as long as
it wishes, even if real-time processes that have the same priority are

7
runnable.

8
ii) SCHED_RR
It is a Round Robin real-time process. When the scheduler assigns the CPU
to the process, it puts the process description at the end of the run queue
list. This policy ensures a fair assignment of CPU time to all SCHED_RR
real-time processes that have the same priority.

iii) CFS
Completely Fair Scheduler (CFS) is a process scheduler which was merged
into the Linux kernel and is the default scheduler. CFS uses a red-black
tree which is a balanced binary search tree, which means that insertion,
deletion, and look-up are performed in O(logN) where N is the number of
processes.

The time quantum is dynamic and can be changed according to the


number of processes in the system. When a process finishes its time
quantum, CFS picks the next process with the lowest virtual runtime from
the red-black tree. [10]

5. Inter-process Communication
IPC refers to a mechanism, where the OS allow various processes to communicate
with each other. This involves synchronizing their actions and managing shared
data. [11]

Linux provides several mechanisms for inter-process communication (IPC), such as


pipes, signals, and sockets. IPC allows processes to communicate with each other
and exchange data. Linux also supports the use of shared memory and message
queues for IPC.

For inter-process communication LINUX has three major components:

i) Module Management
For new modules, this is done at two levels (management of kernel
referenced symbols and management of code in kernel memory). The
LINUX kernel maintains a symbol table and symbols defined here can be
exported explicitly. The module management system also defines all the
9
required communication interfaces for newly inserted module. With this
done, process can request the services from this module.

ii) Driver Registration


Usually, the registration of drivers is maintained in a registration table of
the module. The registration of drivers contains the following:

 Driver context identification as a bulk device or network driver


 File system context to store files in LINUX virtual file system or
network file system like NFS
 Network protocols and packet filtering rules
 File format for executable and other files

iii) Conflict Resolution


The PC hardware configuration is supported by a large number of chip set
configurations and with a large range of drivers for SCSI devices, video
display devices and adapters, network cards. This results in the situation
where we have module device drivers which vary over a very wide range
of capabilities and options. This requires a conflict resolution mechanism
to resolve access in a variety of conflicting concurrent accesses. The
conflict resolution mechanism helps in preventing modules from having
an access conflict. [12]

6. Memory Management Approaches


The subsystem of Linux memory management is responsible to manage the memory
inside the system. It contains the implementation of demand paging and virtual
memory. Linux memory management subsystem is a complicated system with
several configurable settings. [13]

Linux uses virtual memory management to manage memory. The operating system
divides memory into pages and allocates memory to processes as needed. Linux also
supports demand paging, which allows the operating system to load pages into
memory only when they are needed. This reduces the amount of physical memory
required to run the operating system and applications. [14]

10
Following are the two major components of memory management in Linux:

i) Page Management
Pages are usually of a size which is a power of 2. Linux allocates a group of
pages using a buddy system. “Page allocator” software is responsible for
both allocation, as well as freeing the memory. The basic memory
allocator uses a buddy heap which allocates contiguous are of size 2ˆn >
the required memory with minimum n obtained by successive generation
of “buddies” of equal size.

ii) Virtual Memory Management


Linux supports virtual memory that is using a disk as an extension of RAM
so that the effective size of usable memory grows correspondingly. The
kernel will write the content of a currently unused block of memory to the
hard disk so that the memory can be used for another purpose. When the
original contents are needed again, they are read back into memory.
Reading and writing the hard disk is slower than using real memory, so
programs don’t run as fast it should. The part of hard disk that is used as
virtual memory is called swap space. [14]

7. File System Management Approaches


A file system is a way to organize files and directories on storage devices such as
hard disks, SSDs or flash memory. There are many types of file systems (e.g. FAT,
ext4, btrfs, ntfs) and on one running system we can have multiple instances of the
same file system type in use. [15]

In Linux, most of the operations are performed on files. And to handle these files
Linux has directories also known as folders which are maintained in a tree-like
structure. In Linux, all the files and directories are located in a tree-like structure.
Linux has three types of files:
i) Regular Files
It includes files like text files, images, binary files, etc. Such files can be
created using the touch command.
11
ii) Directories
Windows call these directories as folders. The root directory(/) is the
base of the system. We could create new directories with mkdir
command.

iii) Special Files


It includes physical devices such as printer which is used for I/O
operations. I/O devices are also considered files in this system. [16]
The top-level directories for file management in Linux are:
 / : root directory
 /bin : binary or executable files
 /boot: static files of boot loader
 /dev: files of host specific devices
 /lib: shared libraries and kernel modules
 /etc: system configuration files
 /opt – optional or third-party software
 /media: mount points for removable media
 /mnt: mount points for temporarily mounting a file system
 /root: home directory
 /sbin: system binaries
 /srv: data for services provided by the system
 /tmp – temporary space, typically cleared on reboot
 /usr – User related programs
 /var – log files

8. Device Management Approaches

Device management in an operating system means controlling the Input/Output


devices like disk, microphone, keyboard, printer, magnetic tape, USB ports,
camcorder, scanner, other accessories, and supporting units like supporting units
control channels. A process may require various resources, including main memory,
file access, and access to disk drives, and others. [17]

12
The major components for device management in Linux are:
 udev: The udev (userspace device) subsystem is responsible for managing device
nodes in the /dev directory. It creates, removes, and manages device nodes based
on rules defined in configuration files.
 Device files: In Linux, devices are represented as files in the /dev directory. Each
device has a corresponding device file that applications use to interact with the device.
 lsblk and fdisk: The lsblk command lists information about block devices
(e.g., hard drives, SSDs) attached to the system, including their names, sizes, and
mount points. Similarly, the fdisk utility allows you to create, modify, and delete
partitions on storage devices.
 ifconfig and ip: The ifconfig command (deprecated) and ip command are
used to configure and manage network interfaces. They allow you to assign
IP addresses, set up routing, configure network parameters, and manage network
devices.

 Network Manager: Network Manager is a service that provides a high-level


interface for network configuration and connection management. It handles the
configuration of network interfaces, including wired, wireless, and mobile
broadband devices.

9. Summary
In conclusion, Linux is an open-source operating system that has grown into a
widely used and influential platform over the years. Its unique features, including its
open-source nature, compatibility, and security, have contributed to its success and
popularity among individuals, businesses, and organizations.

Overall, Linux continues to be an innovative and versatile operating system, offering


numerous benefits and opportunities for its users, and its impact on the world of
technology is likely to continue to grow in the years to come.

13
10. References
[1] https://www.javatpoint.com/what-is-linux
[2] https://www.geeksforgeeks.org/introduction-to-linux-operating-system/
[3] https://en.wikipedia.org/wiki/Linux
[4] https://en.wikipedia.org/wiki/History_of_Linux
[5] https://eng.libretexts.org/Bookshelves/Computer_Science/Operating_Systems/
Linux_-_The_Penguin_Marches_On_(McClanahan)/06%3A_Kernel_Module_Management/
2.04%3A_Kernel_Modules#:~:text=and%20remediate%20accordingly.-,Linux%20Kernel
%20Modules,as%20built%2Din%20or%20loadable.

[6] "Linux Kernel Development" by Robert Love (3rd Edition, 2010)


[7] https://www.geeksforgeeks.org/introduction-of-process-management/
[8] https://bytexd.com/working-with-foreground-and-background-processes-in-linux/
[9] https://www.scaler.com/topics/operating-system/process-scheduling/
[10] “Operating System Concepts”: Abraham Silberschatz, Peter Baer Galvin and Greg
Gagne, John Wiley & Sons Publication, Tenth edition, 2018.
[11] https://www.tutorialspoint.com/inter_process_communication/
index.htm#:~:text=Inter%20Process%20Communication%20(IPC)
%20refers,actions%20and%20managing%20shared%20data.

[12] https://os.itec.kit.edu/downloads/sysarch27-linux.pdf

[13] https://www.javatpoint.com/linux-memory- management#:~:text=The


%20subsystem%20of%20Linux%20memory,programs%20and
%20kernel%20internal%20structures.
[14] https://www.javatpoint.com/linux-memory-management
[15] https://linux-kernel-labs.github.io/refs/heads/master/lectures/fs.html
[16] https://www.geeksforgeeks.org/file-management-in-linux/
[17] https://www.javatpoint.com/device-management-in-operating-system

14

You might also like