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

Week V

The document provides an overview of Operating Systems (OS), detailing their functions, types, and historical evolution. It explains key OS functions such as hardware management, multitasking, file operations, and the differences between Graphical User Interface (GUI) and Command-Line Interface (CLI). Additionally, it emphasizes the importance of understanding OS concepts for aspiring computer programmers.

Uploaded by

tejanjalloh2274
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Week V

The document provides an overview of Operating Systems (OS), detailing their functions, types, and historical evolution. It explains key OS functions such as hardware management, multitasking, file operations, and the differences between Graphical User Interface (GUI) and Command-Line Interface (CLI). Additionally, it emphasizes the importance of understanding OS concepts for aspiring computer programmers.

Uploaded by

tejanjalloh2274
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Operating Systems and Their Functions

-Introduction to OS (Windows, macOS, Linux)


- OS functions: hardware management, multitasking
- GUI vs. CLI interfaces
- Essential OS functions (file operations, task management)

Introduction Operating System

An Operating System (OS) is a collection of software that manages computer hardware resources
and provides common services for computer programs. When you start using a Computer System
then it's the Operating System (OS) which acts as an interface between you and the computer
hardware. The operating system is really a low-level Software which is categorized as a System
Software and supports a computer's basic functions, such as memory management, tasks
scheduling and controlling peripherals etc.

What is Operating System?

An Operating System (OS) is an interface between a computer user and computer hardware. An
operating system is a software which performs all the basic tasks like file management, memory
management, process management, handling input and output, and controlling peripheral devices
such as disk drives and printers.

Generally, a Computer System consists of the following components:

 Computer Users are the users who use the overall computer system.
 Application Software’s are the softwares which users use directly to perform different
activities. These softwares are simple and easy to use like Browsers, Word, Excel,
different Editors, Games etc. These are usually written in high-level languages, such as
Python, Java and C++.
 System Softwares are the softwares which are more complex in nature and they are more
near to computer hardware. These software are usually written in low-level languages
like assembly language and includes Operating Systems (Microsoft Windows, macOS,
and Linux), Compiler, and Assembler etc.
 Computer Hardware includes Monitor, Keyboard, CPU, Disks, Memory, etc.

So now let's put it in simple words:

If we consider a Computer Hardware is body of the Computer System, then we can say an
Operating System is its soul which brings it alive ie. operational. We can never use a Computer
System if it does not have an Operating System installed on it.

Operating System - Examples

1|Page
There are plenty of Operating Systems available in the market which include paid and unpaid
(Open Source). Following are the examples of the few most popular Operating Systems:

 Windows: This is one of the most popular and commercial operating systems developed
and marketed by Microsoft. It has different versions in the market like Windows 8,
Windows 10 etc and most of them are paid.
 Linux This is a Unix based and the most loved operating system first released on
September 17, 1991 by Linus Torvalds. Today, it has 30+ variants available like Fedora,
OpenSUSE, CentOS, UBuntu etc. Most of them are available free of charges though you
can have their enterprise versions by paying a nominal license fee.
 MacOS This is again a kind of Unix operating system developed and marketed by Apple
Inc. since 2001.
 iOS This is a mobile operating system created and developed by Apple Inc. exclusively
for its mobile devices like iPhone and iPad etc.
 Android This is a mobile Operating System based on a modified version of the Linux
kernel and other open source software, designed primarily for touchscreen mobile devices
such as smartphones and tablets.

Some other old but popular Operating Systems include Solaris, VMS, OS/400, AIX, z/OS, etc.

Operating System - Functions

Following are some of important functions of an operating System.

 Process Management
 Input/Output Device Management
 File Management
 Network Management
 Main Memory Management
 Secondary Storage Management
 Security Management
 Command Interpreter System
 Control over system performance.
 Job Accounting
 Error Detection and Correction
 Coordination between other software and users
 Many more other important tasks

Operating Systems - History

Operating systems have been evolving through the years. In the 1950s, computers were limited
to running one program at a time like a calculator, but later in the following decades, computers
began to include more and more software programs, sometimes called libraries, that formed the
basis for today’s operating systems.

2|Page
The first Operating System was created by General Motors in 1956 to run a single IBM
mainframe computer, its name was the IBM 704. IBM was the first computer manufacturer to
develop operating systems and distribute them in its computers in the 1960s.

There are few facts about Operating System evaluation:

 Stanford Research Institute developed the oN-Line System (NLS) in the late 1960s,
which was the first operating system that resembled the desktop operating system we use
today.
 Microsoft bought QDOS (Quick and Dirty Operating System) in 1981 and branded it as
Microsoft Operating System (MS-DOS). As of 1994, Microsoft had stopped supporting
MS-DOS.
 Unix was developed in the mid-1960s by the Massachusetts Institute of Technology,
AT&T Bell Labs, and General Electric as a joint effort. Initially it was named MULTICS,
which stands for Multiplexed Operating and Computing System.
 FreeBSD is also a popular UNIX derivative, originating from the BSD project at
Berkeley. All modern Macintosh computers run a modified version of FreeBSD (OS X).
 Windows 95 is a consumer-oriented graphical user interface-based operating system built
on top of MS-DOS. It was released on August 24, 1995 by Microsoft as part of its
Windows 9x family of operating systems.
 Solaris is a proprietary Unix operating system originally developed by Sun Microsystems
in 1991. After the Sun acquisition by Oracle in 2010 it was renamed Oracle Solaris.

Why to Learn Operating System

If you are aspiring to become a Great Computer Programmer, then it is highly recommended to
understand how exactly an Operating System works inside out. This gives opportunity to
understand how exactly data is saved in the disk, how different processes are created and
scheduled to run by the CPU, how to interact with different I/O devices and ports.

There are various low-level concepts which help a programmer to Design and Develop scalable
softwares. Bottom line is without a good understanding of Operating System Concepts, it can't
be assumed someone to be a good Computer Application Software developer, and even it is
unimaginable imagine someone to become a System Software developer without knowing
Operating System in-depth.

If you are a fresher and applying for a job in any standard company like Google, Microsoft,
Amazon, IBM etc then it is very much possible that you will be asked questions related to
Operating System concepts.

Functions of Operating Systems (OS): Hardware Management and Multitasking

The operating system (OS) acts as an intermediary between the hardware and software, ensuring
efficient resource utilization. Two key functions of an OS are hardware management and
multitasking. Here's a detailed breakdown of each, including scenarios and examples:

3|Page
1. Hardware Management

The OS is responsible for managing hardware components such as the CPU, memory, storage
devices, input/output (I/O) devices, and peripherals.

a. CPU Management

 Function: The OS schedules processes to utilize the CPU efficiently using process
scheduling algorithms (e.g., round-robin, first-come-first-served).
 Scenario: A computer running multiple applications (e.g., a browser, a music player, and
a document editor) uses the OS to allocate CPU time to each task.
 Example:
o In a round-robin scheduling system, the OS assigns a time slice to each process.
For instance, if the browser takes too long loading a page, the OS will switch the
CPU to play music without user disruption.

b. Memory Management

 Function: The OS allocates and deallocates memory to ensure optimal performance and
prevents memory conflicts.
 Scenario: When opening multiple tabs in a web browser, the OS dynamically allocates
memory to each tab and retrieves it upon closure.
 Example:
o Virtual memory allows a system to run applications exceeding the physical RAM
size by using disk space as an extension of memory.

c. Storage Management

 Function: Manages data storage on hard drives, SSDs, and external drives. This includes
file systems and storage allocation.
 Scenario: Saving a file in Microsoft Word involves the OS writing data to the
appropriate storage sectors.
 Example:
o File systems like NTFS or FAT32 allow structured data storage and retrieval.

d. I/O Device Management

 Function: Manages communication between the OS and peripherals like printers,


keyboards, mice, and monitors.
 Scenario: Printing a document involves the OS translating the data into a format the
printer understands.
 Example:
o A plug-and-play printer is automatically detected and configured by the OS
without requiring user input.

4|Page
e. Device Drivers

 Function: These software components enable the OS to interact with hardware devices.
 Scenario: Installing a graphics driver ensures the OS can utilize GPU capabilities for
rendering graphics.
 Example:
o Without the correct audio driver, a system cannot output sound even if the
hardware is functional.

2. Multitasking

Multitasking allows an OS to execute multiple tasks (processes) simultaneously by managing the


CPU and system resources.

Types of Multitasking

1. Preemptive Multitasking:
o The OS allocates CPU time to processes and can forcibly interrupt a process to
switch to another.
o Example: Windows and Linux systems allow a media player to keep playing
music while the user types in a document.
2. Cooperative Multitasking:
o Processes voluntarily yield control of the CPU to allow others to run.
o Example: Early versions of macOS relied on cooperative multitasking.

Key Concepts in Multitasking

 Context Switching: The OS saves the state of the current process and loads the state of
the next process.
o Scenario: Switching between a spreadsheet application and a web browser.
o Example: The OS remembers the cursor position in Excel while the user reads an
article online.
 Concurrency vs. Parallelism:
o Concurrency: Multiple processes progress simultaneously but not necessarily at
the same time.
o Parallelism: True simultaneous execution on multi-core CPUs.
o Example: Running a video rendering program on a multi-core processor enables
parallel processing.

Scenarios of Multitasking

1. Scenario 1: Running Applications

5|Page
oA user streams a video while editing a presentation. The OS ensures the video
player and presentation software get necessary CPU cycles without one starving
the other.
2. Scenario 2: Background Services
o While browsing the internet, the OS runs antivirus software in the background,
scanning for threats without interrupting the user.
3. Scenario 3: Real-Time Operations
o A real-time operating system (RTOS) in industrial robots ensures sensors are
monitored while controlling actuators without delay.

Examples of OS Features Supporting Hardware Management and Multitasking

 Windows Task Manager: Monitors CPU, memory, and application usage.


 Linux top Command: Displays real-time resource usage, showing how processes are
managed.
 macOS Activity Monitor: Provides an overview of system resources and multitasking
efficiency.

GUI vs. CLI interfaces

Graphical User Interface (GUI) and Command-Line Interface (CLI) are two fundamental types
of interfaces through which users interact with computers. Each has distinct characteristics, use
cases, and benefits.

1. Graphical User Interface (GUI)


Definition

A GUI is a visual-based interface that allows users to interact with the system through graphical
elements such as windows, icons, buttons, menus, and pointers. It is designed to be intuitive and
user-friendly, often requiring minimal technical knowledge.

Key Features

 Visual Elements: Icons, buttons, menus, and toolbars provide a visual representation of
tasks and tools.
 Mouse and Touch Interaction: Users interact with elements using a mouse, touchpad, or
touchscreen.
 Drag-and-Drop Functionality: Many GUIs support direct manipulation of files and
objects through drag-and-drop actions.
 Multitasking: GUI environments allow multiple applications to run and display
simultaneously in separate windows.

6|Page
Advantages

1. User-Friendly: Easy to learn and use, even for non-technical users.


2. Multitasking Support: Enables switching between applications visually.
3. Rich Visual Feedback: Visual cues (e.g., progress bars, icons) make processes more
transparent.
4. Accessibility: Features like voice commands and touch interfaces enhance accessibility.

Disadvantages

1. Resource Intensive: Requires more memory, CPU, and graphical processing power
compared to CLI.
2. Less Precise for Certain Tasks: Complex or repetitive tasks may require multiple clicks
and navigation.

Examples

 Operating Systems: Windows, macOS, Ubuntu (with GNOME/KDE).


 Applications: Microsoft Office, Adobe Photoshop, web browsers.

Scenario

Using a GUI to copy a file involves opening a file explorer, selecting the file, right-clicking,
choosing "Copy," navigating to the destination folder, and clicking "Paste."

2. Command-Line Interface (CLI)


Definition

A CLI is a text-based interface that allows users to interact with the system by typing commands
into a terminal or command prompt. It is often preferred by advanced users and system
administrators for its speed and precision.

Key Features

 Text-Based Input: Users type commands to perform tasks.


 Command Syntax: Requires knowledge of specific commands and their syntax.
 Direct Access to System Functions: Provides powerful and detailed control over system
operations.
 Automation-Friendly: Suitable for scripting and automation of repetitive tasks.

Advantages

1. Efficiency: Faster for experienced users as tasks can be completed with a few commands.
2. Low Resource Usage: Consumes minimal system resources.

7|Page
3. Powerful: Allows access to advanced features and system internals not always available
in a GUI.
4. Automation: Supports scripting for repetitive or batch processes.

Disadvantages

1. Steep Learning Curve: Requires memorization of commands and syntax, which can be
intimidating for beginners.
2. Error-Prone: Mistakes in commands can lead to unintended actions, including system
errors.
3. No Visual Feedback: Does not provide visual cues or guidance, making it less intuitive.

Examples

 Operating Systems: Linux Terminal, Windows Command Prompt, macOS Terminal.


 Applications: Git, cURL, MySQL CLI.

Comparison: GUI vs. CLI


Feature GUI CLI
Ease of Use User-friendly, ideal for beginners. Requires technical knowledge.
Speed Slower for repetitive tasks. Faster for experienced users.
Resource Usage High, needs graphical resources. Low, lightweight.
Precision May involve multiple steps. Precise and efficient for complex tasks.
Learning Minimal for basic tasks. Steep, requires learning commands.
Curve
Automation Limited, manual steps required. Highly scriptable for automation.

Real-World Applications
When to Use a GUI

 Everyday tasks like browsing, editing documents, or media playback.


 Designing or working with graphical content (e.g., Photoshop, Illustrator).
 For users with minimal technical expertise.

When to Use a CLI

 System administration tasks (e.g., managing servers).


 Development workflows (e.g., version control with Git).
 Automation of repetitive or complex tasks through scripts.

8|Page
Essential OS Functions: File Operations and Task Management

An operating system (OS) provides the foundation for managing the resources of a computer
system. Among its core responsibilities are file operations and task management, which are
essential for enabling users and applications to interact with the hardware and system resources
effectively. These essential OS functions are the backbone of modern operating systems,
enabling users and applications to harness the full potential of hardware and software resources.

1. File Operations

The OS manages how files are stored, retrieved, and manipulated on storage devices. A file is a
collection of related data, and the OS organizes this data into a structured file system.

Key Functions of File Operations

1. File Creation:
o The OS allows users and applications to create files on storage devices.
o Example: When creating a new document in a text editor, the OS allocates
storage and assigns metadata (name, creation date).

2. File Opening:
o Files need to be opened before being read or modified. The OS provides access to
the file's content and ensures it is available to the application.
o Example: Opening an image file in a photo viewer.

3. File Reading:
o The OS reads data from files and delivers it to applications or users.
o Example: Streaming a video file involves reading chunks of the file from the
disk.

4. File Writing:
o Allows data to be written into files. The OS ensures data integrity during this
process.
o Example: Saving changes to a document in a word processor.

5. File Deletion:
o The OS allows files to be removed from the file system and reclaims the space for
other uses.
o Example: Deleting unwanted files to free up disk space.

6. File Metadata Management:


o The OS manages file attributes such as name, size, creation date, last modified
date, and permissions.
o Example: Checking a file's properties in Windows or macOS.

9|Page
7. File Organization:
o The OS organizes files in directories or folders for easier access and management.
o Example: Storing project-related files in a single folder.

8. File Permissions and Security:


o The OS enforces file permissions to ensure authorized access.
o Example: A user might have read-only access to certain files, while
administrators have full control.

Scenario

A user downloads a photo from the internet. The OS:

1. Creates the file on the disk.


2. Saves the file in the "Downloads" directory.
3. Updates the file system with its metadata.

2. Task Management

Task management refers to how the OS handles processes and programs running on the system.
A process is an instance of a program in execution, and the OS ensures efficient execution,
resource allocation, and multitasking.

Key Functions of Task Management

1. Process Creation and Termination:


o The OS creates new processes when programs are launched and terminates them
when they complete or are forcefully ended.
o Example: Opening a browser creates a process; closing it terminates the process.

2. Process Scheduling:
o The OS schedules processes to share CPU time based on priority and fairness.
o Example: Using round-robin scheduling to give equal CPU time slices to all
active processes.

3. Multitasking:
o Allows multiple processes to run concurrently by switching between them
quickly.
o Example: Listening to music while editing a document.

4. Resource Allocation:
o The OS allocates necessary resources like CPU, memory, and I/O devices to
active processes.

10 | P a g e
o Example: Assigning memory to a video player and CPU time to a game running
simultaneously.

5. Inter-Process Communication (IPC):


o Facilitates communication between processes.
o Example: A browser process fetching data from a network process.

6. Process Synchronization:
o Ensures processes do not interfere with each other, particularly in shared resource
usage.
o Example: Two programs writing to the same file at the same time.

7. Error Handling:
o Detects and resolves process errors, such as illegal memory access or
unresponsive applications.
o Example: Prompting the user to "End Task" in Windows Task Manager when a
program freezes.

Scenario

A user opens multiple applications:

1. The OS creates a process for each application.


2. It allocates CPU and memory resources to these processes.
3. The Task Manager (or equivalent) allows the user to monitor and control running
processes.

Comparison of File Operations and Task Management


Aspect File Operations Task Management
Focus Managing data storage and retrieval. Managing processes and system
resources.
Examples Creating, reading, writing files. Scheduling, multitasking, terminating
processes.
Tools File Explorer, command-line file Task Manager, terminal commands (ps,
commands. kill).

Importance of File Operations and Task Management

1. Efficiency: Enables smooth operation and multitasking in modern computing


environments.
2. Reliability: Prevents data corruption and system crashes by managing resources and
tasks effectively.
3. User Experience: Provides users with seamless interactions, such as managing files
easily and running multiple programs simultaneously.

11 | P a g e

You might also like