Process and Memory Managemnet1
Process and Memory Managemnet1
It is used to store
instructions and process data.
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.
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.
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.
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:
Implementation: