swayam
swayam
An operating system acts as an intermediary between the user and the computer hardware. It's
software that manages the hardware resources and provides a platform for running other programs
(applications). There's no single definition, but some key goals include:
Executing user programs: Making it easier for users to solve problems with their computers.
Convenient use: Providing a user-friendly interface (like a graphical interface with windows
and a mouse) for interacting with the system.
Efficient resource management: Utilizing hardware resources like memory, storage, and
devices effectively. This includes ensuring resources are available when needed, preventing
conflicts between users or programs, and optimizing usage.
1. Hardware: The physical components like CPU, memory, and I/O devices (keyboard, display,
printer etc.).
2. Operating System (OS): Manages and coordinates hardware usage among various
applications and users.
3. System and Application Programs: These programs define how system resources are used to
solve user problems. Examples include compilers, word processors, web browsers, and
databases.
4. Users: People or other computers interacting with the system to accomplish tasks.
Controlling Hardware: The OS ensures devices don't overwhelm the system with information
and coordinates access to hardware resources.
Coordinating Users and Programs: The OS manages situations where multiple programs or
users need to access resources or share data. This includes synchronization to prevent
conflicts.
The OS plays a crucial role in managing resources like memory, storage, and devices. It ensures these
resources are available to the appropriate processes at the right time while preventing conflicts. This
is similar to a government managing resources for citizens.
User Viewpoint: What functionalities and interfaces does the OS provide for users to interact
with the system?
System Viewpoint: What functionalities and services does the OS need to offer to users and
programs effectively?
Additional Points
Early computer systems required users to write programs in assembly language, directly
interacting with hardware details.
Modern operating systems provide a higher level of abstraction, allowing users to write
programs in languages like C without needing to understand the underlying hardware
specifics.
The speed of different components (CPU, memory, I/O devices) plays a role in resource
management strategies.
User Viewpoint
Types of Computers:
System Viewpoint
Resource Allocator: The OS manages system resources (CPU, memory, I/O devices) and
allocates them to competing processes fairly and efficiently.
Control Program: The OS prevents errors and ensures proper hardware usage by controlling
program execution and preventing unauthorized access.
Interface between Hardware and User: The OS abstracts away hardware complexities,
providing a user-friendly environment.
Problem-Solving Tool: The OS simplifies tasks by handling common operations and resource
allocation.
Collection of Programs: The OS includes the kernel (core component), system programs
(database, compiler), and application programs (user-developed software).
Early Systems: Users interacted directly with hardware, requiring intricate knowledge of
electrical signals.
Application Development: Tools like compilers and databases emerged, further easing
software development.
Middleware: Additional software layers (e.g., frameworks) extended OS capabilities and
streamlined application development.
Key Takeaways
The user view of an OS depends on the computer type, focusing on user experience and
features.
The system view emphasizes resource management and control, essential for efficient and
secure operation.
OSs have evolved from simple interfaces to complex systems that manage resources and
facilitate software development.
Additional Insights
OS as a Resource Manager: The OS plays a vital role in ensuring resources are available when
needed, preventing conflicts, and optimizing usage.
Preemption: The OS can interrupt a running process to handle a more urgent task, ensuring
responsiveness.
Starvation Prevention: The OS prevents processes from being indefinitely denied resources,
ensuring fairness.
Further Exploration
Specific OS Features: Dive deeper into specific OS features like process management,
memory management, file systems, and security mechanisms.
OS Design Principles: Explore the underlying design principles and algorithms that govern OS
behavior.
Emerging Trends: Learn about the latest trends in OS development, such as cloud-based OS,
containerization, and edge computing.
Shared memory
These components are connected in a way that allows them to communicate and work together.
Here's a breakdown of the key aspects:
Each device controller manages a specific type of device (e.g., disk drives, keyboards,
printers). This allows for efficient interaction with various peripherals.
Controllers have local buffers to temporarily hold data during transfers between the device
and memory.
The memory is shared by all CPUs and devices. A memory controller ensures orderly access
to prevent conflicts when multiple components try to access memory simultaneously.
Many devices use standard interfaces like USB, simplifying their connection and interaction
with the system.
It interacts with devices through their respective controllers and the common bus.
Input/Output (I/O) devices allow users to interact with the computer and exchange data.
The operating system (OS) acts as an intermediary between the hardware and user software.
It manages resources like CPUs, memory, and devices, ensuring efficient and orderly
execution of tasks.
1. Power On: When the system powers on, a bootstrap program (firmware) stored in ROM
(Read-Only Memory) takes control.
2. Loading the Operating System: The bootstrap program loads the main operating system
from the disk drive into RAM (Random Access Memory).
Events can be triggered by hardware (e.g., key press) or software (e.g., system call).
When an event occurs, an interrupt signal is sent to the CPU, halting its current task.
The CPU saves its state and executes the appropriate interrupt service routine (ISR) to handle
the event.
Once the ISR finishes, the CPU restores its state and resumes the interrupted task.
This asynchronous approach allows for efficient handling of various events without the CPU
constantly checking for them.
Process Management
Memory Management
Virtual Memory: Creates the illusion of more memory than physically available.
Cache Management: Optimizes data access by storing frequently used data in faster
memory.
Storage Management
Access Control Lists (ACLs): Determine who can access files and resources.
System Calls: Interface between user programs and the kernel to request system services.
This lecture dives into the core functionalities of an operating system (OS), focusing on the services it
provides to users, processes, and other systems.
User Interface (UI): This is the bridge between users and the system. It allows users to
interact with the OS through commands or a graphical interface (GUI).
o Command-Line Interface (CLI): Users enter text commands for specific tasks. (e.g.,
Unix/Linux systems)
o Graphical User Interface (GUI): Users interact with icons, menus, and windows using
a mouse or keyboard. (e.g., Windows, macOS)
o Batch Interface: Users submit a sequence of commands in a file for execution in one
go. (common in earlier systems)
Program Execution: The OS loads programs from secondary storage (e.g., hard disk) into
main memory and executes them. It also handles normal or abnormal termination (errors).
I/O Operations: Programs interact with devices like keyboards, printers, and disks for
input/output. The OS manages these interactions.
File System Management: Users can create, delete, search, read, write, and modify files and
directories. The OS organizes and manages this file system.
Processes are programs under execution. The OS provides services to them as well:
Resource Allocation: Multiple processes may run concurrently, requiring resources like CPU
cycles, memory, and disk space. The OS allocates these resources efficiently.
Communication: Processes can exchange information with each other, either on the same
computer or across a network. The OS facilitates this communication through shared
memory or message passing.
Error Detection: The OS monitors processes for errors during execution, including those in
the CPU, memory, I/O devices, or user programs. It takes appropriate actions based on the
error type.
Additional Services
Debugging: The OS provides tools to help identify and fix errors in programs during
development or execution.
Accounting: The OS keeps track of resource usage (CPU time, memory, disk space) by users
or processes. This information is valuable for billing purposes in commercial environments.
Protection and Security: The OS safeguards system resources and user data by controlling
access and preventing unauthorized modifications.
These services are fundamental to a well-functioning operating system, enabling users and
applications to interact with the hardware effectively and securely.
Users and programs interact with the underlying OS functionalities through system calls.
These are programming interfaces that provide access to OS services.
Each service has a unique number associated with it. Programs make requests by specifying
the service number and any necessary parameters.
System calls are typically executed in the kernel mode of operation, which has more
privileges than the user mode where user programs run.
Application Programming Interfaces (APIs): Most programs access system calls through
higher-level APIs that simplify the process. Examples include Win32 API for Windows, POSIX
API for Unix-based systems, and Java API for Java programs.