OS case study
OS case study
IT
(BSc.CSIT)
Operating System Lab Report
Subject Code: CSC 259
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
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]
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]
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.
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]
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
6
Fig 3: foreground and background processes
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.
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]
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.
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.
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.
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.
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.
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.
[12] https://os.itec.kit.edu/downloads/sysarch27-linux.pdf
14