0% found this document useful (0 votes)
2 views7 pages

OSUnit 2

The document outlines the essential services provided by an operating system, including program execution, file management, error detection, and communication. It explains system calls as the interface for user programs to request services from the OS and details various types of system calls, such as process control and device management. Additionally, it discusses user interfaces, including command-line and graphical user interfaces, and describes the booting process of a computer system.

Uploaded by

garahshivraj
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)
2 views7 pages

OSUnit 2

The document outlines the essential services provided by an operating system, including program execution, file management, error detection, and communication. It explains system calls as the interface for user programs to request services from the OS and details various types of system calls, such as process control and device management. Additionally, it discusses user interfaces, including command-line and graphical user interfaces, and describes the booting process of a computer system.

Uploaded by

garahshivraj
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

1

UNIT 2 ----System Structure

Operating System Services:

The operating system provides the programming environment in which a programmer works on a
computer system. The user program requests various resources through the operating system. The
operating system gives several services to utility programmers and users. Applications access these
services through application programming interfaces or system calls. By invoking those interfaces, the
application can request a service from the operating system, pass parameters, and acquire the operation
outcomes.

Following are the services provided by an operating system -

o Program execution
o Control Input/output devices
o Program creation
o Error Detection and Response
o Accounting
o Security and Protection
o File Management
o Communication

Program execution:

To execute a program, several tasks need to be performed. Both the instructions and data must be loaded
into the main memory. In addition, input-output devices and files should be initialized, and other resources
must be prepared. The Operating structures handle these kinds of tasks. The user now no longer should
fear the reminiscence allocation or multitasking or anything.

Control Input/output devices

As there are numerous types of I/O devices within the computer system, and each I/O device calls for its
own precise set of instructions for the operation. The Operating System hides that info with the aid of
presenting a uniform interface. Thus, it is convenient for programmers to access such devices easily.

Program Creation

The Operating system offers the structures and tools, including editors and debuggers, to help the
programmer create, modify, and debugging programs.
2

Error Detection and Response

An Error in a device may also cause malfunctioning of the entire device. These include hardware and
software errors such as device failure, memory error, division by zero, attempts to access forbidden
memory locations, etc. To avoid error, the operating system monitors the system for detecting errors and
takes suitable action with at least impact on running applications.

While working with computers, errors may occur quite often. Errors may occur in the:

o Input/ Output devices: For example, connection failure in the network, lack of paper in the printer,
etc.
o User program: For example: attempt to access illegal memory locations, divide by zero, use too
much CPU time, etc.
o Memory hardware: For example, Memory error, the memory becomes full, etc.

To handle these errors and other types of possible errors, the operating system takes appropriate action
and generates messages to ensure correct and consistent computing.

Accounting

An Operating device collects utilization records for numerous assets and tracks the overall performance
parameters and responsive time to enhance overall performance. These personal records are beneficial
for additional upgrades and tuning the device to enhance overall performance.

Security and Protection

Operating device affords safety to the statistics and packages of a person and protects any interference
from unauthorized users. The safety feature counters threats, which are published via way of individuals
out of doors the manage of the running device.

File management

Computers keep data and information on secondary storage devices like magnetic tape, magnetic disk,
optical disk, etc. Each storage media has its capabilities like speed, capacity, data transfer rate, and data
access methods.

For file management, the operating system must know the types of different files and the characteristics of
different storage devices. It has to offer the proportion and safety mechanism of documents additionally.

Communication

The operating system manages the exchange of data and programs among different computers
connected over a network. This communication is accomplished using message passing and shared
memory.
3

System calls:

system call provide an interface to the service made available by an operating system.

A system call is a way for a user program to interface with the operating system. The program requests
several services, and the OS responds by invoking a series of system calls to satisfy the request. A system
call can be written in assembly language or a high-level language like C or Pascal.

OR

A system call is a method of interacting with the operating system via programs. A system call is a request
from computer software to an operating system's kernel.

- There are various situations where you must require system calls in the operating system. Following
of the situations are as follows:

1. It is must require when a file system wants to create or delete a file.


2. Network connections require the system calls to sending and receiving data packets.
3. If you want to read or write a file, you need to system calls.
4. If you want to access hardware devices, including a printer, scanner, you need a system call.
5. System calls are used to create and manage new processes.

The Applications run in an area of memory known as user space. A system call connects to the
operating system's kernel, which executes in kernel space. When an application creates a system call, it
must first obtain permission from the kernel. It achieves this using an interrupt request, which pauses the
current process and transfers control to the kernel.

If the request is permitted, the kernel performs the requested action, like creating or deleting a file. As
input, the application receives the kernel's output. The application resumes the procedure after the input is
received. When the operation is finished, the kernel returns the results to the application and then moves
data from kernel space to user space in memory.

A simple system call may take few nanoseconds to provide the result, like retrieving the system date
and time. A more complicated system call, such as connecting to a network device, may take a few
seconds. Most operating systems launch a distinct kernel thread for each system call to avoid bottlenecks.
Modern operating systems are multi-threaded, which means they can handle various system calls at the
same time.
4

Types of System Calls


There are commonly five types of system calls. These are as follows

1. Process Control
2. File Management
3. Device Management
4. Information Maintenance
5. Communication

[Link] Control

Process control is the system call that is used to direct the processes. Some process control examples
include creating, load, abort, end, execute, process, terminate the process, etc.

Ex:

CreateProcess()
ExitProcess()
WaitForSingleObject()

[Link] Management

File management is a system call that is used to handle the files. Some file management examples include
creating files, delete files, open, close, read, write, etc.

Ex:

CreateFile()
ReadFile()
WriteFile()
CloseHandle()

[Link] Management

Device management is a system call that is used to deal with devices. Some examples of device
management include read, device, write, get device attributes, release device, etc.

Ex:

SetConsoleMode()
ReadConsole()
WriteConsole()
5

[Link] Maintenance
Information maintenance is a system call that is used to maintain information. There are some examples
of information maintenance, including getting system data, set time or date, get time or date, set system
data, etc.

Ex:

GetCurrentProcessID()
SetTimer()
Sleep(

[Link]

Communication is a system call that is used for communication. There are some examples of
communication, including create, delete communication connections, send, receive messages, etc.

Ex:

CreatePipe()
CreateFileMapping()
MapViewOfFile()

User operating system interface:

A user interface (UI) refers to the part of an operating system, program, or device that allows a
user to enter and receive information.

The user and operating system are connected with each other with the help of interface, so interface is
used to connect the user and OS.

There are two fundamental approaches for user to interface with operating system:

[Link] Interpreter

[Link] user Interface

[Link] Interpreter:

The command-line interface is an interface whenever the user needs to have different commands
regarding the input and output and then a task is performed so this is called the command-line argument
and it is used to execute the output and create, delete, print, copy, paste, etc.

All these operations are performed with the help of the command-line interface.
6

The interface is always connected to the OS so that the command given by the user directly works by the
OS and a number of operations can be performed with the help of the command line interface because
multiple commands can be interrupted at same time and execute only one.

The command line interface is necessary because all the basic operations in the computer are performed
with the help of the OS and it is responsible for memory management. By using this we can divide the
memory and we can use the memory.

A command user interface (CUI) processes commands to a computer program in the form of lines of text.
The program which handles the interface is called a command-line interpreter or command-line processor.
Operating systems implement a command-line interface in a shell for interactive access to operating
system functions or services.

Command Line Interface advantages −

• Controls OS or application
• faster management
• ability to store scripts which helps in automating regular tasks.
• Troubleshoot network connection issues.

Command Line Interface disadvantages −

• User should memorize commands and a complex syntax.


• Different commands are used in different shells.

[Link] user Interface

The GUI is one of the necessary interfaces because only by using the user can clearly see the
picture, play videos. The graphical user interface is used for playing games, watching videos, etc. these
are done with the help of GUI because all these applications require graphics.

So we need GUI for computers and this can be done only with the help of an operating system.

When a task is performed in the computer then the OS checks the task and defines the interface which is
necessary for the task. So, we need GUI in the OS.

The basic components of GUIs are −

• Start menu with program groups


• Taskbar which showing running programs
• Desktop screen
• Different icons and shortcuts.

The graphical user interface (GUI) allows users to interact with electronic devices through graphical icons
and audio indicators such as primary notation instead of text-based user interfaces, typed command
labels, or text navigation.

Graphical user interfaces operating system has the following most common advantages:
7
o The advantage of a graphical user interface is a stark improvement in usability for the average
user.
o The features of a graphical user interface familiar leverage metaphors, such as drag-and-drop for
transferring files, and use familiar icons, such as a trash bin for deleted files, creating an
environment in which computer operations are intuitive and easy to use without any prior practise
or knowledge of computing machinery or languages.
o Graphical user interface applications are self-descriptive, feedback is typically immediate, and
visual cues encourage and steer discoverability.

System boot:

When the computer is turned on, the computer runs a set of instructions; this process is referred
to as Booting. It is also known as boot up or sometimes startup. During booting, the computer loads the
Operating System and all the files required for system operation into main memory. Also, this process
examines all the hardware and Software connected or installed with the system.

When this process will be completed, you can see the windows desktop as well as run
applications on the computer system. All the files that are stored in the ROM Chip are also loaded in the
Booting Process to run the computer system. Also, during the booting process, the system reads all of the
information from the files contained in the ROM Chip, as well as all of the instructions included in these
files. After the machine has booted up, all of the information will be shown.

The order in which a computer looks for nonvolatile data storage devices with program code to
load the operating system is known as the boot sequence (OS). ROM and BIOS are typically used by
Windows and Macintosh structures, respectively, to initiate the boot process.

You might also like