0% found this document useful (0 votes)
10 views12 pages

OSY 2nd Unit Notes

The document outlines the services provided by an operating system, including process management, device management, file management, memory management, and protection and security. It explains system calls as a mechanism for programs to request services from the OS and details various types of system calls such as process control, file management, device management, information maintenance, and communication. Additionally, it discusses operating system tools like user management, security policy, device management, performance monitor, and task scheduler, highlighting their functions and benefits.

Uploaded by

Gajanan Markad
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)
10 views12 pages

OSY 2nd Unit Notes

The document outlines the services provided by an operating system, including process management, device management, file management, memory management, and protection and security. It explains system calls as a mechanism for programs to request services from the OS and details various types of system calls such as process control, file management, device management, information maintenance, and communication. Additionally, it discusses operating system tools like user management, security policy, device management, performance monitor, and task scheduler, highlighting their functions and benefits.

Uploaded by

Gajanan Markad
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/ 12

Unit 2: Services and Components of Operating System

Q.1] Explain services provided by OS.


Services of Operating System:
An operating system service is a program
that provides a specific function to the applications or other system services
running on a computer system.

Fig. Services Provided by Operating System

1. Process Management
2. Device Management
3. File Management
4. Memory Management
5. Protection and Security

1] Process Management:
Service: Handles the creation, scheduling, and termination of processes.
Functions:
1. Process scheduling
2. Multi-tasking support
3. Inter-process communication (IPC)
2] Device Management:

Service: Manages hardware devices and facilitates interaction between


applications and hardware.

Functions:

1. Device drivers for communication


2. Buffering, caching, and spooling
3. Handling input/output operations

3] File Management:
Service: Provides a way to store, retrieve, and manage files on storage
devices.
Functions:
1. File creation, deletion, and manipulation
2. Directory management
3. Access control and permissions

4] Memory Management:
Service: Manages the system's memory resources.
Functions:
1. Allocation and deallocation of memory spaces
2. Virtual memory management
3. Paging and segmentation

5] Protection and Security:


Service: Protects system resources and data from unauthorized access.
Functions:
1. User authentication and authorization
2. Data encryption and integrity checks
3. Access control lists (ACLs)
Q.2] What is System Call
System Call:
A system call is a programmatic way in which a computer program
requests a service from the kernel of the operating system it is executed on. A
system call is a way for programs to interact with the operating system.
▪ System call provides the services of the operating system to the user programs
via the Application Program Interface (API).
▪ It provides an interface between a process and an operating system to allow
user-level processes to request services of the operating system.
▪ It acts as a link between the operating system and a process, allowing user-level
programs to request operating system services. The kernel system can only be
accessed using system calls. System calls are required for any programs that use
resources.

Q.3] What is purpose of system call? State two system calls with their functions
OR
List and Explain the Types of System Call

System calls:
A system call is a mechanism that provides the interface between
a process and the operating system.

Fig. System Call


Types of System Call:
1. Process Control
2. File Management
3. Device Management
4. Information Maintenance
5. Communication
1] Process Control:
Program in execution is a process. A process to be executed
must be loaded in main memory. while executing it may need to wait, terminate
or create & terminate child processes.
Functions:
1. end, abort
2. load, execute
3. create process, terminate process
4. get process attributes, set process attributes
5. wait for time
6. wait event, signal event
7. allocate and free memory
Examples:
•fork()
• exec()
• exit()
• wait()
2] File Management:
System allows us to create and delete files. For create and
delete operation system call requires the name of the file and other attributes of
the file. File attributes include file type, file size, protection codes, accounting
information and so on. Systems access these attributes for performing operations
on file and directories. Once the file is created, we can open it and use it. System
also allows performing reading, writing or repositioning operations on file.
Functions:
1. create file, delete file
2. open, close
3. read, write, reposition
4. get file attributes, set file attributes
Examples:
• open()
• read()
• write()
• close()

3] Device Management:
When a process is in running state, it requires several
resources to execute. These resources include main memory, disk drives, files and
so on. If the resource is available, it is assigned to the process. Once the resource
is allocated to the process, process can read, write and reposition the device.
Functions:
1. request device, release device
2. read, write, reposition
3. get device attributes, set device attributes
4. logically attach or detach devices
Examples:
• ioctl()
• read()
• write()

4] Information Maintenance:
Transferring information between the user
program and the operating system requires system call. System information
includes displaying current date and time, the number of current users, the version
number of the operating system, the amount of free memory or disk space and so
on. Operating system keeps information about all its processes that can be
accessed with system calls such as get process attributes and set process attributes.
Functions:
1. get time or date, set time or date
2. get system data, set system data
3. get process, file, or device attributes
4. set process, file, or device attributes
Examples:
• getpid()
• getuid()
• sleep()
• alarm()
• time()

5] Communication:
Processes in the system, communicate with each other.
Communication is done by using two models: message passing and shared
memory. For transferring messages, sender process connects itself to receiving
process by specifying receiving process name or identity. Once the
communication is over system close the connection between communicating
processes.
Functions:
1. create, delete communication connection
2. send, receive messages
3. transfer status information
4. attach or detach remote devices
Examples:
• pipe()
• shmget()
• msgget()
• semget()
Q.4] Enlist the operating system tools and explain.
Operating system tools:
1. User Management
2. Security policy
3. Device Management
4. Performance Monitor
5. Task Scheduler
1] User management:
User management tools are responsible for creating, modifying, and deleting
user accounts and managing user permissions and access levels.
1) Account Creation:
Creating a new user account in a Unix/Linux environment.
• Command: useradd
• Syntax: useradd [options] username
• Example: useradd sakshi
2) Setting Passwords:
Setting or changing the password for a user.
• Command: passwd
• Syntax: passwd username
• Example: passwd sakshi123
3) Account Deletion:
Removing a user account.
• Command: userdel
• Syntax: userdel [options] username
• Example: userdel sakshi
4) Viewing User Information:
Checking details of user accounts.
• Command: id
• Syntax: id username
• Example: id sakshi
Benefits of User Management Tools:
1. Security: Protects sensitive data by controlling access and enforcing
security policies.
2. Organization: Keeps user accounts and permissions well-organized,
making management easier.
3. Compliance: Helps meet regulatory requirements for user access and data
protection.

2] Security policy:
A security policy in an operating system defines the rules and
guidelines that govern the protection of system resources and data. It encompasses
user authentication, access control, data protection, and overall system security
measures.
1) User Authentication:
• Tool: PAM in Linux
• Purpose: Manages user authentication methods.
• Example Configuration File: /etc/pam.d/common-auth
• Syntax: auth required pam_unix.so
2) Access Control
• Tool: Access Control Lists (ACLs)
• Purpose: Provides more granular permissions for files and directories.
• Command: setfacl
• Syntax: setfacl -m u:username:rwx /path/to/file
3) Audit Logging
• Tool: Audit daemon
• Purpose: Monitors and logs system events for compliance and security.
• Configuration File: /etc/audit/audit.rules
• Syntax: -w /etc/passwd -p wa -k passwd_changes
Benefits of Security Policy Tools:
1. Enhanced Security: Protects sensitive data and systems from
unauthorized access.
2. User Accountability: Tracks user actions, helping to identify potential
security breaches.
3. Regulatory Compliance: Ensures adherence to legal and industry
standards for data protection.

3] Device Management:
Device management in an operating system (OS) involves controlling and
coordinating hardware devices, ensuring that they operate correctly and
efficiently. This includes managing device drivers, input/output operations, and
resource allocation for hardware components.
1) Device Drivers:
Device drivers are specialized software that allow the OS to
communicate with hardware devices.
• Example: A printer driver enables the OS to send print jobs to a printer.
• Usage:
In Linux, drivers are often loaded as kernel modules.
• Command: modprobe printer_driver

2) Device Configuration:
Device management tools help configure hardware
settings and parameters.
• Example: Configuring network interfaces.

• Command: ifconfig
• Example: ifconfig eth0 up

3) Input/Output Management:
Manages the data transfer between devices and
the OS.
• Example: Mounting a USB drive.
• Command: mount
• Example: mount /dev/sdb1 /mnt/usb

4) Error Handling:
Device management tools monitor devices for errors and
handle them appropriately.
• Example: Checking device logs for errors.
• Command: dmesg
• Example: dmesg | grep error
Benefits of Device Management Tools:
• Streamlined Device Setup: Simplifies the installation process for new
hardware.
• Troubleshooting Efficiency: Provides tools to quickly diagnose and fix
hardware-related issues.
• Resource Management: Helps in efficiently managing system resources
among various devices.
4] Performance Monitor:
A performance monitor is a tool that helps
administrators track and analyse the performance of system resources, such as
CPU, memory, disk usage, and network activity. By monitoring these metrics,
administrators can identify bottlenecks, optimize resource usage, and maintain
overall system health.

1) top: Process activity monitoring command


top command display Linux processes. It provides a dynamic real-time
view of a running system i.e. actual process activity. By default, it displays
the most CPU-intensive tasks running on the server and updates the list
every five seconds.
$ top

2) free: Show Linux server memory usage


free command shows the total amount of free and used physical and swap
memory in the system, as well as the buffers used by the kernel.
# free
3) iostat: Montor Linux average CPU load and disk activity
iostat command report Central Processing Unit (CPU) statistics and
input/output statistics for devices, partitions and network filesystems
(NFS).
# iostat
Benefits of Using Performance Monitor:
• Proactive Issue Detection: Identify performance bottlenecks before they
affect users.
• Data-Driven Decisions: Make informed decisions on system upgrades and
resource allocation.
• Enhanced System Performance: Optimize settings based on detailed
insights into resource usage.
5] Task Scheduler:
Task Scheduler is a built-in tool in Windows operating
systems that allows users to automate the execution of tasks at specified times
or under certain conditions. It helps manage and automate system maintenance,
monitoring, and other repetitive tasks without requiring manual intervention.
1. Task Automation: Users can schedule tasks to run at predetermined times
(e.g., daily, weekly) or in response to specific events (e.g., system startup,
user login).
2. Flexible Scheduling: It supports various triggers, including time-based
schedules and event-based triggers, allowing for customized task
management.
Example of Use:
1. Open Task Scheduler from the Control Panel or by searching for it in the
Start menu.
2. Select "Create Basic Task" from the right pane.
3. Name the task (e.g., "Nightly Backup") and set the trigger to "Daily" at a
specified time.
4. Choose "Start a program" as the action and specify the path to your backup
script.
5. Complete the setup by clicking "Finish."
Benefits of Using Task Scheduler:
• Efficiency: Automates routine tasks, saving time and reducing the need for
manual intervention.
• Reliability: Ensures important tasks are not forgotten or skipped.
• Customization: Offers flexibility to set specific conditions and triggers
based on user needs.

You might also like