0% found this document useful (0 votes)
163 views8 pages

Process and Memory Managemnet1

The document discusses memory management in operating systems. Memory management involves subdividing memory among processes using techniques like logical and physical address mapping. It also discusses process management using process control blocks and the different states a process can be in.

Uploaded by

rubinahafeez011
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)
163 views8 pages

Process and Memory Managemnet1

The document discusses memory management in operating systems. Memory management involves subdividing memory among processes using techniques like logical and physical address mapping. It also discusses process management using process control blocks and the different states a process can be in.

Uploaded by

rubinahafeez011
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/ 8

The term memory can be defined as a collection of data in a specific format.

It is used to store
instructions and process data.

What is Memory Management?


In a multiprogramming computer, the Operating System resides in a part of memory, and the rest is used
by multiple processes. The task of subdividing the memory among different processes is called Memory
Management.
Memory management involves subdividing memory among different processes during execution.
The primary goal is to achieve efficient utilization of memory1.
Why Memory Management Is Required?:
To allocate and de-allocate memory before and after process execution.
To keep track of used memory space by processes.
To minimize fragmentation issues (both internal and external).
To maintain data integrity while executing processes1.
Logical Address Space and Physical Address Space:
Logical Address Space: Addresses generated by the CPU (also called virtual addresses). It represents the
size of a process.
Physical Address Space: Actual memory locations in RAM.
Memory management maps logical addresses to physical addresses1.

A process is a program in execution. For example, when we write a program in C or C++ and compile
it, the compiler creates binary code. The original code and binary code are both programs. When we
actually run the binary code, it becomes a process.

Process management in an operating system (OS) is a critical concept that involves activities
related to managing and controlling processes.
Process Control Block (PCB):
A program executing as a process is uniquely determined by various parameters stored in the PCB:
Process ID: A unique identifier for each process.
Process State: Can be start, ready, running, wait, or terminated.
CPU Scheduling Information: Priority level relative to other processes and pointers to scheduling queues.
CPU Registers and Program Counter: Saved and restored during process swapping.
I/O Status Information: Includes I/O requests and devices assigned to the process.
Memory Management Information: Page tables or segment tables.
Accounting Information: Tracks CPU time consumed, account numbers, etc.
States of a Process:
Processes can be in any of the following states:
Start: A new process transitions from NULL to the Start state.
Ready: The process is prepared to execute and waiting for CPU time.
Running: Currently executing on the CPU.
Wait: Waiting for an event (e.g., I/O completion).
Terminated: Process has completed its execution.
An operating system acts as an intermediary between the user of a computer and computer hardware. The
purpose of an operating system is to provide an environment in which a user can execute programs
conveniently and efficiently.

An operating system is software that manages computer hardware. The hardware must provide
appropriate mechanisms to ensure the correct operation of the computer system and to prevent user
programs from interfering with the proper operation of the system. A more common definition is that the
operating system is the one program running at all times on the computer (usually called the kernel), with
all else being application programs.

An operating system is concerned with the allocation of resources and services, such as memory,
processors, devices, and information. The operating system correspondingly includes programs to manage
these resources, such as a traffic controller, a scheduler, a memory management module, I/O programs,
and a file system.

History of Operating System


The operating system has been evolving through the years. The following table shows the history of OS.

Generation Year Electronic device used Types of OS Devices


First 1945-55 Vacuum Tubes Plug Boards
Second 1955-65 Transistors Batch Systems
Third 1965-80 Integrated Circuits(IC) Multiprogramming
Fourth Since 1980 Large Scale Integration PC
Characteristics of Operating Systems
Let us now discuss some of the important characteristic features of operating systems:

Device Management: The operating system keeps track of all the devices. So, it is also called the
Input/Output controller that decides which process gets the device, when, and for how much time.
File Management: It allocates and de-allocates the resources and also decides who gets the resource.
Job Accounting: It keeps track of time and resources used by various jobs or users.
Error-detecting Aids: These contain methods that include the production of dumps, traces, error
messages, and other debugging and error-detecting methods.
Memory Management: It keeps track of the primary memory, like what part of it is in use by whom, or
what part is not in use, etc. and It also allocates the memory when a process or program requests it.
Processor Management: It allocates the processor to a process and then de-allocates the processor when
it is no longer required or the job is done.
Control on System Performance: It records the delays between the request for a service and the system.
Security: It prevents unauthorized access to programs and data using passwords or some kind of
protection technique.
Convenience: An OS makes a computer more convenient to use.
Efficiency: An OS allows the computer system resources to be used efficiently.
Ability to Evolve: An OS should be constructed in such a way as to permit the effective development,
testing, and introduction of new system functions at the same time without interfering with service.
Throughput: An OS should be constructed so that It can give maximum throughput (Number of tasks
per unit time).
Functionalities of Operating System
Resource Management: When parallel accessing happens in the OS means when multiple users are
accessing the system the OS works as Resource Manager, Its responsibility is to provide hardware to the
user. It decreases the load in the system.
Process Management: It includes various tasks like scheduling and termination of the process. It is done
with the help of CPU Scheduling algorithms.
Storage Management: The file system mechanism used for the management of the storage. NIFS, CIFS,
CFS, NFS, etc. are some file systems. All the data is stored in various tracks of Hard disks that are all
managed by the storage manager. It included Hard Disk.
Memory Management: Refers to the management of primary memory. The operating system has to keep
track of how much memory has been used and by whom. It has to decide which process needs memory
space and how much. OS also has to allocate and deallocate the memory space.
Security/Privacy Management: Privacy is also provided by the Operating system using passwords so
that unauthorized applications can’t access programs or data. For example, Windows uses Kerberos
authentication to prevent unauthorized access to data.
The process operating system as User Interface:

User
System and application programs
Operating system
Hardware
Every general-purpose computer consists of hardware, an operating system(s), system programs, and
application programs. The hardware consists of memory, CPU, ALU, I/O devices, peripheral devices, and
storage devices. The system program consists of compilers, loaders, editors, OS, etc. The application
program consists of business programs and database programs.

Conceptual View of Computer System

Conceptual View of Computer System

Every computer must have an operating system to run other programs. The operating system coordinates
the use of the hardware among the various system programs and application programs for various users. It
simply provides an environment within which other programs can do useful work.

The operating system is a set of special programs that run on a computer system that allows it to work
properly. It performs basic tasks such as recognizing input from the keyboard, keeping track of files and
directories on the disk, sending output to the display screen, and controlling peripheral devices.

Introduction of System Call


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. A computer program makes a system call when it
makes a request to the operating system’s kernel. System call provides the services of the
operating system to the user programs via 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. System calls are the only entry points into the kernel system.
All programs needing resources must use system calls.
A user program can interact with the operating system using a system call. A number of
services are requested by the program, and the OS responds by launching a number of systems
calls to fulfill the request. A system call can be written in high-level languages like C or Pascal
or in assembly language. If a high-level language is used, the operating system may directly
invoke system calls, which are predefined functions.
A system call is a mechanism used by programs to request services from the operating
system (OS). In simpler terms, it is a way for a program to interact with the underlying system,
such as accessing hardware resources or performing privileged operations.
A system call is initiated by the program executing a specific instruction, which triggers a
switch to kernel mode, allowing the program to request a service from the OS. The OS then
handles the request, performs the necessary operations, and returns the result back to the
program.
System calls are essential for the proper functioning of an operating system, as they provide a
standardized way for programs to access system resources. Without system calls, each program
would need to implement its own methods for accessing hardware and system services, leading
to inconsistent and error-prone behavior.
Services Provided by System Calls
 Process creation and management
 Main memory management
 File Access, Directory, and File system management
 Device handling(I/O)
 Protection
 Networking, etc.
 Process control: end, abort, create, terminate, allocate, and free memory.
 File management: create, open, close, delete, read files,s, etc.
 Device management
 Information maintenance
 Communication
Features of System Calls
 Interface: System calls provide a well-defined interface between user programs and the
operating system. Programs make requests by calling specific functions, and the operating
system responds by executing the requested service and returning a result.
 Protection: System calls are used to access privileged operations that are not available to
normal user programs. The operating system uses this privilege to protect the system from
malicious or unauthorized access.
 Kernel Mode: When a system call is made, the program is temporarily switched from user
mode to kernel mode. In kernel mode, the program has access to all system resources,
including hardware, memory, and other processes.
 Context Switching: A system call requires a context switch, which involves saving the
state of the current process and switching to the kernel mode to execute the requested
service. This can introduce overhead, which can impact system performance.
 Error Handling: System calls can return error codes to indicate problems with the
requested service. Programs must check for these errors and handle them appropriately.
 Synchronization: System calls can be used to synchronize access to shared resources, such
as files or network connections. The operating system provides synchronization
mechanisms, such as locks or semaphores, to ensure that multiple programs can access
these resources safely.
System Calls Advantages
 Access to hardware resources: System calls allow programs to access hardware resources
such as disk drives, printers, and network devices.
 Memory management: System calls provide a way for programs to allocate and deallocate
memory, as well as access memory-mapped hardware devices.
 Process management: System calls allow programs to create and terminate processes, as
well as manage inter-process communication.
 Security: System calls provide a way for programs to access privileged resources, such as
the ability to modify system settings or perform operations that require administrative
permissions.
 Standardization: System calls provide a standardized interface for programs to interact
with the operating system, ensuring consistency and compatibility across different
hardware platforms and operating system versions.
How does System Call Work?
Here is the detailed explanation step by step how system call work:
 User need special resources : Sometimes programs need to do some special things which
can’t be done without the permission of OS like reading from a file, writing to a file ,
getting any information from the hardware or requesting a space in memory.
 Program makes a system call request : There are special predefined instruction to make a
request to the operating system. These instruction are nothing but just a “system call”. The
program uses these system calls in its code when needed.
 Operating system sees the system call : When the OS sees the system call then it
recongnises that the program need help at this time so it temporarily stop the program
execution and give all the control to special part of itself called ‘Kernel’ . Now ‘Kernel’
solve the need of program.
 Operating system performs the operations :Now the operating system perform the
operation which is requested by program . Example : reading content from a file etc.
 Operating system give control back to the program : After performing the special
operation, OS give control back to the program for further execution of program .

Design Goals:

Design goals are the objectives of the operating system. They must be met
to fulfill design requirements and they can be used to evaluate the design.
These goals may not always be technical, but they often have a direct impact
on how users perceive their experience with an operating system. While
designers need to identify all design goals and prioritize them, they also
need to ensure that these goals are compatible with each other as well as
compatible with user expectations or expert advice
Designers also need to identify all possible ways in which their designs could
conflict with other parts of their systems—and then prioritize those potential
conflicts based on cost-benefit analysis (CBA). This process allows for better
decision-making about what features make sense for inclusion into final
products versus those which would require extensive rework later down the
road. It’s also important to note that CBA is not just about financial costs; it
can also include other factors like user experience, time to market, and the
impact on other systems.
The process of identifying design goals, conflicts, and priorities is often
referred to as “goal-driven design.” The goal of this approach is to ensure
that each design decision is made with the best interest of users and other
stakeholders in mind.
Mechanisms and Policies:

An operating system is a set of software components that manage a


computer’s resources and provide overall system management.
Mechanisms and policies are the two main components of an operating
system. Mechanisms handle low-level functions such as scheduling,
memory management, and interrupt handling; policies handle higher-level
functions such as resource management, security, and reliability. A well-
designed OS should provide both mechanisms and policies for each
component in order for it to be successful at its task:
Mechanisms should ensure that applications have access to appropriate
hardware resources (seats). They should also make sure that applications
don’t interfere with each other’s use of these resources (for example through
mutual exclusion).
Policies determine how processes will interact with one another when they’re
running simultaneously on multiple CPUs within a single machine instance –
what processor affinity should occur during multitasking operations? Should
all processes be allowed access simultaneously or just those belonging
specifically within group ‘A’?’
These are just some of the many questions that policies must answer. The
OS is responsible for enforcing these mechanisms and policies, as well as
handling exceptions when they occur. The operating system also provides a
number of services to applications, such as file access and networking
capabilities.
The operating system is also responsible for making sure that all of these
tasks are done efficiently and in a timely manner. The OS provides
applications with access to the underlying hardware resources and ensures
that they’re properly utilized by the application. It also handles any
exceptions that occur during execution so that they don’t cause the entire
system to crash.

Implementation:

Implementation is the process of writing source code in a high-level


programming language, compiling it into object code, and then interpreting
(executing) this object code by means of an interpreter. The purpose of an
operating system is to provide services to users while they run applications
on their computers.
The main function of an operating system is to control the execution of
programs. It also provides services such as memory management, interrupt
handling, and file system access facilities so that programs can be better
utilized by users or other devices attached to the system.
An operating system is a program or software that controls the computer’s
hardware and resources. It acts as an intermediary between applications,
users, and the computer’s hardware. It manages the activities of all
programs running on a computer without any user intervention.
The operating system performs many functions such as managing the
computer’s memory, enforcing security policies, and controlling peripheral
devices. It also provides a user interface that allows users to interact with
their computers.
The operating system is typically stored in ROM or flash memory so it can be
run when the computer is turned on. The first operating systems were
designed to control mainframe computers. They were very large and
complex, consisting of millions of lines of code and requiring several people
to develop them.
Today, operating systems are much smaller and easier to use. They have
been designed to be modular so they can be customized by users or
developers.
There are many different types of operating systems:
1. Graphical user interfaces (GUIs) like Microsoft Windows and Mac OS.
2. Command line interfaces like Linux or UNIX
3. Real-time operating systems that control industrial and scientific
equipment
4. Embedded operating systems are designed to run on a single computer
system without needing an external display or keyboard.

You might also like