Lab 3 of 7 Process Management Simulation L A B O V E R V I E W.docxfestockton
Lab 3 of 7: Process Management Simulation
L A B O V E R V I E W
Scenario/Summary
Process Management Simulation (Part 3 of 3)
The objective of this three section lab is to simulate four process management functions:
process creation, replacing the current process image with a new process image, process state transition,
and
process scheduling
.
This lab will be due over the first three weeks of this course. The commander process program is due in Week 1. This program will introduce the student to system calls and other basic operating system functions. The process manager functions
“
process creation
,
replacing the current process image with a new process image
and
process state transition
“
are due in Week 2. The scheduling section of the process manager is due in Week 3.
You will use Linux system calls such as fork( ), exec(), wait( ), pipe( ), and sleep( ). Read man pages of these system calls for details.
This simulation exercise consists of three processes running on a Linux environment:
commander
,
process manager
, and
reporter
. There is one commander process (this is the process that starts your simulation), one process manager process that is created by the commander process, and a number of reporter processes that get created by the process manager, as needed.
1. Commander Process:
The commander process first creates a pipe and then the process manager process. It then repeatedly reads commands from the standard input and passes them to the process manager process via the pipe. The commander process accepts four commands:
1.
Q
: End of one unit of time.
2.
U
: Unblock the first simulated process in blocked queue.
3.
P
: Print the current state of the system.
4.
T
: Print the average turnaround time, and terminate the system.
Command
T
can only be executed once.
1.1 Simulated Process:
Process management simulation manages the execution of simulated processes. Each simulated process is comprised of a program that manipulates the value of a single integer variable. Thus the state of a simulated process at any instant is comprised of the value of its integer variable and the value of its program counter.
A simulated process™ program consists of a sequence of instructions. There are seven types of instructions as follows:
1.
S
n: Set the value of the integer variable to n, where n is an integer.
2.
A
n: Add n to the value of the integer variable, where n is an integer.
3.
D
n: Subtract n from the value of the integer variable, where n is an integer.
4.
B
: Block this simulated process.
5.
E
: Terminate this simulated process.
6.
F
n: Create a new (simulated) process. The new (simulated) process is an exact copy of the parent (simulated) process. The new (simulated) process executes from the instruction immediately after this (
F
) instruction, while the parent (simulated) process continues its execution n instructions after the next instruction.
7.
R
filename: Replace the program of .
OPERATING SYSTEM SERVICES, OPERATING SYSTEM STRUCTURESpriyasoundar
These slides will help the engineering students for understanding the functionalities of operating system and its structure. Also it will help them for their exam preparation.
computer notes - Inter process communicationecomputernotes
Processes execute to accomplish specified computations. An interesting and innovative
way to use a computer system is to spread a given computation over several processes.
The need for such communicating processes arises in parallel and distributed processing
contexts.
Week 11
Linux Internals
Processes, scheduling
Lecture organization
Kernel Structure
Process structure
Process creation
Signals
Process management, scheduling
Linux for embedded systems
References
Linux Internals (to the power of -1)
Simone Demblon, Sebastian Spitzner
http://www.tutorialized.com/view/tutorial/Linux-kernel-internals-from-Process-Birth-to-Death/40955
Linux Knowledge Base and Tutorial
http://linux-tutorial.info/modules.php?name=MContent&pageid=224
Inside the Linux scheduler IBM Developer Works
http://www.ibm.com/developerworks/linux/library/l-scheduler/
The Linux Kernel
A Unix kernel fulfills 4 main management tasks:
• Memory management
• Process management
• File system management
• IO management
For our study of real time implications, we will examine Process management
A Rather brief look at the kernel
Part 1
Process structure
Process data structure
A process is represented by a rather large structure called task_struct.
It contains all of the necessary data to represent the process, along with data for accounting and to maintain relationships with other processes (parents and children).
The actual structure of the task_struct is many pages long
A short sample of task_struct is shown in the next slide
Task_struct
Pointers to open files
Memory map
Signals: received, masked
Register contents
Everything defining the state of the computation
Task_struct detail
The sample contains the state of execution, a stack, a set of flags, the parent process, the thread of execution (of which there can be many), and open files.
The state variable: the state of the task.
Typical states:
the process is running
In a run queue about to be running (TASK_RUNNING),
sleeping (TASK_INTERRUPTIBLE),
sleeping but unable to be woken up (TASK_UNINTERRUPTIBLE),
stopped (TASK_STOPPED), or a few others.
Flags: the process is being created (PF_STARTING) or exiting (PF_EXITING), or currently allocating memory (PF_MEMALLOC).
The comm (command) field: the name of the executable
Priority: (called static_prio). The actual priority is determined dynamically based on loading and other factors.
More Task_struct
The tasks field is a linked-list
mm and active_mm fields The process's address space. mm represents the process's memory descriptors, while the active_mm is the previous process's memory descriptors
The thread_struct identifies the stored state of the process: The CPU state (hardware registers, program counter, etc.).
Part 2
Process creation
System call functions
user-space tasks and kernel tasks, rely on a function called do_fork to create the new process.
In the case of creating a kernel thread, the kernel calls a function called kernel_thread
In user-space, a program calls fork, which results in a system call to the kernel function called sys_fork
The function relationships are shown graphically in the next slide.
Function hierarchy for process creation
do_fork
The do_fork f.
OS | Functions of OS | Operations of OS | Operations of a process | Scheduling algorithms | FCFS scheduling | SJF scheduling | RR scheduling | Paging | File system implementation | Cryptography as a security tool
ECET 360 help A Guide to career/Snaptutorialpinck2380
For more classes visit
www.snaptutorial.com
Advanced C Programming
You are required to study and understand the under lying concepts of advanced C used in the examples below. You are also required to compile and execute the programs and capture the output generated by each program
1. A Simple C program with more than one function (Parameters passed by value)
2. Basic concepts of Pointers in C
ECET 360 help A Guide to career/Snaptutorialpinck200
For more classes visit
www.snaptutorial.com
Advanced C Programming
You are required to study and understand the under lying concepts of advanced C used in the examples below. You are also required to compile and execute the programs and capture the output generated by each program
1. A Simple C program with more than one function (Parameters passed by value)
2. Basic concepts of Pointers in C
The following program demonstrates about the pointer variable, * and & operators.
3. Passing parameters to function by pointers
4. Using Structures in C
Advanced C Programming
You are required to study and understand the under lying concepts of advanced C used in the examples below. You are also required to compile and execute the programs and capture the output generated by each program
Lab 3 of 7 Process Management Simulation L A B O V E R V I E W.docxfestockton
Lab 3 of 7: Process Management Simulation
L A B O V E R V I E W
Scenario/Summary
Process Management Simulation (Part 3 of 3)
The objective of this three section lab is to simulate four process management functions:
process creation, replacing the current process image with a new process image, process state transition,
and
process scheduling
.
This lab will be due over the first three weeks of this course. The commander process program is due in Week 1. This program will introduce the student to system calls and other basic operating system functions. The process manager functions
“
process creation
,
replacing the current process image with a new process image
and
process state transition
“
are due in Week 2. The scheduling section of the process manager is due in Week 3.
You will use Linux system calls such as fork( ), exec(), wait( ), pipe( ), and sleep( ). Read man pages of these system calls for details.
This simulation exercise consists of three processes running on a Linux environment:
commander
,
process manager
, and
reporter
. There is one commander process (this is the process that starts your simulation), one process manager process that is created by the commander process, and a number of reporter processes that get created by the process manager, as needed.
1. Commander Process:
The commander process first creates a pipe and then the process manager process. It then repeatedly reads commands from the standard input and passes them to the process manager process via the pipe. The commander process accepts four commands:
1.
Q
: End of one unit of time.
2.
U
: Unblock the first simulated process in blocked queue.
3.
P
: Print the current state of the system.
4.
T
: Print the average turnaround time, and terminate the system.
Command
T
can only be executed once.
1.1 Simulated Process:
Process management simulation manages the execution of simulated processes. Each simulated process is comprised of a program that manipulates the value of a single integer variable. Thus the state of a simulated process at any instant is comprised of the value of its integer variable and the value of its program counter.
A simulated process™ program consists of a sequence of instructions. There are seven types of instructions as follows:
1.
S
n: Set the value of the integer variable to n, where n is an integer.
2.
A
n: Add n to the value of the integer variable, where n is an integer.
3.
D
n: Subtract n from the value of the integer variable, where n is an integer.
4.
B
: Block this simulated process.
5.
E
: Terminate this simulated process.
6.
F
n: Create a new (simulated) process. The new (simulated) process is an exact copy of the parent (simulated) process. The new (simulated) process executes from the instruction immediately after this (
F
) instruction, while the parent (simulated) process continues its execution n instructions after the next instruction.
7.
R
filename: Replace the program of .
OPERATING SYSTEM SERVICES, OPERATING SYSTEM STRUCTURESpriyasoundar
These slides will help the engineering students for understanding the functionalities of operating system and its structure. Also it will help them for their exam preparation.
computer notes - Inter process communicationecomputernotes
Processes execute to accomplish specified computations. An interesting and innovative
way to use a computer system is to spread a given computation over several processes.
The need for such communicating processes arises in parallel and distributed processing
contexts.
Week 11
Linux Internals
Processes, scheduling
Lecture organization
Kernel Structure
Process structure
Process creation
Signals
Process management, scheduling
Linux for embedded systems
References
Linux Internals (to the power of -1)
Simone Demblon, Sebastian Spitzner
http://www.tutorialized.com/view/tutorial/Linux-kernel-internals-from-Process-Birth-to-Death/40955
Linux Knowledge Base and Tutorial
http://linux-tutorial.info/modules.php?name=MContent&pageid=224
Inside the Linux scheduler IBM Developer Works
http://www.ibm.com/developerworks/linux/library/l-scheduler/
The Linux Kernel
A Unix kernel fulfills 4 main management tasks:
• Memory management
• Process management
• File system management
• IO management
For our study of real time implications, we will examine Process management
A Rather brief look at the kernel
Part 1
Process structure
Process data structure
A process is represented by a rather large structure called task_struct.
It contains all of the necessary data to represent the process, along with data for accounting and to maintain relationships with other processes (parents and children).
The actual structure of the task_struct is many pages long
A short sample of task_struct is shown in the next slide
Task_struct
Pointers to open files
Memory map
Signals: received, masked
Register contents
Everything defining the state of the computation
Task_struct detail
The sample contains the state of execution, a stack, a set of flags, the parent process, the thread of execution (of which there can be many), and open files.
The state variable: the state of the task.
Typical states:
the process is running
In a run queue about to be running (TASK_RUNNING),
sleeping (TASK_INTERRUPTIBLE),
sleeping but unable to be woken up (TASK_UNINTERRUPTIBLE),
stopped (TASK_STOPPED), or a few others.
Flags: the process is being created (PF_STARTING) or exiting (PF_EXITING), or currently allocating memory (PF_MEMALLOC).
The comm (command) field: the name of the executable
Priority: (called static_prio). The actual priority is determined dynamically based on loading and other factors.
More Task_struct
The tasks field is a linked-list
mm and active_mm fields The process's address space. mm represents the process's memory descriptors, while the active_mm is the previous process's memory descriptors
The thread_struct identifies the stored state of the process: The CPU state (hardware registers, program counter, etc.).
Part 2
Process creation
System call functions
user-space tasks and kernel tasks, rely on a function called do_fork to create the new process.
In the case of creating a kernel thread, the kernel calls a function called kernel_thread
In user-space, a program calls fork, which results in a system call to the kernel function called sys_fork
The function relationships are shown graphically in the next slide.
Function hierarchy for process creation
do_fork
The do_fork f.
OS | Functions of OS | Operations of OS | Operations of a process | Scheduling algorithms | FCFS scheduling | SJF scheduling | RR scheduling | Paging | File system implementation | Cryptography as a security tool
ECET 360 help A Guide to career/Snaptutorialpinck2380
For more classes visit
www.snaptutorial.com
Advanced C Programming
You are required to study and understand the under lying concepts of advanced C used in the examples below. You are also required to compile and execute the programs and capture the output generated by each program
1. A Simple C program with more than one function (Parameters passed by value)
2. Basic concepts of Pointers in C
ECET 360 help A Guide to career/Snaptutorialpinck200
For more classes visit
www.snaptutorial.com
Advanced C Programming
You are required to study and understand the under lying concepts of advanced C used in the examples below. You are also required to compile and execute the programs and capture the output generated by each program
1. A Simple C program with more than one function (Parameters passed by value)
2. Basic concepts of Pointers in C
The following program demonstrates about the pointer variable, * and & operators.
3. Passing parameters to function by pointers
4. Using Structures in C
Advanced C Programming
You are required to study and understand the under lying concepts of advanced C used in the examples below. You are also required to compile and execute the programs and capture the output generated by each program
Quality Circle | Case Study on Self Esteem | Team Opus Geeks.pdfTo Sum It Up
Quality Circle Forum of India, Chennai Chapter | Case study on Tackling the Problem of Low Self-Esteem in Students | 23rd Quality Circle Convention in Education | 11th of February, 2023
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
The Metaverse and AI: how can decision-makers harness the Metaverse for their...Jen Stirrup
The Metaverse is popularized in science fiction, and now it is becoming closer to being a part of our daily lives through the use of social media and shopping companies. How can businesses survive in a world where Artificial Intelligence is becoming the present as well as the future of technology, and how does the Metaverse fit into business strategy when futurist ideas are developing into reality at accelerated rates? How do we do this when our data isn't up to scratch? How can we move towards success with our data so we are set up for the Metaverse when it arrives?
How can you help your company evolve, adapt, and succeed using Artificial Intelligence and the Metaverse to stay ahead of the competition? What are the potential issues, complications, and benefits that these technologies could bring to us and our organizations? In this session, Jen Stirrup will explain how to start thinking about these technologies as an organisation.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
2. Know it!
In computing, a 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 allows 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.
All programs needing resources must use system calls.
3. Example
For example, if we need to write a program code to
read data from one file, copy that data into another file.
The first information that the program requires is the
name of the two files, the input and output files.
In an interactive system, this type of program
execution requires some system calls by OS.
First call is to write a prompting message on the
screen
Second, to read from the keyboard, the characters
which define the two files.
8. Some use cases
Reading and writing from files demand system calls.
If a file system wants to create or delete files, system
calls are required.
System calls are used for the creation and
management of new processes.
Network connections need system calls for sending
and receiving packets.
Access to hardware devices like scanner, and printer,
need a system call.
9. wait()
In some systems, a process needs to wait for another
process to complete its execution. This type of
situation occurs when a parent process creates a child
process, and the execution of the parent process
remains suspended until its child process executes.
The suspension of the parent process automatically
occurs with a wait() system call. When the child
process ends execution, the control moves back to the
parent process.
10.
11. fork()
Processes use this system call to create processes
that are a copy of themselves.
With the help of this system Call parent process
creates a child process, and the execution of the parent
process will be suspended till the child process
executes.
13. getid()
Getpid() is the function used to get the process ID of
the process that calls that function. The PID for the
initial process is 1, and then each new process is
assigned a new Id. It is a simple approach to getting
the PID.
19. In steps 1-3, the calling program pushes the parameters onto the stack. The first and third
parameters are called by value, but the second one is called by its address as denoted by the
& symbol.
In step 4, the actual call to the library procedure is made. This instruction is the normal
procedure call instruction used to call all procedures.
In step 5, the library procedure places the system call number in a place where the operating
system expects it, such as a register.
In step 6, the library procedure executes a TRAP instruction to switch from user mode to
kernel mode and start execution at a fixed address within the kernel.
In step 7, the kernel examines the system call number and then dispatches it to the correct
system call handler. This correct number is given in the table of system call handlers by
pointers referenced at the system call number.
In step 8, the system call handler runs.
In step 9, the operation is completed, and the user is given back control once the TRAP
instruction is set.
In step 10, this procedure returns to the user program, like how all normal library procedures
do.
In step 11, the operating system has to clear the stack, so it increments it enough so that it is
empty.