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

Worksheet cs

Uploaded by

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

Worksheet cs

Uploaded by

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

Hardware vs.

software Operating systems


The physical components of the computer is hardware. For example: monitor, The operating system plays a vital role in the functioning of computer systems.
keyboard, mouse, etc. The programs that run on the computer is software. It manages the software and hardware that make up the computer system. It
acts as an interface between the user and important applications for managing
Both hardware and software work together for smooth functioning of the
computer. All components communicate with system using inputs and outputs. the computer.
An operating system is software that runs in the background of a computer
system. Some computer systems have unique operating systems such as
Output device: gaming consoles. Windows, Mac OS X, Linux and iOS are a few examples of
System: Presents the
Input device: operating systems. Some functions of an operating system are:
Data received is processed
Receives input data
processed information to the • Human-computer interface: It helps the user to interact with the computer
user system easily.
Software in the system is responsible for providing instructions to hardware • Multitasking: Allows multiple applications to run at the same time.
and, thus, performs tasks requested by user.
• Loading and running of applications and software.
There are two types of software:
• Error handling.
▪ System software: System software is responsible for running hardware and
managing computer systems. Examples of system software include the • Batch processing.
operating system, device drivers, utility software, etc.
• Interrupt handling routines.
▪ Application software: Application software enables user to perform a
specific task. For example: word processor allows the store text and simple • Real-time processing.
images and web browser displays web pages.
• Processor management.
• Multiprogramming.
• Memory management: Transfers programs to the memory, allocates free
space between programs and keeps track of memory usage.
• Control of input-output devices: Sends and receives data from the output
and input devices respectively. Storage devices like flash-drives and
compact-disks are also managed.
• Security: Users are given passwords to secure the computer system.
• File utilities: Various files are managed and organised in directories. Files
can be searched, sorted, deleted, copied, etc.
Human-computer Interface
Operating systems provide two types of user interfaces: Graphical and
text-based.
• Graphical User Interface (GUI): Users are provided with an interactive
environment based on icons, menus and tiles. Smartphones are an
example of a GUI where users interact through a touchscreen. In computer
systems, users interact with a GUI with through a mouse and keyboard.
• Command Line Interface (CLI): A command-line interface is a non-graphical
user interface where the user interacts with a text-only service. The
feedback from the OS is also text information. The user needs to know the
Figure 1: Functions of an operating system
various commands to interact with the OS using CLI. CLI is faster, more
Communication between hardware and applications is processed through an flexible and uses less memory compared to a GUI.
operating system. An operating system is structured in the form of layers, as
shown in the figure below. The user interfaces with the applications installed in
the system. These applications interact with the kernels of the operating
system. The hardware operations are dealt by these kernels. Kernels are the
control centre of the operating system. The resources are allocated according
to the priority of the requests. The central processing unit (CPU), memory and
other hardware devices are the resources required to process a request from
an application. The response of the operating system is obtained for the user
through the user interface.

Figure 3: Human-computer Interface

Figure 2: Layers in an operating system


Managing the CPU Multitasking
To run a piece of software, the OS finds the program in the storage drive, loads An OS can run multiple programs at the same time. Multiple programs can be
it to the main memory and instructs the CPU to start executing the program copied to RAM at the same time, but only one program is processed at a
from the beginning. The OS performs the following steps to run a program: particular instant. The programs could be in any of the following three states:
Running, waiting, and runnable.
i. The program is found in the storage drive.
A CPU can only run one process at a time. CPUs are extremely fast and can
ii. A section of RAM is allocated for the program and its data.
swap between various processes. The OS controls the CPU and decides which
iii. The program is copied from the storage drive to the RAM. process should be executed at a particular time. The swapping of processes is
iv. The program counter is a register that consists of the address where the according to a schedule determined by the OS. When a process is running by a
first instruction is present. The program counter is now set to the CPU, the other processes are put on hold in a waiting state. This scheduling is
memory location and the program is executed. very important for efficient and fair processing. This swapping between
processes is fast and, hence, it appears to the user that multiple processes are
running at the same time.
In case a process that is currently running is interrupted by any external event
or consumes more than its allocated time, the CPU switches from the running
process to a runnable process.
The scheduling of processing can take place in various ways. The operating
system may choose the shortest job first or it may choose the one with the
longest waiting time first. This scheduling is managed by the operating system.

Figure 4: Steps to run a program

Figure 5: Multitasking
Memory Management Memory Management
The OS is responsible for managing memory between various processes run by ii. Paging
the CPU. The memory is shared efficiently between the processes. When
Alternatively, the memory can also be split into equally sized blocks called
multiple processes are being run, the OS makes sure that each process has its
pages. The information for which page is allocated to which process is
data and instructions stored in a different memory location. Hence, the
maintained in a table.
processes do not interfere with each other. In cases where processes need to
share some data, these data are stored in a shared location.
Consider four processes running at the same time and being allocated memory
A, B, C and D. A scenario, as described in the following figure, takes place.
Figure 8: Paging
An operating system may use both of these methods to manage memory.

Figure 6: Allocating memory to a new process


Memory can be allocated to E in two ways:
i. Segmentation
The memory required from process E is split into two parts, as shown below.
This way of splitting memory and allocating it to a process is called
segmentation.

Figure 7: Segmentation
Control of input-output devices File Management Systems
The peripheral devices are controlled using protocols and device drivers. Files in the storage drive are organised and managed by the OS. In order to
access a file, the OS needs to know the location of the file. To retrieve data
• Protocol
from the file, an OS needs to know the organisation structure, amount of data
The peripheral devices connected to the computer are programmed with in the file and the protocol needed to communicate with the file system.
machine code. This code describes the way data is to be transferred between
The OS manages the way data is organised into files. Windows File Explorer is a
the device and the computer. A protocol is made to control and communicate
program that manages the file system in Windows. The OS organises the
with the device.
location and structure of the file system. It also determines how files are
• Device drivers stored, deleted, read and repaired.
A device driver manages the connection with a peripheral device. This handles Each file has a unique name and the OS maintains a look-up table that contains
the different requests between a computer and a device. It is responsible for the information about the location of all the files. Files are stored in a
defining the processes to store outgoing data and incoming messages. A device hierarchical system, as shown in the figure below.
driver wakes up the device only when it is necessary. When the device is idle
for more than a specified time, the driver puts the device into sleep mode.
An OS is equipped with generic device drivers but some devices require the
installation of its device drivers. A single driver is enough to control multiple
peripherals using the same protocol. In cases where multiple peripherals are
connected, the data related to each device is stored in a different location to
make sure that the processes do not interfere with each other.

Figure 9: Hierarchical file system


Interrupts and Buffers Utilities
An interrupt is a signal sent from a device or software to the processor. The Utilities are programs that are installed in a system alongside the operating
processor will temporarily stop its current process and will service the interrupt system. These programs perform a limited range of functions. Some of these
signal. For example, when paper is jammed in a printer, the CPU prompts the programs are installed automatically with an operating system. Some of these
user to check the status. Interrupts allow the computer to carry out many tasks programs are also installed by users. Utility software performs
at the same time. When the interrupt is serviced, the status of the current job maintenance-related tasks such as backing-up data, formatting the disk and
is saved. Once the interrupt is serviced using the interrupt service routine, the security-related tasks such as providing passwords for user accounts, and
current job is serviced according to its status when it was saved before the protecting the system from malware.
interrupt service.
Hardware devices operate at a much lower speed compared to that of the
processor. If the processor is sending data to an output device, it needs to wait
for the hardware to complete its operation. Buffers are used to speed up the
processor’s operation. Buffers are temporary memory areas, which have the
data for the output hardware. The processor continues with its other processes
until the buffer starts becoming empty. Buffers are also used in online video
streaming. This ensures that the video being played does not stop frequently
Figure 11: Classification of utilities
while waiting for data from the Internet.
The developers of an operating system constantly work to improve its
Buffers and interrupts are used together for standard computer functions. performance, security and eliminate bugs. An auto-updating facility makes sure
Buffers and interrupts work together to print a document, as shown in the that updates of the latest utility programs are installed on the computer.
flowchart below.
Maintenance utilities
• Backup
To make the system reliable, a copy of all data and files can be stored. These
duplicate data and files are stored in a separate server or storage drive. This
protects the data from being lost due to failure. Backup is also useful when
data is accidentally overwritten.

Figure 10: Buffers and interrupts


The three main types of backup are:
• Disk-cleaner
A storage drive is divided into clusters. A look-up table for all files with their
addresses is present in the drive. When a file is deleted, its address from the
look-up table is also deleted. Now, the address is free to be used for another
file. Commercially available disks cleaners identify and remove the unused,
temporary and cached files to make more free space on the disk.
• Disk-defragmentation
When many small files are deleted, small parts of all clusters are free for usage.
If a large file needs to be stored, this file is fragmented into smaller parts and
can then be stored in many small clusters. When this large file is accessed, the
a) Full backup read-write head has to move many times and the time taken to access this data
A copy of all the contents of a system is made at one or more specific points increases. Therefore, utility software disk-defragmenters are used that
reassembles the fragments and the file appears in continuous sequences of
in time. The data that remains unchanged is also copied to the backup.
clusters. The free space now also appears as a separate sequence of clusters.
Hence, the back-up process is slowest and requires more space compared to
This improves the file access times. This process is run by the OS automatically
all the other methods. As only the last backup is required to restore data from at scheduled intervals or by a user’s request.
this backup procedure, it is faster compared to other methods.
• Formatting
b) Incremental backup
Storage devices need to be formatted to be compatible with the OS. When a
An incremental backup stores an initial backup first and then backups at more storage device is connected to an OS, the device is formatted automatically.
frequent intervals of time by organising the data according to the increments
of change in between time intervals. Data that remains unchanged is not
copied to the backup as in the full backup. As a result, this back-up procedure Security utilities
is faster and requires less space than other methods. But, many restore points • User accounts
may be accessed during restoring the data and, hence, restoring data from
User accounts are provided to authorise access to important files and
this backup procedure is slowest of all other methods. documents. These accounts ask for a password. Hence, the system is protected
c) Differential backup from unauthorised access.

A differential backup only saves those files that are new or have changed • Encryption
since the last full back-up procedure. This back-up procedure is faster than a The data is encrypted when it is stored or when it is sent over a network. This is
full backup procedure but is slower than an incremental back-up procedure. done to protect the data from unauthorised access.
Space required to perform differential backup is more than that of • Anti-virus software
incremental backup as some duplicate copies of files are stored. Still, the
space required is less compared to a full backup. The restoration process is Anti-virus software detects malware and blocks its operation. This type of
software safely removes any file that could be a threat to the system.
faster compared to an incremental backup but is slower compared to a full
backup.
• Firewall
A firewall establishes a barrier between a trusted internal network and
Activity 1
untrusted external networks. It prevents unauthorised web users and malicious Duration: 10 minutes
software from gaining access to private networks connected through the
Internet. List the functions of an operating system.

Functions of an operating system


A network security system that forms a
Firewall barrier between an internal network and
Glossary untrusted external network.

Graphical User The interactive environment used by a user


A computer program that detects and
Antivirus software Interface (GUI) to interact with the computer.
removes malware.

Software that enables user to perform a The physical parts of a computer system like
Application software Hardware
specific task. hard-disk drive, CD-Drive, etc.

An interrupt is a signal sent from a device or


Temporary memory area in computer to
Buffer software to the processor which temporarily
store data for current processes. Interrupt
stops the current process and initiates an
interrupt service routine
The brain of the computer that processes the
Central Processing
instructions. It consists of a control unit, ALU
Unit (CPU) Kernels are the control centre of the
and cache memory.
Kernel operating system that deals with hardware
operations.
Command Line The non-interactive and text-only service
Interface (CLI) used by a user to interact with the computer.
A computer program that is intentionally
Malware designed to harm the functioning of a
A program that controls a device attached to computer.
Device Driver
the computer.

Memory Part of the computer that stores data.


Disk cleaner A utility to free up the disk space.

A utility that reassembles a file that is stored A multitasking OS allows to user to perform
Disk Multitasking
in various fragments in different clusters of more than one task at a time.
defragmentation
the disk.
Software that runs in the background of a
The process of modifying data such that it is computer system and acts as an interface
Operating system
Encryption non-understandable by users with between the user and important
unauthorised access. applications.
The memory is split into equally sized blocks
Pages called pages, which can be allocated to
processes.

Peripheral
Hardware that is connected to the computer Mind map
like keyboard, mouse, etc.

A register that contains the location of the


Program counter
instruction that is to be executed next.

Process A program that has begun execution.

Code that describes the way data is


Protocol transferred between an external device and
computer.
Memory that is frequently accessed for
Random Access
writing and reading data. Once the power is
Memory (RAM)
switched off, the contents of RAM are lost.

Splitting memory and allocating it to


Segmentation
processes is called segmentation.

Software Programs that run on the computer.

Software that is responsible for running


System software
hardware and managing computer systems.

A program that is installed in a system


Utility alongside the operating system to perform a
limited range of functions.

A program that leads to malfunctioning of


Virus
the computer.

Windows Microsoft’s brand of operating system.

20

You might also like