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

Assignment 1

Uploaded by

percapty14
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

Assignment 1

Uploaded by

percapty14
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Assignment 1

NAME: KISHORE SHANMUGAM

STUDENT NO: 229604630

COURSE:3407 A
ANSWER
Kernel data structures are unique data formats that are used by the operating system's core
element to manage colorful computer functions.

The 3 different types of kernel data structures implemented at the operating system level are,
Singly Linked List
Doubly Linked List
Circular Linked List

Singly Linked List


Each entry, known as a node, in a singly linked list and it is composed of two components: data
and a reference to the node after it in the sequence. Singly linked lists are utilized in operating
systems for various functions, including memory block organization, file structure maintenance,
and process management.
o Each rectangular box represents a node.
o The arrows represent pointers to the next node.
o The first node is the head of the linked list, and its pointer points to the next node.
The last node's pointer points to NULL, indicating the end of the list.

Doubly Linked List


Similar to a singly linked list, a doubly linked list has an extra pointer in each node that points to
both the node before it and the node after it. When elements in an operating system need to be
efficiently traversed both forwards and backwards, like in the case of managing kernel queues or
system resources, doubly linked lists come in handy.
o Each rectangular box represents a node.
o The arrows represent pointers to the previous and next nodes.
o The first node is the head of the linked list, and its previous pointer points to
NULL. Similarly, the last node's next pointer points to NULL.
Circular Linked List
A circular linked list is a linked list type in which the final node creates a circular structure by
pointing back to the initial node. Circular linked lists are used in operating systems to build
circular buffers, manage circular queues, and manage tasks in a round-robin scheduling
mechanism.

o Each box represents a node.


o The arrows represent pointers to the next node.
o Unlike the singly and doubly linked lists, the last node's pointer points back to the
first node, forming a circular structure.

ANSWER
The two different operating modes that a computer's CPU can function in are kernel mode and
user mode.

In kernel mode, the processor has unrestricted access to the computer's hardware and system
resources. This implies that it can carry out sensitive tasks and executing privileged instructions,
such as directly accessing memory or manipulating hardware.
User mode is a restricted state where the processor has limited access to system resources. User
mode is used by user programs, such as interactive apps or software. Programs are unable to
directly carry out privileged activities in this mode, such as accessing hardware or changing
important system settings.
Advantages:
Protection: This describes the controls that limit a process's or user's access to resources that the
operating system has established. The system can limit user-level programs' privileges by having
them execute in separate modes. This keeps them from directly accessing sensitive resources or
interfering with important system functions. For instance, the CPU can access all system
resources in kernel mode, but access is restricted in user mode to avoid unwanted modification.

Security: Protecting the system from both internal and external threats, such as denial-of-service
attacks, worms, viruses, identity theft, and theft of service, is what security is all about. The
operating system builds a defense against these attacks by segregating operations into kernel
mode and user mode. User programs operate in user mode, which limits their access to system
resources and lowers the possibility that hostile actors will take advantage of them. As a
gatekeeper, the kernel enforces security regulations and blocks unauthorized access to vital
system components when it is in kernel mode.

ANSWER
The arrangement and communication between the various components that make up an operating
system is referred to as its structure. It outlines how the many components of the operating
system—such as the file systems, user interface, device drivers, and kernel—are built and
integrated to offer users and applications necessary features and services.

The different operating system structure are,


○ Simple structure – MS-DOS
○ Complex monolith-- UNIX
○ Layered – Microsoft Windows NT
○ Microkernel -Mach

Simple Structure (MS-DOS):


The Microsoft Disk Operating System, or MS-DOS, has a straightforward architecture in which
a single monolithic kernel houses the complete operating system. It depends on direct hardware
resource access and lacks advanced memory protection features.
Contrast
Modern security measures, virtual memory, multitasking, and other advanced capabilities are
absent from MS-DOS when compared to other frameworks like microkernel or layered.

Because of its monolithic architecture, which allows a single component to malfunction to effect
the entire system, MS-DOS may be more prone to failures and security flaws.

Microkernel -Mach
An operating system with a microkernel-based architecture is Mach. Only necessary functions,
like as memory management and process scheduling, are contained in the kernel in a microkernel
architecture; other functions, such as file systems and device drivers, are handled by user-level
processes.

Contrast
user-level servers and the kernel must communicate via inter-process communication (IPC),
microkernel-based systems may experience performance overhead.

In contrast to monolithic approaches, implementing some system functions as user-level


processes may result in complexity and possible performance bottlenecks.

Simple structure – MS-DOS Microkernel -Mach

MS-DOS is renowned for being lightweight Most services in microkernel architectures


and simple, which makes it appropriate for operate outside of kernel space, they offer
older hardware with constrained resources. improved fault isolation and modularity
while also improving system stability and
security.

The tight integration of device drivers and Mach is appropriate for general-purpose
system services into the kernel results in computing settings because it enables
increased performance at the expense of features like virtual memory, inter-process
decreased flexibility and modularity. communication, and multitasking.

ANSWER
Operating system virtualization is similar to house several computers within a single physical
machine. Even though they are all using the same hardware, it deceives each distinct
environment into believing it is operating on a different private computer. It works similarly to
the way we can switch between different apps on our computer or phone, only with operating
systems.
Advantages:

Resource Optimization: We can maximize the utilization of the hardware resources by operating
several virtual machines on a single physical server. We can save money and space by
combining all operating systems onto a single physical server rather than having separate ones
for each one.

Isolation:

Every virtual machine functions separately from the others, so if one crashes or has problems, it
won't have an impact on the others. For the system as a whole, this isolation offers improved
stability and dependability.

Flexibility:
We can run many operating systems on the same hardware thanks to virtualization, which is
helpful for testing, development, and running programs that are limited to specific operating
systems. For instance, we can use a virtual machine to run Windows apps on a macOS system.

Security:
By isolating virtual machines from one another, it is possible to stop one virtual machine from
accessing or influencing the information and operations of another. This improves security and
safeguards private data.

ANSWER:
The "fork" system call is used in Unix and Linux operating systems to start a new process, which
is a distinct instance of the running application. The "child process" is a newly created procedure
that is a precise replica of the "parent process."
When a program calls the "fork" system call, it essentially duplicates itself. Both the parent and
child processes then continue executing from the point where the fork was called. Forking is
commonly used in scenarios where parallel processing or multitasking is needed.
Example:

Consider a chef (our software) operating in a kitchen (our computer). It's like creating a helper
cook (kid process) to aid when the cook forks. This allows collaboration between the primary
cook (parent process) and the assistant cook (child process). For instance, the assistant cook can
prepare dessert while the head chef prepares the main dish. If necessary, they can communicate
and divide work.

Forking is a technique used in computers for many tasks. For example, using the fork() function
in Unix systems is similar to copying oneself. Then, the child process (copy) can perform tasks
that the parent process (original) cannot. For a more intricate illustration, consider an application
that downloads files while playing music. It can manage both at once, without interfering with
each other, by forking: one process for music and another for downloading.

There are several methods in which the parent and child processes can communicate after
forking. They occasionally work alone, much like our chefs in the kitchen. In other situations,
such as when a parent waits for a child to finish schoolwork before letting them go outside to
play, the parent might wait for the youngster to complete the assignment before moving on.

Thus, forking is similar to having a cook and an assistant cook in a kitchen since they split up the
work, support one another, and finish things more quickly. It allows programs to effectively
handle several tasks and make economical use of the computer's resources.

REFERENCES:
Operating System Concepts by Silberschatz, Gagne, Galvin
10th Edition
ISBN- 978-1-118-06333-0
https://www.scaler.com/topics/user-mode-and-kernel-mode/
https://www.geeksforgeeks.org/fork-system-call/
https://www.cs.gordon.edu/courses/cs322/lectures/msdos_vms_unix.html

You might also like