Ready

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

1)Describe the services of operating system with neat sketch.?

One set of operating-system services provides functions that are helpful to the user:

User interface – Almost all operating systems have a user interface (UI). This interface can
take several forms.

Program execution – The system must be able to load a program into memory and to run
that program, end execution, either normally or abnormally (indicating error)

I/O operations - A running program may require I/O, which may involve a file or an I/O
device. For efficiency and protection, users usually cannot control I/O devices directly.

File-system manipulation - The file system is of particular interest. Programs need to read
and write files and directories, create and delete them, search them, list file Information,
permission management.

Communications – Processes may exchange information, on the same computer or


between computers over a network.

Error detection – OS needs to be constantly aware of possible errors

May occur in the CPU and memory hardware, in I/O devices, in user program

Resource allocation – When multiple users or multiple jobs running concurrently,


resources must be allocated to each of them

Accounting – To keep track of which users use how much and what kinds of computer
resources

Protection and security – Protection: involves ensuring that all access to system
resources is controlled

Security : of the system from outsiders requires user authentication, extends to defending
external I/O devices from invalid access attempts

Figure: A view of operating system services.


2)Discuss operating system interfaces.

One provides a command-line interface, or command interpreter, that allows users to


directly enter commands to be performed by the operating system.

Command Interpreters:

Some operating systems include the command interpreter in the kernel. Others, such as
Windows and UNIX.

Many of the commands given at this level manipulate files: create, delete, list, print, copy,
execute, and so on. The MS-DOS and UNIX shells operate in this way.

These commands can be implemented in two general ways.

In one approach, the command interpreter itself contains the code to execute the
command.

An alternative approach—used by UNIX, among other operating systems —implements


most commands through system programs. would search for a file called rm, load the file
into memory, and execute it with the parameter file.txt.

Graphical User Interfaces:A second strategy for interfacing with the operating system is
through a user friendly graphical user interface, or GUI. Here, rather than entering
commands directly via a command-line interface, users employ a mouse-based window
and- menu system characterized by a desktop metaphor.
3)Compare Simple, Layered and Kernel approaches of operating system structure

Simple Structure:In a simple structure, the operating system is designed as a single,


monolithic program.

All operating system functionalities are tightly integrated into a single executable.

There is minimal abstraction and separation of concerns, making it easy to implement and
understand.

Changes or updates to one part of the OS may require modifications to the entire system.

Examples include early operating systems like MS-DOS and early versions of Unix.

Layered Structure:In a layered structure, the operating system is divided into layers, with
each layer responsible for a specific set of functionalities.

Layers are organized hierarchically, with higher layers relying on services provided by lower
layers.

This approach promotes modularity and separation of concerns, making the system more
maintainable and extensible.

Communication between layers is typically through well-defined interfaces.

Examples include the THE and V-system operating systems.

Microkernel Structure (Kernel Approach):In a microkernel structure, the operating


system is divided into a small, minimalistic kernel and separate user-space servers or
processes.

The kernel provides basic functionalities such as process scheduling, memory


management, and inter-process communication (IPC).

Microkernel architectures prioritize flexibility, security, and fault tolerance.

Communication between user-space servers and the kernel typically occurs through
message passing

Examples include MINIX, QNX, and modern versions of macOS (XNU kernel).

4)Discuss various categories of system calls.?

System calls can be grouped roughly into six major categories:

Process Control:These system calls manage processes, including creating, terminating,


and controlling their execution.
Examples include fork(), exec(), wait(), exit(), and getpid().

File Manipulate:These system calls manipulate files and directories, including opening,
reading from, writing to, and closing files.

Examples include open(), read(), write(), close(), and stat().

Device manipulate:These system calls control devices such as disks, terminals, printers,
and network interfaces.

Examples include read(), write(), ioctl(), and lseek() for device I/O operations.

Information Maintenance:These system calls retrieve or manipulate system information,


such as time, date, user IDs, and process IDs.

Examples include time(), gettimeofday(), getpid(), and getuid().

Communication:These system calls facilitate communication between processes, both


within the same system and across networked systems.

Examples include socket(), bind(), connect(), send(), and receive() for networking
operations.

Protection:Protection provides a mechanism for controlling access to the resources


provided by a computer system.

Example: allow_user() and deny_user() system calls specify whether particular users
can—or cannot—be allowed access to certain resources.

5)Describe the computer system organization with neat sketch

Ans) Computer-system organisation:

i)One or more CPUs, device controllers connect through common bus providing access to
shared memory

ii)Concurrent execution of CPUs and devices competing for memory cycles

• The I/O devices and the CPU both execute concurrently. Some of the processes are
scheduled for the CPU and at the same time, some are undergoing input/output
operations.
• There are multiple device controllers, each in charge of a particular device such as
keyboard, mouse, printer etc.
• There is buffer available for each of the devices. The input and output data can be
stored in these buffers
6)Discuss abstract view of the operating system with neat sketch.

* A program that acts as intermediate between a user of computer and computer hardware

* Executive programs and make solving user problems easier computer system can be
divided into four categories

1) Hardware: it provides basic computing source that is CPU memory input output devices

2) operating system: it controls and coordinates user of hardware among various


application and users

3) Application Programs: defence the ways in which the system resource are used to solve
the computing problems of the user

4) Users: That is people machines and other computers


7)Illustrate the concept of virtualization with neat diagram

Virtualization is the process of creating a virtual (rather than actual) version of something,
including virtual computer hardware platforms, storage devices, and computer network
resources. Here’s a simplified diagram illustrating the concept of virtualization:

Virtual CPU: Represents a virtualized processor.

It allows multiple virtual machines (VMs) to share physical CPU resources efficiently.

Each VM perceives that it has its own CPU, isolated from other VMs.

Virtual Memory:Provides each virtual machine with its own virtual address space.

Allows the operating system and applications running within a VM to access memory
without knowing the physical details of the underlying memory architecture.

Enables memory isolation and protection between virtual machines.

Virtual Disk Drives:Emulates physical disk drives within a virtualized environment.

Virtual disks can be dynamically created, resized, and attached to virtual machines as
needed.

Enables storage virtualization, allowing multiple VMs to share physical storage resources
efficiently.
Virtual Network:Simulates network interfaces and network connections within a
virtualized environment.

Allows virtual machines to communicate with each other and with external networks.

8) Describe various system programs and role of system boot.

Ans) System Programming: can be defined as the act of building Systems Software using
System Programming Languages. According to Computer Hierarchy, Hardware comes first
then is Operating System, System Programs, and finally Application Programs

1)File Management :A file is a collection of specific information stored in the memory of a


computer system.

2) Command Line Interface(CLI’s) : CLIs is the essential tool for user . It provide user
facility to write commands directly to the system for performing any operation

3) Device drivers :Device drivers work as a simple translator for OS and devices

4) Status Information :Information like date, time amount of available memory, or disk
space is asked by some users

5) File Modification : This is used for modifying the content of files. Files stored on disks or
other storage devices, we use different types of editors

6) Programming-Language : For common programming languages, we use Compilers,


Assemblers, Debuggers, and interpreters which are already provided to users. It provides
all support to users.

7)Program Loading and Execution : When the program is ready after Assembling and
compilation, it must be loaded into memory for execution.

8) Communications :connections among processes, users, and computer systems are


provided by programs.

9) Summarize the various types of System Calls supported by OS.

Ans)

Types of System Calls:

Services provided by an OS are typically related to any kind of operation that a user
program can perform like creation, termination, forking, moving, communication etc.

1) File System Operations


These system calls are made while working with files in OS, File manipulation operations
such as creation, deletion, termination etc.

i)open(): Opens a file for reading or writing.

ii) read(): Reads data from a file

iii) write(): Writes data to a file

iv) close(): Closes a previously opened file.

v)seek(): Moves the file pointer within a file

2. Process Control:

These types of system calls deal with process creation, process termination, process
allocation, deallocation etc.

Fork(): Creates a new process (child) by duplicating the current process (parent).

Exec(): Loads and runs a new program in the current process and replaces the current
process with a new process.

2) Memory Management:

These types of system calls deals with memory allocation, deallocation & dynamically
changing the size of a memory allocated to a process

i)brk(): Changes the data segment size for a process in HEAP Memory.

ii) sbrk(): This call is also for memory management in heap, it also takes an argument as an
integer (+ve or -ve) specifying whether to increase or decrease the size respectively

4. Interprocess Communication (IPC):

When two or more process are required to communicate, then various IPC mechanism are
used by the OS which involves making numerous system calls

i)pipe(): Creates a unidirectional communication channel between processes.

ii) socket(): Creates a network socket for communication.

5. Device Management:

The device management system calls are used to interact with various peripherial devices
attached to the PC or even the management of the current device.

WriteConsole(): It allows us to write data on console screen.


ReadConsole(): It allows us to read data from console screen

10 Discuss about process states and process control block with neat sketch.

Processes States

New: Newly created proces

Ready: After Creation process it’s moved to ready state.

Run! Currently running process in Cpu

Wait: When a proces requests allow access.

Complete or Temenial: The Proccess completed its execution.

Suspended Ready: when The Ready Que becomed full some. Process are moved to this
state

Suspended Block: when waiting Queve becomes full.

11 Compare and contrast the below schedulers.

Short-term scheduler

Long-term scheduler

Medium-term scheduler

You might also like