Operating System and administration answer
Operating System and administration answer
Dual-mode operation:
User process
b) CLI GUI
A CLI is a Command Line Interface. A GUI is a Graphical user interface.
It is a visual interface that uses icons,
It is a text based interface that uses keyboard buttons, windows and other graphical
Commands to interact with the OS. elements to interact with the OS.
They are more efficient and faster than GUI’s They are less efficient than CLI’s and
because they direct all processing power to the task are not as powerful for complex tasks.
at hand.
They are also better for complex tasks, like advance GUI’s are easier to use than CLI’s and
d system settings and administrative tasks. Are self-explanatory.
CLI’s can be difficult to learn and prone to errors if
the user enters incorrect commands.
Silent installation:
An installation that does not display messages or windows during its progress.
"Silent installation" is NOT the same as "unattended installation". [All silent installations are
unattended but not all unattended installations are silent.]
Unattended installation:
An installation that is performed without user interaction during its progress or with no user
present at all.
Headless installation:
In attended forms of headless installation, another machine connects to the target machine (for
example, via a local area network) and takes over the display output.
An installation process that runs on a preset time or when a predefined condition meet the
requirements, as opposed to an installation process that starts explicitly on a user's command.
An operating system may automatically install a device driver for a device that the user
connects.
Clean installation:
A clean installation is one that is done in the absence of any interfering elements such as old
versions of the computer program being installed or leftovers from a previous installation.
The clean installation of an operating system is an installation in which the target disk
partition is erased before installation.
Network installation:
This may simply be a copy of the original media but software publishers which offer site licenses
for institutional customers may provide a version intended for installation over a network.
3. GRUB
GRUB stands for Grand Unified Bootloader.
If you have multiple kernel images installed on your system, you can choose which one
to be executed.
GRUB displays a splash screen, waits for few seconds, if you don’t enter anything, it
loads the default kernel image as specified in the grub configuration file.
So, in simple terms GRUB just loads and executes Kernel and initrd images.
4. Kernel
Mounts the root file system as specified in the “root=” in grub.conf
Kernel executes the /sbin/init program
Since init was the 1st program to be executed by Linux Kernel, it has the process id (PID)
of 1. Do a ‘ps -ef | grep init’ and check the pid.
initrd stands for Initial RAM Disk.
5. Init
Looks at the /etc/inittab file to decide the Linux run level.
Following are the available run levels
0 – halt
1 – Single user mode
2 – Multiuser, without NFS
3 – Full multiuser mode
4 – unused
5 – X11
6 – reboot
6. Runlevel programs
When the Linux system is booting up, you might see various services getting started. For
example, it might say “starting sendmail …. OK”. Those are the runlevel programs,
executed from the run level directory as defined by your run level.
Programs starts with S are used during startup. S for startup.
Programs starts with K are used during shutdown. K for kill.
SECTION -2
1. Name: File name is the name given to the file. A name is usually a string of characters.
2. Identifier: Identifier is a unique number for a file. It identifies files within the file system.
It is not readable to us, unlike file names.
3. Type: Type is another attribute of a file which specifies the type of file such as archive
file (.zip), source code file (.c, .java), .docx file, .txt file, etc.
4. Location: Specifies the location of the file on the device (The directory path). This
attribute is a pointer to a device.
5. Size: Specifies the current size of the file (in Kb, Mb, Gb, etc.) and possibly the maximum
allowed size of the file.
6. Protection: Specifies information about Access control (Permissions about Who can read,
edit, write, and execute the file.) It provides security to sensitive and private information.
7. Time, date, and user identification: This information tells us about the date and time
on which the file was created, last modified, created and modified by which user, etc.
Pointer: It is a stack pointer that is required to be saved when the process is switched
from one state to another to retain the current position of the process.
Process state: It stores the respective state of the process.
Process number: Every process is assigned a unique id known as process ID or PID
which stores the process identifier.
Program counter: Program Counter stores the counter, which contains the address of
the next instruction that is to be executed for the process.
Register: Registers in the PCB, it is a data structure. When a processes is running and
it’s time slice expires, the current value of process specific registers would be stored in
the PCB and the process would be swapped out. When the process is scheduled to be
run, the register values is read from the PCB and written to the CPU registers. This is
the main purpose of the registers in the PCB.
Memory limits: This field contains the information about memory
management system used by the operating system. This may include page
tables, segment tables, etc.
List of Open files: This information includes the list of files opened for a
process.
4.a) Pathname is a sequence of symbols and filenames which indicates the location of our file
in the hierarchical file system.
Pathnames are classified into Absolute path name and Relative path name.
1.Absolute path name
An absolute pathname is a path that describes the location of a file or folder from the root
directory(/).
Ex: usr/cse/myfile.txt
2.Relative pathname
A relative pathname is a path that describes the location of a file or folder in relative to the
current/present working directory(pwd).
Ex: Assuming that we are already present in cse directory then the relative path for the same
can be written as simple myfile.txt.
b) Deadlock in OS refers to a situation where more than one or two processes or threads are
not able to proceed because each is waiting for the other to release a resource. In other words,
it's a state where a group of processes become stuck in a way that they can't make any progress.
There are few methods for handling deadlocks in an operating system include,
Deadlock prevention:
A set of methods that ensure that at least one of the conditions for deadlock cannot occur. Ex
mutual exclusion, hold and wait, and no preemption are all deadlock prevention techniques.
Deadlock avoidance:
A technique that uses a safety algorithm and resource allocation graph to ensure the system is
always in a safe state. Ex the banker’s algorithm is a deadlock avoidance technique.
Deadlock detection:
A technique that uses a resource allocation graph(RAG) to detect deadlocks. A RAG is a visual
representation of the processes holding resources and their current allocation state.
SECTION-3
5.a)
Aspect Process Thread
Shares memory space with
Has its own separate
Memory Space other threads within the same
memory space.
process.
Higher overhead due to
Lower overhead, more efficient
Overhead separate memory and
in resource usage.
resource allocation.
Depends on the process;
Execution Operates independently. multiple threads can run in
parallel within one process.
Communicates through IPC Communicates directly through
Communication
mechanisms. shared memory.
b) CPU SCHEDULERS:
First come, first served (FCFS)
A simple algorithm that executes processes in the order they arrive. However, it can cause the
“convoy effect” where shorter processes wait behind longer ones.
Priority scheduling
Assigns a priority to each process, and the process with highest priority gets the CPU first.
Priorities can be based on factors like the process’s importance, how long it’s been waiting, or
its resource requirements.
6) From start to finish, the process goes through a number of stages. A minimum of five states
is required. Even though the process could be in one of these states during execution, the
names of the states are not standarized. Throughout its life cycle, each process goes through
various stages. They are:
New State
When a program in secondary memory is started for execution, the process is said to be in a
new state.
Ready State
After being loaded into the main memory and ready for execution, a process transitions from a
new to a ready state. The process will now be in the ready state, waiting for the processor to
execute it. Many processes may be in the ready stage in a multiprogramming environment.
Run State
After being allotted the CPU for execution, a process passes from the ready state to the run
state.
Terminate State
When a process’s execution is finished, it goes from the run state to the terminate state. The
operating system deletes the process control box (or PCB) after it enters the terminate state.
Block or Wait State
If a process requires an Input/Output operation or a blocked resource during execution, it
changes from run to block or the wait state.
The process advances to the ready state after the I/O operation is completed or the resource
becomes available.
Suspend Ready State
If a process with a higher priority needs to be executed while the main memory is full, the
process goes from ready to suspend ready state. Moving a lower-priority process from the
ready state to the suspend ready state frees up space in the ready state for a higher-priority
process.
Until the main memory becomes available, the process stays in the suspend-ready state. The
process is brought to its ready state when the main memory becomes accessible.
Suspend Wait State
If a process with a higher priority needs to be executed while the main memory is full, the
process goes from the wait state to the suspend wait state. Moving a lower-priority process
from the wait state to the suspend wait state frees up space in the ready state for a higher-
priority process.
The process gets moved to the suspend-ready state once the resource becomes accessible. The
process is shifted to the ready state once the main memory is available.