0% found this document useful (0 votes)
41 views

Case Study 25

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

Case Study 25

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

Case study based on UNIX

operating system

1.Introduction

UNIX is an innovative or ground breaking operating system which was developed


in the 1970s by Ken Thompson, Dennis Ritchie, and many others at AT&T
Laboratories. It is like a backbone for many modern operating systems like Ubuntu,
Solaris, Kali Linux, Arch Linux, and also POSIX. Originally, It was designed for
developers only, UNIX played a most important role in the development and creation
of the software and computing environments. Its distribution to government and
academic institutions led to its widespread adoption across various types of hardware
components. The core part of the UNIX system lies in its base Kernel, which is
integral to its architecture, structure, and key functionality making it the heart of the
operating system.

For those preparing for exams like GATE , a thorough understanding of operating
systems, including Unix, is essential. Our GATE course provides an in-depth
exploration of Unix, covering its history, structure, and key concepts that are crucial
for the exam

Page 1 of 13
The basic design philosophy of UNIX is to provide simple, powerful tools that can
be combined to perform complex tasks. It features a command line interface that
allows users to interact with the system through a series of commands, rather than
through a graphical user interface (GUI).

Types of UNIX
There are many different versions of UNIX, although they share
common similarities. The most popular varieties of UNIX are Sun
Solaris, GNU/Linux, and MacOS X Here in the School, we use Solaris
on our servers and workstations, and Fedora Core Linux on the servers
and desktop PCs.

History of UNIX

1969: Ken Thompson, Dennis Ritchie started working on a


multiuser OS on PDP-7,Bell Labs.

1970: OS named as UNIX

Page 2 of 13
1973: OS rewritten in C

1975: First Version of Berkeley Software Distribution (BSD)

1982: AT&T announced UNIX System III, first public release.

1983: AT&T announced UNIX System V, the first supported release.


Installed base45,000.

1984: Berkeley releases 4.2BSD, includes TCP/IP. X/Open formed

1984: System V Release 2 introduced. 1, 00,000 installations


worldwide.

1986: 4.3BSD released, including internet name server. Installed


base 2, 50,000.

1987: System V Release 3 introduced. Around 7, 50,000


installations.

1988: Open Software Foundation formed.

1989: System V Release 4 ships unifying System V, BSD . 1.2


million installations,its varied support for graphic cards.

Page 3 of 13
Some of the Key Features of UNIX

1. Multiuser support: UNIX allows multiple users to simultaneously access


the same system and share resources.

2. Multitasking: UNIX is capable of running multiple processes at the same


time.

3. Shell scripting: UNIX provides a powerful scripting language that allows


users to automate tasks.

4. Security: UNIX has a robust security model that includes file permissions,
user accounts, and network security features.

5. Portability: UNIX can run on a wide variety of hardware platforms, from


small embedded systems to large mainframe computers.

6. Communication: UNIX supports communication methods using the write


command, mail command, etc.

7. Process Tracking: UNIX maintains a record of the jobs that the user
creates. This function improves system performance by monitoring CPU

Page 4 of 13
usage. It also allows you to keep track of how much disk space each user
uses, and the use that information to regulate disk space.
8. Multiuser support: UNIX allows multiple users to simultaneously access
the same system and share resources.
9. Multitasking: UNIX is capable of running multiple processes at the same
time.
10. Shell scripting: UNIX provides a powerful scripting language that allows
users to automate tasks.
11. Security: UNIX has a robust security model that includes file permissions,
user accounts, and network security features.
12. Portability: UNIX can run on a wide variety of hardware platforms, from
small embedded systems to large mainframe computers.
13. Communication: UNIX supports communication methods using the write
command, mail command, etc.
14. Process Tracking: UNIX maintains a record of the jobs that the user
creates. This function improves system performance by monitoring CPU
usage. It also allows you to keep track of how much disk space each user
uses, and the use that information to regulate disk space.

Today, UNIX is widely used in enterprise-level computing, scientific research, and


web servers. Many modern operating systems, including Linux and macOS, are based
on UNIX or its variants.

Page 5 of 13
System structure

Figure – System Structure


• Layer-1: Hardware: It consists of all hardware related information.
• Layer-2: Kernel: This is the core of the Operating System. It is a software
that acts as the interface between the hardware and the software. Most of
the tasks like memory management, file management, network
management, process management, etc., are done by the kernel.
• Layer-3: Shell commands: This is the interface between the user and the
kernel. Shell is the utility that processes your requests. When you type in a
command at the terminal, the shell interprets the command and calls the
program that you want. There are various commands like cp, mv, cat, grep,
id, wc, nroff , a.out and more.
• Layer-4: Application Layer: It is the outermost layer that executes the
given external applications.

Page 6 of 13
Kernel and its Block Diagram

This diagram shows three levels: user, kernel, and hardware.

• The system call and library interface represent the border between user
programs and the kernel. System calls look like ordinary function calls in
C programs. Assembly language programs may invoke system calls
directly without a system call library. The libraries are linked with the
programs at compile time.

• The set of system calls into those that interact with the ile subsystem and
some system calls interact with the process control subsystem. The ile

Page 7 of 13
subsystem manages iles, allocating ile space, administering free space,
controlling access to iles, and retrieving data for users.

• Processes interact with the ile subsystem via a speci ic set of system calls,
such as open (to open a ile for reading or writing), close, read, write, stat
(query the attributes of a ile), chown (change the record of who owns the
ile), and chmod (change the access permissions of a ile).
• The ile subsystem accesses ile data using a buffering mechanism that
regulates data low between the kernel and secondary storage devices. The
buffering mechanism interacts with block I/O device drivers to initiate
data transfer to and from the kernel.

• Device drivers are the kernel modules that control the operator of
peripheral devices. The ile subsystem also interacts directly with “raw”
I/O device drivers without the intervention of the buffering mechanism.
Finally, the hardware control is responsible for handling interrupts and for
communicating with the machine. Devices such as disks or terminals may
interrupt the CPU while a process is executing. If so, the kernel may
resume execution of the interrupted process after servicing the interrupt.

• Interrupts are not serviced by special processes but by special functions in


the kernel, called in the context of the currently running process.

Difference Between Unix and Linux


Linux is essentially a clone of Unix. But, basic differences are shown below:

Linux Unix

The source code of Linux is freely The source code of Unix is not freely
available to its users available general public

It has graphical user interface along with It only has command line interface
command line interface

Linux OS is portable, flexible, and can be Unix OS is not portable


executed in different hard drives

Page 8 of 13
Linux Unix

Different versions of Linux OS are Ubuntu, Different version of Unix are AIS, HP-UX,
Linux Mint, RedHat Enterprise Linux, BSD, Iris, etc.
Solaris, etc.

The file systems supported by Linux are as The file systems supported by Unix are as
follows: xfs, ramfs, vfat, cramfsm, ext3, follows: zfs, js, hfx, gps, xfs, vxfs
ext4, ext2, ext1, ufs, autofs, devpts, n s

Linux is an open-source opera ng system Unix is a proprietary opera ng system that


that was first released in 1991 by Linus was originally developed by AT&T Bell
Torvalds. Labs in the mid 1960s.

The Linux kernel is monolithic, meaning The Unix kernel is modular, meaning that it
that all of its services are provided by a is made up of a collec on of independent
single kernel. modules that can be loaded and unloaded
dynamically.

Linux has much broader hardware support Unix was originally designed to run on
than Unix. large, expensive mainframe computers,
while Linux was designed to run on
commodity hardware like PCs and servers.

User Interface of Linux is Graphical or User Interface of unix is text-based.


text-based.

Command Line Interface of Linux is Bash, Command Line Interface of unix is Bourne,
Zsh, Tcsh. Korn, C, Zsh.

Page 9 of 13
Advantages of UNIX
1. Stability: UNIX is known for its stability and reliability. It can run for long
periods of time without requiring a reboot, which makes it ideal for critical
systems that need to run continuously.

2. Security: UNIX has a robust security model that includes ile permissions,
user accounts, and network security features. This makes it a popular
choice for systems that require high levels of security.

3. Scalability: UNIX can be scaled up to handle large workloads and can be


used on a variety of hardware platforms.

4. Flexibility: UNIX is highly customizable and can be con igured to suit a


wide range of needs. It can be used for everything from simple desktop
systems to complex server environments.

5. Command-line interface: UNIX’s command-line interface allows for


powerful and ef icient interaction with the system.

Disadvantages of UNIX
1. Complexity: UNIX can be complex and dif icult to learn for users who are
used to graphical user interfaces (GUIs).

2. Cost: Some UNIX systems can be expensive, especially when compared


to open-source alternatives like Linux.

3. Lack of standardization: There are many different versions of UNIX,


which can make it dif icult to ensure compatibility between different
systems.

Page 10 of 13
4. Limited software availability: Some specialized software may not be
available for UNIX systems.

5. Steep learning curve: UNIX requires a certain level of technical


knowledge and expertise, which can make it challenging for novice users.

Example of UNIX Command


# List files in a directory with detailed information ls -l
This command shows a detailed list of files and directories, including permissions of
the logged in user, number of links, owner name, owner group, file size, and
timestamp thoroghly.

Initializing a process
A process can be run in two ways:
Method 1: Foreground Process : Every process when started runs in foreground
by default, receives input from the keyboard, and sends output to the screen.
When issuing pwd command
$ ls pwd
Output:
$ /home/geeksforgeeks/root
When a command/process is running in the foreground and is taking a lot of time, no
other processes can be run or started because the prompt would not be available until
the program finishes processing and comes out.

Method 2: Background Process: It runs in the background without keyboard input


and waits till keyboard input is required. Thus, other processes can be done in
parallel with the process running in the background since they do not have to wait
for the previous process to be completed.
Adding & along with the command starts it as a background process

$ pwd &
Since pwd does not want any input from the keyboard, it goes to the stop

Page 11 of 13
state until moved to the foreground and given any data input. Thus, on pressing
Enter:
Output:
[1] + Done pwd
$
That first line contains information about the background process – the job number
and the process ID. It tells you that the ls command background process finishes
successfully. The second is a prompt for another command.

Processes in Linux/Unix
A program/command when executed, a special instance is provided by the system to
the process. This instance consists of all the services/resources that may be utilized
by the process under execution.
• Whenever a command is issued in Unix/Linux, it creates/starts a new
process. For example, pwd when issued which is used to list the current
directory location the user is in, a process starts.
• Through a 5 digit ID number Unix/Linux keeps an account of the
processes, this number is called process ID or PID. Each process in the
system has a unique PID.
• Used up pid’s can be used in again for a newer process since all the
possible combinations are used.
At any point of time, no two processes with the same pid exist in the system because
it is the pid that Unix uses to track each process.

Page 12 of 13
Conclusion
The UNIX operating system continues to be a milestone in the today’s changing world
of computing due it robustness, security, and flexibility. Its influence is seen in many
and various operating systems, and its principles remain relevant as well as robust for
understanding how an opereating systems works under the hood. By learning the
UNIX , users can gain a valuable skill set including network security, cyber security ,
various file systems not only NTFS but also xfs, btrfs, ext4 etc. which is going to help
user in many it Environment including Docker, kubernetes etc.

Page 13 of 13

You might also like