This document provides an overview of Linux process management and scheduling. It discusses the process data structure (task_struct), process creation via fork(), signals, scheduling queues (run queue and sleep queue), and process termination. It describes how processes move between different states like running, ready, sleeping, and zombies. The scheduler manages CPU time allocation to processes based on priority. Interrupts, time slices, and waiting for resources can trigger process state changes and scheduling.
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
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
The second part of Linux Internals covers system calls, process subsystem and inter process communication mechanisms. Understanding these services provided by Linux are essential for embedded systems engineer.
Operating system - Process and its conceptsKaran Thakkar
This presentation gives an overview of Process concepts in Operating System. The presentation aims at alleviating most of the overheads while understanding the process concept in operating system. this tailor made presentation will help individuals to understand the overall meaning of process and its underlying concepts used in an operating system.
Gives an overview about Process, PCB, Process States, Process Operations, Scheduling, Schedulers, Interprocess communication, shared memory and message passing systems
`Do assignments as detailed outNO WIKI for referncesPlease m.docxmelbruce90096
`Do assignments as detailed out
NO WIKI for refernces
Please make sure that ALL REFERNCES ARE APA CITED
TB BOOK CITATION:
Dyer, W. G., Jr., Dyer, J. H., & Dyer, W. G. (2013). Team building: Proven strategies for improving team performance (5th ed.). San Francisco, CA: Jossey-Bass.
.
_____1.On July 9, Sheb Company sells goods on credit to .docxmelbruce90096
_____1.
On July 9, Sheb Company sells goods on credit to Wooley Company for $5,000, terms 1/10, n/60. Sheb receives payment on July 18. The entry by Sheb on July 18 is:
A)
Cash
5,000
Accounts Receivable
5,000
B)
Cash
5,000
Sales Discounts
50
Accounts Receivable
4,950
C)
Cash
4,950
Sales Discounts
50
Accounts Receivable
5,000
D)
Cash
5,050
Sales Discounts
50
Accounts Receivable
5,000
_____2.
The collection of a $1,000 account after the 2 percent discount period will result in a
A)
debit to Cash for $980.
B)
credit to Accounts Receivable for $1,000.
C)
credit to Cash for $1,000.
D)
debit to Sales Discounts for $20.
_____3.
Gross profit does
not
appear
A)
on a multiple-step income statement.
B)
on a single-step income statement.
C)
to be relevant in analyzing the operation of a merchandiser.
D)
on the income statement if the periodic inventory system is used because it cannot be calculated.
_____4.
During 2014, Parker Enterprises generated revenues of $90,000. The company's expenses were as follows: cost of goods sold of $45,000, operating expenses of $18,000 and a loss on the sale of equipment of $3,000.
Parker's gross profit is
A)
$24,000.
B)
$27,000.
C)
$45,000.
D)
$90,000.
_____5.
At the beginning of September, 2014, Stella Company reported Inventory of $8,000. During the month, the company made purchases of $35,600. At September 30, 2014, a physical count of inventory reported $8,400 on hand. Cost of goods sold for the month is
A)
$35,200.
B)
$35,600.
C)
$36,000.
D)
$43,600.
_____6.
The Freight-In account
A)
increases the cost of merchandise purchased.
B)
is contra to the Purchases account.
C)
is a permanent account.
D)
has a normal credit balance.
______7.
A company purchased inventory as follows:
150 units at $5
350 units at $6
The average unit cost for inventory is
A)
$5.00.
B)
$5.50.
C)
$5.70.
D)
$6.00.
______8.
A company just starting business made the following four inventory purchases in June:
June
1
150 units
$
390
June
10
200 units
585
June
15
200 units
630
June
28
150 units
510
$2,115
A physical count of merchandise inventory on June 30 reveals that there are 250 units on hand. Using the FIFO inventory method, the amount allocated to cost of goods sold for June is
A)
$683.
B)
$825.
C)
$1,290.
D)
$1,432.
PART II — BASIC INVENTORY COMPUTATIONS
(18 points)
9.
Joe Poultry uses a
periodic
inventory system. Its beginning inventory on May 1 consisted of 300 units of Product A at a cost of $6.25 per unit. During May, the following purchases and sales were made.
Purchases
Sales
May
6
300
units at $7.20
May
4
275
units
14
400
units at $9.10
8
300
units
21
100
units at $11.50
22
400
units
28
500
units at $11.80
24
225
units
1,300
1,200
Instructions:
Compute the May 31 ending inventory and May cost of goods sold under (a) Average Cost, (b) FIFO, and (c) LIFO. Provide appropriate supporting ca.
More Related Content
Similar to Week 11Linux InternalsProcesses, schedulingLecture o.docx
The second part of Linux Internals covers system calls, process subsystem and inter process communication mechanisms. Understanding these services provided by Linux are essential for embedded systems engineer.
Operating system - Process and its conceptsKaran Thakkar
This presentation gives an overview of Process concepts in Operating System. The presentation aims at alleviating most of the overheads while understanding the process concept in operating system. this tailor made presentation will help individuals to understand the overall meaning of process and its underlying concepts used in an operating system.
Gives an overview about Process, PCB, Process States, Process Operations, Scheduling, Schedulers, Interprocess communication, shared memory and message passing systems
`Do assignments as detailed outNO WIKI for referncesPlease m.docxmelbruce90096
`Do assignments as detailed out
NO WIKI for refernces
Please make sure that ALL REFERNCES ARE APA CITED
TB BOOK CITATION:
Dyer, W. G., Jr., Dyer, J. H., & Dyer, W. G. (2013). Team building: Proven strategies for improving team performance (5th ed.). San Francisco, CA: Jossey-Bass.
.
_____1.On July 9, Sheb Company sells goods on credit to .docxmelbruce90096
_____1.
On July 9, Sheb Company sells goods on credit to Wooley Company for $5,000, terms 1/10, n/60. Sheb receives payment on July 18. The entry by Sheb on July 18 is:
A)
Cash
5,000
Accounts Receivable
5,000
B)
Cash
5,000
Sales Discounts
50
Accounts Receivable
4,950
C)
Cash
4,950
Sales Discounts
50
Accounts Receivable
5,000
D)
Cash
5,050
Sales Discounts
50
Accounts Receivable
5,000
_____2.
The collection of a $1,000 account after the 2 percent discount period will result in a
A)
debit to Cash for $980.
B)
credit to Accounts Receivable for $1,000.
C)
credit to Cash for $1,000.
D)
debit to Sales Discounts for $20.
_____3.
Gross profit does
not
appear
A)
on a multiple-step income statement.
B)
on a single-step income statement.
C)
to be relevant in analyzing the operation of a merchandiser.
D)
on the income statement if the periodic inventory system is used because it cannot be calculated.
_____4.
During 2014, Parker Enterprises generated revenues of $90,000. The company's expenses were as follows: cost of goods sold of $45,000, operating expenses of $18,000 and a loss on the sale of equipment of $3,000.
Parker's gross profit is
A)
$24,000.
B)
$27,000.
C)
$45,000.
D)
$90,000.
_____5.
At the beginning of September, 2014, Stella Company reported Inventory of $8,000. During the month, the company made purchases of $35,600. At September 30, 2014, a physical count of inventory reported $8,400 on hand. Cost of goods sold for the month is
A)
$35,200.
B)
$35,600.
C)
$36,000.
D)
$43,600.
_____6.
The Freight-In account
A)
increases the cost of merchandise purchased.
B)
is contra to the Purchases account.
C)
is a permanent account.
D)
has a normal credit balance.
______7.
A company purchased inventory as follows:
150 units at $5
350 units at $6
The average unit cost for inventory is
A)
$5.00.
B)
$5.50.
C)
$5.70.
D)
$6.00.
______8.
A company just starting business made the following four inventory purchases in June:
June
1
150 units
$
390
June
10
200 units
585
June
15
200 units
630
June
28
150 units
510
$2,115
A physical count of merchandise inventory on June 30 reveals that there are 250 units on hand. Using the FIFO inventory method, the amount allocated to cost of goods sold for June is
A)
$683.
B)
$825.
C)
$1,290.
D)
$1,432.
PART II — BASIC INVENTORY COMPUTATIONS
(18 points)
9.
Joe Poultry uses a
periodic
inventory system. Its beginning inventory on May 1 consisted of 300 units of Product A at a cost of $6.25 per unit. During May, the following purchases and sales were made.
Purchases
Sales
May
6
300
units at $7.20
May
4
275
units
14
400
units at $9.10
8
300
units
21
100
units at $11.50
22
400
units
28
500
units at $11.80
24
225
units
1,300
1,200
Instructions:
Compute the May 31 ending inventory and May cost of goods sold under (a) Average Cost, (b) FIFO, and (c) LIFO. Provide appropriate supporting ca.
[removed]eltomate Son rojos y se sirven (they are serv.docxmelbruce90096
[removed]
el
tomate
: Son rojos y se sirven (
they are served
) en las ensaladas.
[removed]
los
entremeses
: Se come (
It is eaten
) antes del plato principal; es líquida y caliente (
hot
).
[removed]
la
zanahoria
: Son unas verduras anaranjadas, largas y delgadas
.
[u07d2] Unit 7 Discussion 2Conflict and ChangeResourcesDiscuss.docxmelbruce90096
[u07d2] Unit 7 Discussion 2
Conflict and Change
Resources
Discussion and Participation Scoring Guide
.
Change is part of our lives. Change is viewed as positive and negative. It is accompanied with excitement and confidence, opportunity, progress, growth, innovation, fear and anxiety, upheaval, threat, and unpredictability. People react to change differently.
Based on the assigned readings, briefly answer the following questions.
List and explain the three approaches to change.
Explain the dynamics of change as you see it.
.
[removed]1.Which of the following processes addresses when to sp.docxmelbruce90096
[removed]
1.
Which of the following processes addresses when to speak, what to say, and how to organize one's message?
a.
b.
c.
d.
e.
2.
When a speaker uses supporting material based on what he or she has seen or heard, that type of support is called:
a.
b.
c.
d.
e.
3.
When a room is too large, you can enhance the volume of your voice by using:
a.
b.
c.
d.
e.
4.
A speaker can combat the problem of the audience's limited attention span by:
a.
b.
c.
d.
5.
Parallel statements at the same level of importance in the outline are:
a.
b.
c.
d.
6.
A simplified drawing or sketch that resembles a more complex object is known as a:
a.
b.
c.
d.
7.
When your audience analysis focuses on the perceptual processes of the audience, including their tendencies toward selective exposure and selective attention, you are assessing audience:
a.
b.
c.
d.
8.
When asked to deliver a speech for which you are allowed to decide the purpose, you should assess how the:
a.
b.
c.
d.
e.
9.
Public speaking is a communication process that can best be described as a(n):
a.
b.
c.
d.
e.
10.
All of the following are goals of research in preparation for a speech, except:
a.
b.
c.
d.
e.
11.
Which of the following is not good advice when preparing to deliver your speech?
a.
b.
c.
d.
12.
When group reports are presented orally to others, the occasion is called:
a.
b.
c.
d.
e.
13.
What is an internal summary?
a.
b.
c.
d.
14.
Which element of the body in delivery not only helps communicate effectively to the audience, but also provides feedback to the speaker regarding the audience's response to the speech?
a.
b.
c.
d.
15.
In order to respond appropriately to the rhetorical situation, you need to develop a(n) __________ that identifies the purpose of your speech.
a.
b.
c.
d.
16.
Informative strategies ask listeners to:
a.
b.
c.
d.
e.
17.
When analyzing the four factors of the rhetorical situation, which of the following characteristics is a concern for the speaker?
a.
b.
c.
d.
e.
18.
Careful listening relies on two techniques:
a.
b.
c.
d.
e.
19.
The process of invention involves:
a.
b.
c.
d.
20.
When a speech is well-suited to the expectations of a particular occasion, it has the quality of:
a.
b.
c.
d.
e.
21.
The principle of the residues pattern of arrangement is best reflected in which of the following phrases?
a.
b.
c.
d.
22.
Which of the following conditions give rise to deliberative speaking?
a.
b.
c.
d.
23.
Which of the following resources does not help to create vividness in a speech?
a.
b.
c.
d.
24.
Which of the following represent the two types of testimony?
a.
b.
c.
d.
25.
Which type of outline is made simple and brief to provide a memory aid while delivering the speech?
a.
b.
c.
d.
e.
26.
Organization is important for all of the following reasons, except:
a.
b.
c.
d.
e.
27.
Hearing is the __________ sounds.
a.
b.
c.
d.
e.
28.
The .
Your paper should be a literary essay in which you present a combina.docxmelbruce90096
Your paper should be a literary essay in which you present a combination of primary and secondary research. Use MLA style for formatting (margins, spacing, numbering pages, heading, title etc.) and citing sources (parenthetical notes and works cited page)
Choose an English Romantic writer (William Wordsworth)
Choose a work by that writer as the focus of your research (Tintern Abbey)
Analyze and interpret the work to plan our approach to it and do some preliminary reading to evaluate the topic.
8 pages 4 secondary sources
.
[removed]1.Photographs are an important source of data because t.docxmelbruce90096
[removed]
1.
Photographs are an important source of data because they:
a.
b.
c.
d.
2.
The Ju/'hoansi are best described as a band because:
a.
b.
c.
d.
3.
A bifurcate kinship system is one where:
a.
b.
c.
d.
4.
The "honeymoon" phase in anthropological fieldwork can be described as a:
a.
b.
c.
d.
5.
Theoretical models in anthropology are:
a.
b.
c.
d.
6.
If your informant describes how her peers treat her differently because her father is an important film star, this is termed her __________ status.
a.
b.
c.
d.
7.
Rank societies are those where individuals gain prestige and wealth by using:
a.
b.
c.
d.
8.
Agriculturally based societies are primarily associated with which of the following economic institution(s)?
a.
b.
c.
d.
9.
An anthropologist that includes his or her thoughts about what he or she sees as well as quotations from his or her informants is presenting what type of ethnography?
a.
b.
c.
d.
10.
Anthropological interest in sexuality can be traced back to which of the following anthropologists?
a.
b.
c.
d.
11.
Which of the following chromosomal pairs shows that an individual is male?
a.
b.
c.
d.
12.
A key informant is selected using a:
a.
b.
c.
d.
13.
Which of the following situations is considered a suitable fieldwork setting for an anthropologist?
a.
b.
c.
d.
14.
The most common kinship system in North America today consists of __________ descent groups known as __________.
a.
b.
c.
d.
15.
Members of the Yurok, Karuk, Hupa, and Tolowa use valued items such as obsidian blades, white deer skins, and elaborately carved paddles and spoons to:
a.
b.
c.
d.
16.
The production maximization model of intensive agriculture strives to maximize production through:
a.
b.
c.
d.
17.
Forensic anthropologists apply their knowledge to legal issues by studying what materials?
a.
b.
c.
d.
18.
The Zuni recognize the berdache gender person as being:
a.
b.
c.
d.
19.
The Zuni recognize the berdache gender person as being:
a.
b.
c.
d.
20.
Initial attempts by AID to bring about reforestation in Haiti failed because:
a.
b.
c.
d.
21.
What type of evidence is used to analyze the evolutionary model of human cultural adaptations?
a.
b.
c.
d.
22.
The four fields of anthropology are:
a.
b.
c.
d.
23.
The description of a single society based on fieldwork is called a(n):
a.
b.
c.
d.
24.
A societal type common in foraging groups and marked by egalitarian social structure and lack of specialization is a:
a.
b.
c.
d.
25.
Among the New Zealand Maori, facial tattoos communicated all of the following, EXCEPT:
a.
b.
c.
d.
26.
The advantages of polygyny across cultures include all of the following, EXCEPT:
a.
b.
c.
d.
27.
Every aspect of culture influences every other aspect of that culture. Thus culture is:
a.
b.
c.
d.
28.
An informant tells a fieldworker that the preferred marriage custom in his culture is for a man to marry his mother's brot.
Your paper should address the following questionsWhen you hear th.docxmelbruce90096
Your paper should address the following questions:
When you hear the word “scientist” what do you envision? Which famous people or characters from the media come into your mind? What characteristics do they have in common? Discuss at least three characteristics of your vision of a scientist.
Has your image of what a scientist does and how they look changed over time? If so, how has this changed and what influenced you?
Are fictional scientists usually the heroes, villains, or a combination of the two? Provide at least two detailed examples to support your position.
How is science portrayed in fictional media (television shows, movies, music, books, etc.)? Is it seen as a positive, negative, or neutral force in the world? Give specific examples supporting your position.
Do you think the portrayal of scientists in the various forms of media influences how society views people in this profession? Why, or why not?
Can the portrayal of science in media influence how certain research and technology is viewed, and accepted, by the general public (e.g., cloning)?
Your Final Project should be written in an essay format, with an introduction and conclusion. The paper will require you to include details from research including the course materials and sources you locate on your own. Use APA format to cite your sources of information, both within parenthetical citations and also within a reference page at the end of the project.
Basic Writing Expectations:
A minimum of 1,500 words, not counting the title or reference pages
At least 3 academic resources utilized
Include a title page, double space, font size 10 or 12
Include a highly developed viewpoint/thesis, purpose, and exceptional content
Demonstrate superior organization: use logic
Free of grammar and spelling errors
No evidence of plagiarism.
Note:
no more than 10% of your paper should be direct quotes
Use the APA style for all in-text citations, references, and body of paper
.
Your Final Project from this course will enable you to compare cultu.docxmelbruce90096
Your Final Project from this course will enable you to compare cultural viewpoints toward death and dying in Western society to those in other parts of the world.
Final Project Information
Overview
Your Final Project will be a medium-length essay in which you address the cultural viewpoints toward death and dying in Western society and compare these to the perspectives toward death and dying in other parts the world. As the course content will point out, much about the Western response to death and dying amplifies the process of grief and bereavement, perhaps unnecessarily. In the West, death is something that is denied and, in many ways, is something that people seem ill-equipped to deal with once the event occurs or is imminent. Your job in this paper will be to put on your social scientist cap and offer “cultural solutions” to the way that death and dying is dealt with in Western society.
Assignment
Based on your own independent research in which you compare the cultural beliefs toward death and dying in Western societies to those in Eastern societies such as China, Vietnam, Japan, and so forth, write an essay that addresses the following points:
Describe in detail the major differences between the Western viewpoint toward death and dying and those in these Eastern societies (you may focus on one country, such as China, or talk about Eastern societies more generally). Be sure to describe the rituals involved with the process of death and dying, the various technologies, or anything that helps explain these differences.
Give one specific example of a famous case of death and dying in Western society that demonstrates some of the problems or dysfunctions of the Western viewpoint (examining cases in the media, for example, will be a great place to start!).
Finally, conclude your final paper with a detailed commentary about what we can do to change the cultural beliefs toward death and dying in Western societies in a way that makes us less afraid of the dying process. Be very specific in your commentary.
.
Your Final Paper is to be a comprehensive research study on one of t.docxmelbruce90096
Your Final Paper is to be a comprehensive research study on one of the following public policy topics:
Environmental Concerns
Immigration
Health Care
Primary and Secondary Public Education
Social Security
Welfare
Your analysis of the topic will include:
The scope and nature of the public policy problem.
How the problem came to public and political awareness.
The evolution of related public policy.
Level of government and the actors involved.
The intergovernmental structure and political concerns.
Conflicting public opinion and impact on policy solutions.
The approaches to policy formulation, adoption, and evaluation.
The suggested policy direction (continuation, change or termination) and future impact.
Writing the Final Paper
The Final Paper:
Must be eight to ten double-spaced pages in length (including title and reference pages), and formatted according to APA style as outlined in the Ashford Writing Center.
Must include a title page with the following:
Title of paper
Student’s name
Course name and number
Instructor’s name
Date submitted
Must begin with an introductory paragraph that has a succinct thesis statement.
Must address the topic of the paper with critical thought.
Must end with a conclusion that reaffirms your thesis.
Must use at six to ten scholarly sources, including a minimum of four from the Ashford University Library.
Must document all sources in APA style, as outlined in the Ashford Writing Center.
Must include a separate reference page, formatted according to APA style as outlined in the Ashford Writing Center
.
Your director is not aware of the involvement of the Department of H.docxmelbruce90096
Your director is not aware of the involvement of the Department of Homeland Security (DHS) with private enterprise and has requested an information paper that provides her with an explanation about why this is important and how the DHS engages private enterprise in the protection of critical infrastructure and key resources (CIKR). Provide at least 1 example of each program that addresses state, local, tribal, and territorial (SLTT) governments, private enterprises, and individuals in the following DHS mission areas:
Prevention
Response
Recovery
.
YOull need to know The purpose of this research is to focus atte.docxmelbruce90096
YOu'll need to know:
The purpose of this research is to focus attention on how to help newly brought children adapt to the new environment at the child care, given that the children have never been to such environments before.
Content Expectations
Forms of Data (1.5 Points
): In two-to-three paragraphs, describe the multiple forms of data that you will collect (observations, interviews, artifacts, etc.) and how this information will inform your research.
Value of Data (2.5 Points):
In two-to-three paragraphs, explain the value of the selected forms of data and how this information will inform the focus and research questions.
.
Your draft should establish and develop a single thesis [or co.docxmelbruce90096
Your draft should establish and develop a single thesis [or controlling idea], develop in parts. You may also write from the earlier handout on an author you haven’t yet written about.
Gandhi’s “Economic and Moral Progress” suggests that morality and economic prosperity do not go hand in hand. In fact, he argues, oftentimes, one loses one’s morality when one becomes wealthy. Do you agree with Gandhi? Does wealth correlate with immorality? Yes or no. Explain by referring to passages from the essay.
Compare David Suzuki’s understanding of interdependence [interconnectedness] with Ricard and Thuan’s.
Discuss the ways in which Gandhi supports his argument—first with historical examples, then with famous people, then by using the writing of a famous scientist. Is his essay more effective as he adds this type of support?
Desmond Tutu describes South Africa’s decision to seek a middle path between two extremes. What are these extremes and what is this middle path? Is Tutu right in arguing for this road down the middle?
Compare Desmond Tutu’s “middle path” with the teachings of Lao Tzu. Does Lao Tzu advocate a similar position? You might include other famous historical figures who’ve argued a similar position.
David Suzuki’s “The Sacred Balance” appears to be in two parts: first, he identifies the problem in three parts, then he identifies the solution in three parts. What is the essential problem and what is Suzuki’s solution?
Tom Shadyac’s film, “I Am” has a central thesis and advocates a certain solution. What is the basic thesis of the film and what is the solution or solution[s] he advocates? What’s the basic problem and what’s the answer? And how does he convince the audience of these truths?
Kenzaburo Oe develops a very smart and very controversial thesis. What is his thesis and what exactly does he refer to in an attempt to develop, support that thesis.
Kenzaburo Oe discusses the Great Flood [Noah] at the end of his essay and identifies something very troubling about the Western mind. What is this thing he is identifying here? How does it relate to the overall theme of the essay [man’s inhumanity to man]?
Rachel Carson’s “Obligation to Endure” identifies large increases in human populations that create conditions in which insects and other forms of life must be controlled. Name a few of these patterns of behavior that cause an increase in the amount of insects among us.
Identify Rachel Carson’s thesis and her solution. What’s the problem she outlines and what does she propose we do?
How do Carson’s ideas seem to influence David Suzuki? Are they on to the same problems? How are they similar or different?
Plato’s Gorgias is a discussion of the problem of rhetoric and the need for conversation. What is rhetoric, according to Plato, and why is it so dangerous? Does he convince the reader that discourse [words] can be used inappropriately and in dangerous ways?
Discuss any of the questions that follow the readings [Understa.
Your company has just hired your foreign friend to work in a middle-.docxmelbruce90096
Your company has just hired your foreign friend to work in a middle-management position. Since you have lived in the United States for many years, your friend believes that you understand job coaching for a traditional American company. She wants to work with you and has many questions—some of which concern the manner in which cultural nuances related to religious customs, verbal and nonverbal communication, etc. may affect leadership roles.
Write a five to seven (5-7) page paper in which you:
Recommend whether or not your friend should insert herself as a coach from the beginning. Provide a rationale for your response.
Determine two (2) conflicts that could possibly arise as a result of asking people to work on days of religious significance. Propose concrete solutions for these two (2) possible conflicts.
Determine whether or not cultural quirks could restrain the foreign manager from expressing his or her ideas readily. Provide a rationale for your response.
Determine two (2) actions that you can take in order to prepare yourself and your friend to become multicultural leaders. Provide two (2) examples to support your response.
Predict two (2) major conflicts that may arise out of nonverbal communication misunderstandings (e.g., words misinterpreted, hand gestures, looks, shoulder shrugs, names of objects, etc.). Suggest two (2) actions that your friend could take in order to diffuse these types of misunderstandings and thus make the workplace more harmonious. Justify your response.
Use at least five (5) quality academic resources in this assignment. Note: Wikipedia does not qualify as an academic resource.
Please DO NOT use "I, me, you, us, or we" in the research paper.
Please include a introduction paragraph.
Your assignment must follow these formatting requirements:
Be typed, double spaced, using Times New Roman font (size 12), with one-inch margins on all sides; citations and references must follow APA or school-specific format. Check with your professor for any additional instructions.
.
Your boss has asked you to write a Project Management Plan. Your pla.docxmelbruce90096
Your boss has asked you to write a Project Management Plan. Your plan should contain the following sections:
Initiating
Planning
Executing
Monitoring and Controlling
Closing
In addition, your plan should touch upon the following components:
Integration
Cost
Human resources
Stakeholder management
Scope
Quality
Communications
Time
Procurement
Risk management
.
Your boss has chosen you to give a presentation to a number of forei.docxmelbruce90096
Your boss has chosen you to give a presentation to a number of foreign officials (We have Chosen Italy) regarding the United States Federal Reserve System. These officials are very interested in doing business in the United States, but they would like to learn more about the Federal Reserve and how it operates as compared to the official's home country.
*
Your instructor will provide a list of countries from which you may select as the home country of the "foreign officials".
Develop
a 3- to 4-slide Microsoft
®
PowerPoint
®
presentation including detailed speaker notes.
Incorporate
any feedback from peer review discussion.
Address
the following questions and include a notes page which contains the write-up portion to each question:
How does monetary policy aim to avoid inflation?
How does monetary policy control the money supply?
How does a stimulus program (through the money multiplier) affect the money supply?
Format
consistent with APA guidelines including a reference slide.
.
your assignment is to submit a presentation on Native-American liter.docxmelbruce90096
your assignment is to submit a presentation on Native-American literature. You may choose ONE of the stories below..
"The Shawl"
"The Years of My Birth"
Here are the specifications for the assignment:
1. Please submit your presentation to the Presentation Drop Box under Module 4 Hispanic-American Literature. The deadline is 12/05.
2. Your presentation will consist of a PowerPoint or Prezi. The format MUST allow for video clips to be incorporated. In order to fulfill the oral communication component of this course, you will videotape yourself speaking onto a camera or record yourself speaking. Please submit an mp3 file, not a wave file, and include this video or audio clip in your presentation. Audio is required.
3. The presentation should include:
A. First slide with your name and the story or poem you selected for your presentation.
B. Slides that show your research of a minimum of 3 facts or statistics that help enhance our understanding of Native American/ Hispanic/ African-American literature, culture, history, or traditions (depending on your last name, you will focus on one of these types of literature. Please see above). Please explain HOW these 3 facts relate to the story or poem you chose to discuss. Please provide MLA citation regarding where the facts and statistics came from (URL or article you found).
B. Please include one video clip of the author and/or historic event related to the poem or story you are presenting on.
C. Please present 2 ways in which the story or poem you chose relates to ONE literary criticism theory.
(Please see Introduction to Literary Analysis Folder under Content.) You can do this orally in video and/or audio.
D. Please audiotape yourself for 5 minutes speaking to us about the literary theory that applies to the story or poem you have chosen for your presentation. This video or audio clip should be included with your presentation or prezi.
F. On the video of yourself, please ask one question you have about the story or poem and provide a possible answer.
This presentation will be graded on:
-- complete information required
-- clarity of oral presentation
-- use of video and/or audio
-- research and explanation of literary theoy
-- analysis of story or poem.
.
Your assignment is to report on TWO cultural experience visits y.docxmelbruce90096
Your assignment is to report on TWO "cultural experience" visits you make during this term. After each visit, write a 500-800 word report about the visit and what you learned.
Your instructor may modify this assignment.
Instructions
For your two reports, attend two different venues from this list.
art museum or sculpture garden
significant or notable architectural site (if there is explanatory material there to help you understand it)
music concert
theater play
poetry reading or spoken word performance
dance performance
religious service, ceremony or ritual for a religion very different from yours, if you practice (for instance, if you are Christian, you may not go to another Christian denomination's service)
other displays or performances may be acceptable. Check with your instructor for approval beforehand.
Restrictions: The experience should be done in person. If this is impossible, contact the instructor to arrange for alternatives. You may not report on a cultural experience from prior to this class.
Write a report after each cultural experience (Cultural Experience Report #1 and #2).
Each report should include the following information. Include photos or links that help convey the information. As always, be sure to document all sources you consult in preparing your work.
Name and location of the museum, site, or performance event. If there is on-line information about the site or performance, include a link.
Type of museum, site or event. For example, is it a portrait museum, a poetry slam, an outdoor Shakespeare festival performance? If you attended a performance, name the performer or the piece. Be specific about what you attended, when, and where.
Briefly describe the general setting.
Describe at least one aspect of the experience that you found especially interesting. For example, you might write about a particular work of art, cultural artifact, song, dance section, scene in a play, costumes or lighting, a particular actor or vocalist, etc. Explain what impressed you, and why. Your reaction can be positive or negative, as long as you offer an explanation.
Identify and use at least two things you've learned in class in your essay. For example, if you visit a museum, you might point out the architectural style, discuss an artist you've learned about in the course, or tie your experience to a class discussion.
Reflect on the relevance--if any--of your experience to your everyday life. How did the experience engage your feelings or emotions, if at all? What does this tell you about human culture, or about yourself?
.
your article must be a research article You can tell it is a researc.docxmelbruce90096
your article must be a research article You can tell it is a research journal article, and not just an editorial article, because a research article will have the
7 parts of a research article
(i.e.
Title, Abstract, Introduction, Methods, Results, Discussion, References
). Once you have chosen your research journal article, then write up a 3-4 page analysis of your chosen research article answering the questions in the
“Reading a Research Article”
(attached to this page)
.
.
Your administrator has come to you for information for a present.docxmelbruce90096
Your administrator has come to you for information for a presentation regarding electronic health records to the Board of Directors at your facility. Your administrator wants you to explain what the difference between ICD-9/ICD-10 and SNOMed as related to the EHRs. What would you tell them and what 2 primary points would you want to identify and why?
.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
The Indian economy is classified into different sectors to simplify the analysis and understanding of economic activities. For Class 10, it's essential to grasp the sectors of the Indian economy, understand their characteristics, and recognize their importance. This guide will provide detailed notes on the Sectors of the Indian Economy Class 10, using specific long-tail keywords to enhance comprehension.
For more information, visit-www.vavaclasses.com
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxEduSkills OECD
Andreas Schleicher presents at the OECD webinar ‘Digital devices in schools: detrimental distraction or secret to success?’ on 27 May 2024. The presentation was based on findings from PISA 2022 results and the webinar helped launch the PISA in Focus ‘Managing screen time: How to protect and equip students against distraction’ https://www.oecd-ilibrary.org/education/managing-screen-time_7c225af4-en and the OECD Education Policy Perspective ‘Students, digital devices and success’ can be found here - https://oe.cd/il/5yV
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
This is a presentation by Dada Robert in a Your Skill Boost masterclass organised by the Excellence Foundation for South Sudan (EFSS) on Saturday, the 25th and Sunday, the 26th of May 2024.
He discussed the concept of quality improvement, emphasizing its applicability to various aspects of life, including personal, project, and program improvements. He defined quality as doing the right thing at the right time in the right way to achieve the best possible results and discussed the concept of the "gap" between what we know and what we do, and how this gap represents the areas we need to improve. He explained the scientific approach to quality improvement, which involves systematic performance analysis, testing and learning, and implementing change ideas. He also highlighted the importance of client focus and a team approach to quality improvement.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
We all have good and bad thoughts from time to time and situation to situation. We are bombarded daily with spiraling thoughts(both negative and positive) creating all-consuming feel , making us difficult to manage with associated suffering. Good thoughts are like our Mob Signal (Positive thought) amidst noise(negative thought) in the atmosphere. Negative thoughts like noise outweigh positive thoughts. These thoughts often create unwanted confusion, trouble, stress and frustration in our mind as well as chaos in our physical world. Negative thoughts are also known as “distorted thinking”.
Ethnobotany and Ethnopharmacology:
Ethnobotany in herbal drug evaluation,
Impact of Ethnobotany in traditional medicine,
New development in herbals,
Bio-prospecting tools for drug discovery,
Role of Ethnopharmacology in drug evaluation,
Reverse Pharmacology.
1. 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:
2. • 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
3. 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
4. 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
5. do_fork
The do_fork function begins with a call to alloc_pidmap, which
allocates a new PID.
The do_fork function then calls copy_process, passing the flags,
stack, registers, parent process, and newly allocated PID.
The copy_process function is where the new process is created
as a copy of the parent. This function performs all actions
except for starting the process
Copying the process
Next, dup_task_struct allocates a new task_struct and copies the
current process's descriptors into it.
After a new thread stack is set up, control returns to
copy_process. A sequence of copy functions is then invoked to
copy, open file descriptors, signal information, process memory
and finally the thread.
The new task is then assigned to a processor. The priority of the
new process inherits the priority of the parent, and control
returns to do_fork. At this point, your new process exists but is
not yet running.
The do_fork function fixes this with a call to
wake_up_new_task. This function places the new process in a
run queue, then wakes it up for execution.
6. Finally, upon returning to do_fork, the PID value is returned to
the caller and the process is complete.
Part 3
Process management
Process Management
A program is an executable file, whereas a process is a running
program.
A process is an instance of a program in memory, executing
instructions on the processor.
The only way to run a program on a Unix/Linux system is to
request the kernel to execute it via an exec() system call.
Remember that the only things that can make system calls are
processes (binary programs that are executing.)
Scheduler
The scheduler manages processes and the fair distribution of
CPU time between them.
The kernel classifies processes as being in one of two possible
queues at any given time: the sleep queue and the run queue.
Run Queue
Processes in the run queue compete for access to the CPU.
The processes in the run queue compete for the processor(s). It
is the schedulers' job to allocate a time slice to each process,
and to let each process run on the processor for a certain
amount of time in turn.
7. Each time slice is so short (fractions of a second) that each
process in the run queue gets to run often every second. It
appears as though all of these processes are "running at the
same time". This is called round robin scheduling.
On a uniprocessor system, only one process can execute
instructions at any one time.
Only on a multiprocessor system can true multiprocessing
occur, with more than one process (as many as there are CPUs)
executing instructions simultaneously.
Classes of scheduling
There are different classes of scheduling besides round-robin.
An example would be real-time scheduling.
Different Unix systems have different scheduling classes and
features, and Linux is no exception.
Sleep queue
Processes waiting for a resource wait on the sleep queue. These
processes do not take up a slot on the run queue
Once the resource becomes available, it is reserved by the
process, which is then moved back onto the run queue to wait
for a turn on the processor.
Every process waiting for a resource is placed on the sleep
queue, including new processes, whose resources still have to
be allocated, even if they are readily available.
8. Queue management
Time-slicing
Each 10 milli-seconds (This may change with the HZ value) an
Interrupt comes on IRQ0, which helps us in a multitasking
environment.
The interrupt signal to the CPU comes from PIC (Programmable
Interrupt Controller).
With each Time-slice the current process execution is
interrupted (without task switching), and the processor does
housekeeping then the current process is re-activated unless a
higher priority process is waiting.
When does switching occur?
Some examples are:
• When a Time Slice ends the scheduler gives access to another
process
• If needing a resource, the process will have to go back into the
sleep queue to wait for or to be given access to that resource,
and only then would it be ready to be scheduled access to the
processor again.
• If we have a process waiting for information from another
process in the form of piped information. That process would
have to run before this process can continue, so the other
9. process would be given priority for the processor.
Process destruction
Process destruction can be driven by several events:
normal process termination,
through a signal
through a call to the exit function.
However process exit is driven, the process ends through a call
to the kernel function do_exit
This process is shown graphically in the next slide
Function hierarchy for process destruction
do_exit
do_exit removes all references to the current process from the
operating system
The cycle of detaching the process from the various resources
that it attained during its life is performed through a series of
calls, including exit_mm (to remove memory pages) to
exit_keys (which disposes of per-thread session and process
security keys).
The do_exit function performs various accountings for the
disposal of the process, then a series of notifications
Finally, the process state is changed to PF_DEAD, and the
schedule function is called to select a new process to execute.
Time slice
10. When a process's time slice has run out or for some other reason
another process gets to run, it is suspended (placed on the sleep
or run queue).
It’s state is stored in task_struct, so that when it gets a turn
again. This enables the process to return to the exact place
where it left off.
System Processes
In addition to user processes, there are system processes
running.
Some deal with managing memory and scheduling turns on the
CPU. Others deal with delivering mail, printing.
In principle, both of these kinds of processes are identical.
However, system processes can run at much higher priorities
and therefore run more often than user processes.
Typically a system process of this kind is referred to as a
daemon process because they run without user intervention.
Filesystems
Under Linux, files and directories are grouped into units called
filesystems. Filesystems exist within a section of the hard disk
called a partition.
Each hard disk can be broken down into multiple partitions and
a filesystem is created within the partition. (Some dialects of
UNIX allow multiple filesystems within a partition.)
The Life Cycle of Processes
11. http://linux-
tutorial.info/modules.php?name=MContent&pageid=84
From the time a process is created with a fork() until it has
completed its job and disappears from the process table, it goes
through many different states. The state a process is in changes
many times during its "life." These changes can occur, for
example, when the process makes a system call, it is someone
else's turn to run, an interrupt occurs, or the process asks for a
resource that is currently not available.
A commonly used model shows processes operating in one of
six separate states:
executing in user mode
executing in kernel mode
ready to run
sleeping
newly created, not ready to run, and not sleeping
issued exit system call (zombie)
Device Files
In Linux, almost everything is either treated as a file or is only
accessed through files.
For example, to read the contents of a data file, the operating
system must access the hard disk. Linux treats the hard disk as
if it were a file. It opens it like a file, reads it like a file, and
closes it like a file. The same applies to other hardware such as
tape drives and printers. Even memory is treated as a file. The
files used to access the physical hardware are device files.
When the Linux wants to access any hardware device, it first
opens a file that "points" toward that device (the device node).
Based on information it finds in the inode, the operating system
determines what kind of device it is and can therefore access it
12. in the proper manner. This includes opening, reading, and
closing, just like any other file.
Process states
State Diagram
State transitions
A newly created process enters the system in state 5.
If an exec() is made, then this process will end up in kernel
mode (2).
When a process is running, an interrupt may be generated (more
often than not, this is the system clock) and the currently
running process is pre-empted (3).
This is the same state as state 3 because it is still ready to run
and in main memory.
More Transitions
When the process makes a system call while in user mode (1), it
moves into state 2 where it begins to run in kernel mode.
Assume at this point that the system call made was to read a file
on the hard disk. Because the read is not carried out
immediately, the process goes to sleep, waiting on the event
that the system has read the disk and the data is ready. It is now
in state 4.
13. When the data is ready, the process is awakened. This does not
mean it runs immediately, but rather it is once again ready to
run in main memory (3).
If a process that was asleep is awakened (perhaps when the data
is ready), it moves from state 4 (sleeping) to state 3 (ready to
run). This can be in either user mode (1) or kernel mode (2).
End
A process can end its life by either explicitly calling the exit()
system call or having it called for them.
The exit() system call releases all the data structures that the
process was using.
One exception is the slot in the process table, which is the
responsibility of the init process. The slot in the process table is
used for the exit code of the exiting process. This can be used
by the parent process to determine whether the process did what
it was supposed to do or whether it ran into problems.
The process shows that it has terminated by putting itself into
state 8, and it becomes a "zombie." Once here, it can never run
again because nothing exists other than the entry in the process
table.
This is why you cannot "kill" a zombie process. There is
nothing there to kill. To kill a process, you need to send it a
signal (more on signals later). Because there is nothing there to
receive or process that signal, trying to kill it makes little sense.
The only thing to do is to let the system clean it up.
14. Access to a resource
Processes waiting for a common resource all wait on the same
wait channel. All are woken up when the resource is ready.
Only one process gets the resource. The others put themselves
back to sleep on the same wait channel.
When a process puts itself to sleep, it voluntarily gives up the
CPU. It may be that this process had just started its turn when it
couldn’t access the resource it needed.
Signals
Signals are a way of sending simple messages to processes.
Most of these messages are already defined and can be found in
<linux/signal.h>. Most are generated in the kernel
Signals can only be processed when the process is in user
mode. If a signal has been sent to a process that is in kernel
mode, it is dealt with immediately on returning to user mode.
Signals -2
Signals are used to signal asynchronous events to one or more
processes. A signal could be generated by a keyboard interrupt
or an error condition such as the process attempting to access a
non-existent location in its virtual memory.
Signals are also used by the shells to signal job control
commands to their child processes.
There are a set of defined signals that the kernel can generate or
that can be generated by other processes in the system, provided
that they have the correct privileges.
15. Signals - 3
Linux implements signals using information stored in the
task_struct for the process. The number of supported signals is
limited to the word size of the processor.
The currently pending signals are kept in the signal field with a
mask of blocked signals held in blocked. With the exception of
SIGSTOP and SIGKILL, all signals can be blocked.
If a blocked signal is generated, it remains pending until it is
unblocked.
Linux also holds information about how each process handles
every possible signal and this is held in an array of sigaction
data structures pointed at by the task_struct for each process.
Amongst other things it contains either the address of a routine
that will handle the signal or a flag which tells Linux that the
process either wishes to ignore this signal or let the kernel
handle the signal for it.
The process modifies the default signal handling by making
system calls and these calls alter the sigaction for the
appropriate signal as well as the blocked mask.
Problems with earlier Linux schedulers
Before the 2.6 kernel, the scheduler had a significant limitation
when many tasks were active. This was due to the scheduler
being implemented using an algorithm with O(n) complexity. In
other words, the more tasks (n) are active, the longer it takes to
schedule a task. At very high loads, the processor can be
consumed with scheduling and devote little time to the tasks
themselves.
16. The pre-2.6 scheduler also used a single runqueue for all
processors in a symmetric multiprocessing system (SMP). This
meant a task could be scheduled on any processor -- which can
be good for load balancing but bad for memory caches
Finally, preemption wasn't possible in the earlier scheduler; this
meant that a lower priority task could execute while a higher
priority task waited for it to complete.
Introducing the Linux 2.6 scheduler
The 2.6 scheduler resolves the primary three issues found in the
earlier scheduler (O(n) and SMP scalability issues), as well as
other problems. Now we'll explore the basic design of the 2.6
scheduler.
Major scheduling structures
Each CPU has a runqueue made up of 140 priority lists that are
serviced in FIFO order.
Tasks that are scheduled to execute are added to the end of their
respective runqueue's priority list.
Each task has a time slice that determines how much time it's
permitted to execute.
The first 100 priority lists of the runqueue are reserved for real-
time tasks, and the last 40 are used for user tasks (see next
slide).
Priority lists
expired active
Runqueues
In addition to the CPU's runqueue, which is called the active
17. runqueue, there's also an expired runqueue.
When a task on the active runqueue uses all of its time slice, it's
moved to the expired runqueue. During the move, its time slice
is recalculated.
If no tasks exist on the active runqueue for a given priority, the
pointers for the active and expired runqueues are swapped, thus
making the expired priority list the active one.
The job of the scheduler is simple: choose the task on the
highest priority list to execute.
http://www.linuxjournal.com/article/7477
By Aseem R. Deshpande
With the release of kernel 2.6, Linux now poses serious
competition to major RTOS vendors in the embedded market
space.
Linux 2.6 introduces many new features that make it an
excellent operating system for embedded computing.
Among these new features are enhanced real-time performance,
easier porting to new computers, support for large memory
models, support for microcontrollers and an improved I/O
system.
Characteristics of Embedded Systems
Embedded systems often need to meet timing constraints
reliably.
,embedded systems have access to far fewer resources than does
a normal PC. They have to squeeze maximum value out of
whatever is available.
18. . The OS should perform reliably and efficiently, if possible,
under the cases of extreme load.
If a crash occurs in one part of the module, it should not effect
other parts of the system. Furthermore, recovery from crashes
should be graceful.
How Linux 2.6 Satisfies the Requirements
Although Linux 2.6 is not yet a true real-time operating system,
it does contain improvements that make it a worthier platform
than previous kernels when responsiveness is desirable.
Three significant improvements are preemption points in the
kernel, an efficient scheduler and improved synchronization.
Kernel Preemption
As with most general-purpose operating systems, Linux always
has forbidden the process scheduler from running when a
process is executing in a system call. Therefore, once a task is
in a system call, that task controls the processor until the
system call returns, no matter how long that might take.
As of kernel 2.6, the kernel is preemptible. A kernel task now
can be preempted, so that some important user application can
continue to run.
In Linux 2.6, kernel code has been laced with preemption
points, instructions that allow the scheduler to run and possibly
block the current process so as to schedule a higher priority
process.
Kernel Preemption
19. Linux 2.6 avoids unreasonable delays in system calls by
periodically testing a preemption point. During these tests, the
calling process may block and let another process run.
Thus, under Linux 2.6, the kernel now can be interrupted mid-
task, so other applications can continue to run even when
something low-level and complicated is going on in the
background.
Embedded software often has to meet deadlines that renders it
incompatible with virtual memory demand paging, in which
slow handling of page faults would ruin responsiveness.
To eliminate this problem, the 2.6 kernel can be built with no
virtual memory system. Of course, it then becomes the software
designer's responsibility to ensure enough real memory always
is available to get the job done.
An Efficient Scheduler
The process scheduler has been rewritten in the 2.6 kernel to
eliminate the slow algorithms of previous versions.
Formerly, in order to decide which task should run next, the
scheduler had to look at each ready task and make a
computation to determine that task's relative importance.
After all computations were made, the task with the highest
score would be chosen.
Because the time required for this algorithm varied with the
number of tasks, complex multitasking applications suffered
from slow scheduling.
20. 2.6 improvements
The scheduler in Linux 2.6 no longer scans all tasks every time.
Instead, when a task becomes ready to run, it is sorted into
position on a queue, called the current queue.
Then, when the scheduler runs, it chooses the task at the most
favorable position in the queue. As a result, scheduling is done
in a constant amount of time.
When the task is running, it is given a time slice, or a period of
time in which it may use the processor, before it has to give
way to another thread.
When its time slice has expired, the task is moved to another
queue, called the expired queue.
The task is sorted into this expired queue according to its
priority. This new procedure is substantially faster than the old
one, and it works equally as well whether there are many tasks
or only a few in queue. This new scheduler is called the O(1)
scheduler.
New Synchronization Primitives
Applications involving the use of shared resources, such as
shared memory or shared devices, have to be developed
carefully to avoid race conditions.
The solution implemented in Linux, called Mutex, ensured that
only one task is using the resource at a time. Mutex involved a
system call to the kernel to decide whether to block the thread
or allow it to continue executing.
But when the decision is to continue, the time-consuming
21. system call was unnecessary. The new implementation in Linux
2.6 supports Fast User-Space Mutexes (Futex). These functions
can check from user space whether blocking is necessary and
perform the system call to block the thread only when it is
required.
When blocking is not required, avoiding the unneeded system
call saves time. It also supports setting priorities to allow
applications or threads of higher priority to have first access to
the contested resource.
Improved Threading Model and Support for NPTL
threading in 2.6 is based on a 1:1 threading model, one kernel
thread for one user thread. It also includes in-kernel support for
the new Native Posix Threading Library (NPTL).
NPTL brings an eight-fold improvement over its predecessor.
Tests conducted by its authors have shown that Linux, with this
new threading, can start and stop 100,000 threads
simultaneously in about two seconds. This task took 15 minutes
on the old threading model.
Along with POSIX threads, 2.6 provides POSIX signals and
POSIX high-resolution timers as part of the mainstream kernel.
POSIX signals are an improvement over UNIX-style signals,
which were the default in previous Linux releases. Unlike UNIX
signals, POSIX signals cannot be lost and can carry information
as an argument. Also, POSIX signals can be sent from one
POSIX thread to another, rather than only from process to
process, like UNIX signals.
Embedded systems often need to poll hardware or do other tasks
on a fixed schedule. POSIX timers make it easy to arrange any
task to be scheduled periodically. The clock that the timer uses
can be set to tick at a rate as fine as one kilohertz, so software
22. engineers can control the scheduling of tasks with precision.
Subarchitecture Support
Hardware designs in the embedded world often are customized
for special applications
For example, a purpose-built board may use different IRQ
management than what a similar reference design uses.
In order to run on the new board, Linux has to be ported or
altered to support the new hardware. This porting is easier if the
operating system is made of components that are well separated,
making it necessary to change only the code that has to change.
The components of Linux 2.6 that are likely to be altered for a
custom design have been refactored with a concept called
Subarchitecture. Components are separated clearly and can be
modified or replaced individually with minimal impact on other
components of the board support package.
By formalizing Linux's support for the slightly different
hardware types, the kernel can be ported more easily to other
systems, such as dedicated storage hardware and other
components that use industry-dominant processor types.
A small portion of task_struct
struct task_struct {
volatile long state;
void *stack;
unsigned int flags;
int prio, static_prio;
struct list_head tasks;
23. struct mm_struct *mm, *active_mm;
pid_t pid;
pid_t tgid;
struct task_struct *real_parent;
char comm[TASK_COMM_LEN];
struct thread_struct t hread;
struct files_struct *files;
...
};
The states listed here describe what is happening conceptually
and do not indicate what "official"
state a process is in. The official states are listed below:
TASK_RUNNING task (process) currently running
TASK_INTERRUPTABLE process is sleeping but can b e
woken up (interrupted)
TASK_UNINTERRUPTABLE process is sleeping but can not
be woken up (interrupted)
TASK_ZOMBIE process terminated but its status was not
collected (it was not waited for)
TASK_STOPPED process stopped by a debugger or job control
TASK_SWAPPING (removed in 2.3.x kernel)
Table - Process States in sched.h
week 12
Real time kernel
24. Ref: Extracts from:
http://www.swd.de/documents/manuals/sysarch/intro_en.html#id
1
The QNX Operating System
QNX provides multitasking, priority-driven preemptive
scheduling, and fast context switching
QNX is flexible. It can be customized from a ``bare-bones''
kernel with a few small modules to a network-wide system
equipped to serve hundreds of users.
QNX achieves this through two fundamental principles:
microkernel architecture
message-based interprocess communication
QNX's microkernel architecture
Architecture
QNX Microkernel is dedicated to only two essential functions:
message passing - the Microkernel handles the routing of all
messages among all processes throughout the entire system
scheduling - the scheduler is a part of the Microkernel and is
invoked whenever a process changes state as the result of a
25. message or interrupt
Unlike processes, the Microkernel itself is never scheduled for
execution. It is entered only as the direct result of kernel calls,
either from a process or from a hardware interrupt
QNX configuration
A typical QNX configuration has the following system
processes:
Process Manager (Proc)
Filesystem Manager (Fsys)
Device Manager (Dev)
Network Manager (Net)
System processes vs. user-written processes
System processes are like user processes: they have no private
or hidden interfaces that are unavailable to user processes.
This gives QNX unparalleled extensibility: the OS itself can be
augmented by user written programs.
The only real difference between system services and
applications is that OS services manage resources for clients.
Drivers
Since drivers start up as standard processes, adding a new driver
to QNX doesn't affect any other part of the operating system.
The only change you need to make to your QNX environment is
to actually start the new driver.
Once they've completed their initialization, drivers can do
either of the following:
choose to disappear as standard processes, simply becoming
26. extensions to the system process they're associated with
retain their individual identity as standard processes
QNX as a message-passing operating system
In QNX, a message is a packet of bytes passed from one process
to another.
the data in a message has meaning for the sender of the message
and for its receiver, but for no one else.
Message passing not only allows processes to pass data to each
other, but also provides a means of synchronizing the execution
of several processes.
As they send, receive, and reply to messages, processes undergo
various ``changes of state'' that affect when, and for how long,
they may run.
Knowing their states and priorities, the Microkernel can
schedule all processes as efficiently as possible to make the
most of available CPU resources. This single, consistent method
- message-passing - is thus constantly operative throughout the
entire system.
The Microkernel
The QNX Microkernel is responsible for :
IPC
the Microkernel supervises the routing of messages; it also
manages two other forms of IPC: proxies and signals
low-level network communication
The Microkernel delivers all messages destined for processes on
other nodes
process scheduling
the Microkernel's scheduler decides which process will execute
27. next
first-level interrupt handling
all hardware interrupts and faults are first routed through the
Microkernel, then passed on to the appropriate driver or system
manager
Microkernel
Process synchronization
Message passing not only allows processes to pass data to each
other, but also provides a means of synchronizing the execution
of several cooperating processes.
Send() request, and the message it has sent hasn't yet been
received by the recipient processSEND-blockedSend() request,
and the message has been received by the recipient process, but
that process hasn't yet repliedREPLY-blockedReceive() request,
but hasn't yet received a messageRECEIVE-blocked
Send and Reply Blocking
28. IPC via proxies
A proxy is a form of non-blocking message especially suited for
event notification where the sending process doesn't need to
interact with the recipient
By using a proxy, a process or an interrupt handler can send a
message to another process without blocking or having to wait
for a reply.
Here are some examples of when proxies are used:
A process wants to notify another process that an event has
occurred,
A process wants to send data to another process, but needs
neither a reply nor any other acknowledgment that the recipient
has received the message.
An interrupt handler wants to tell a process that some data is
available for processing
IPC via signals
Signals are a traditional method of asynchronous
communication that have been available for many years in a
variety of operating systems.
QNX supports a rich set of POSIX-compliant signals, some
historical UNIX signals, as well as some QNX-specific signals.
Receiving signals
A process can receive a signal in one of three ways:
The default action for the signal is taken - usually, this default
action is to terminate the process.
The process can ignore the signal.
29. The process can provide a signal handler for the signal
Signals are delivered to a process when the process is made
ready to run by the Microkernel's scheduler.
Scheduling methods
QNX provides three scheduling methods:
FIFO scheduling
round-robin scheduling
adaptive scheduling
They are effective on a per-process basis, not on a global basis
for all processes on a node.
These methods apply only when two or more processes that
share the same priority are READY. If a higher-priority process
becomes READY, it immediately preempts all lower-priority
processes.
Realtime performance
Interrupt latency is the time from the reception of a hardware
interrupt until the first instruction of a software interrupt
handler is executed. QNX leaves interrupts fully enabled almost
all the time, so that interrupt latency is typically insignificant.
But certain critical sections of code do require that interrupts be
temporarily disabled. The maximum such disable time usually
defines the worst-case interrupt latency - in QNX this is very
small.
hardware interrupt is processed by an established interrupt
handler.
The interrupt handler either will simply return, or it will return
30. and cause a proxy to be triggered.
Scheduling latency
In some cases, the low-level hardware interrupt handler must
schedule a higher-level process to run. In this scenario, the
interrupt handler will return and indicate that a proxy is to be
triggered. This introduces a second form of latency - scheduling
latency - which must be accounted for.
Scheduling latency is the time between the termination of an
interrupt handler and the execution of the first instruction of a
driver process.
This usually means the time it takes to save the context of the
currently executing process and restore the context of the
required driver process. Although larger than interrupt latency,
this time is also kept small in a QNX system.
Process Manager responsibilities
The Process Manager works with the Microkernel to provide
essential operating system services. Although it shares the same
address space as the Microkernel, it runs as a true process.
It is scheduled to run by the Microkernel like other processes
31. and it uses the Microkernel's message-passing primitives to
communicate with other processes in the system.
It is responsible for creating new processes in the system and
managing the resources associated with a process. These
services are all provided via messages
Process creation primitives
QNX supports three process-creation primitives:
fork()
exec()
spawn()
Both fork() and exec() are defined by POSIX, while the
implementation of spawn() is unique to QNX.
The spawn() primitive creates a new process as a child of the
calling process.
Process states
Interrupt handlers
Interrupt handlers react to hardware interrupts and manage the
low-level transfer of data between the computer and external
devices.
Interrupt handlers are physically packaged as part of a standard
QNX process (e.g. a driver), but they always run
asynchronously to the process they're associated with.
33. http://free-electrons.com/docs/realtime
Corrections, suggestions, contributions and translations are wel
come!
http://free-electrons.com/docs/realtime
2
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Real Time in Embedded Linux Systems
Introduction
3
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Embedded Linux and real time
Due to its advantages, Linux and the open-source softwares are
more and more commonly used in embedded applications
However, some applications also have real-time constraints
They, at the same time, want to
Get all the nice advantages of Linux: hardware support,
components re-use, low cost, etc.
Get their real-time constraints met
?
34. 4
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Embedded Linux and real time
Linux is an operating system part of the large Unix family
It was originally designed as a time-sharing system
The main goal is to get the best throughput from the available
hardware, by making the best possible usage of resources (CPU,
memory, I/O)
Time determinism is not taken into account
On the opposite, real-time constraints imply time determinism,
even at the expense of lower global throughput
Best throughput and time determinism are contradictory
requirements
5
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Linux and real-time approaches
Over time, two major approaches have been taken to bring real-
time requirements into Linux
35. Approach 1
Improve the Linux kernel itself so that it matches real-time
requirements, by providing bounded latencies, real-time APIs, e
tc.
Approach taken by the mainline Linux kernel and the
PREEMPT_RT project.
Approach 2
Add a layer below the Linux kernel that will handle all the real-
time
requirements, so that the behaviour of Linux doesn't affect real-
time
tasks.
Approach taken by RTLinux, RTAI and Xenomai
6
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Approach 1
Improving the main Linux kernel with
PREEMPT_RT
7
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
36. Understanding latency
When developing real-time applications with a system such as
Linux, the typical scenario is the following
An event from the physical world happens and gets notified to t
he
CPU by means of an interrupt
The interrupt handler recognizes and handles the event, and the
n
wake-up the user-space task that will react to this event
Some time later, the user-space task will run and be able to reac
t to
the physical world event
Real-time is about providing guaranteed worst case latencies for
this reaction time, called latency
Something not very important...
Your important
real-time task !
Interrupt ! ?
8
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Linux kernel latency components
38. 9
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Interrupt latency
Waiting
task
interrupt
latency
Interrupt
handler Scheduler
Running task
Interrupt
handler
duration
scheduler
latency
scheduler
duration
Makes the
task runnable
Time elapsed before executing the interrupt handler
Scheduling latency
39. 10
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Source of interrupt latency
One of the concurrency prevention mechanism used in the kerne
l
is the spinlock
It has several variants, but one of the variant commonly used to
prevent concurrent accesses between a process context and an
interrupt context works by disabling interrupts
Critical sections protected by spinlocks, or other section in whic
h
interrupts are explictly disabled will delay the beginning of the
execution of the interrupt handler
The duration of these critical sections is unbounded
Other possible source: shared interrupts
Kernel
code
Critical section
protected by spinlock
Interrupt
handler
Interrupt ?
40. 11
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Interrupt handler duration
Waiting
task
interrupt
latency
Interrupt
handler Scheduler
Running task
Interrupt
handler
duration
scheduler
latency
scheduler
duration
Makes the
task runnable
Time taken to execute the interrupt handler
41. Scheduling latency
12
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Interrupt handler implementation
In Linux, many interrupt handlers are split in two parts
A top-half, started by the CPU as soon as interrupt are
enabled. It runs with the interrupt line disabled and is
supposed to complete as quickly as possible.
A bottom-half, scheduled by the top-half, which starts after all
pending top-half have completed their execution.
Therefore, for real-time critical interrupts, bottom-half
shouldn't be used: their execution is delayed by all other
interrupts in the system.
Top half
Interrupt ACK Exit
Bottom half
Schedule
bottom
half
Other interrupt
handlers...
42. Handle
device
data...
Wake up
waiting
tasks
User space...
13
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Scheduler latency
Waiting
task
interrupt
latency
Interrupt
handler Scheduler
Running task
Interrupt
handler
duration
scheduler
latency
43. scheduler
duration
Makes the
task runnable
Time elapsed before executing the scheduler
Scheduling latency
14
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Understanding preemption (1)
The Linux kernel is a preemptive operating system
When a task runs in user-space mode and gets interrupted by an
interruption, if the interrupt handler wakes up another task, this
task can be scheduled as soon as we return from the interrupt
handler.
Task A
(running in user mode)
Interrupt handler
Wakes up Task B
Task B
(running in user mode)
Interrupt
44. 15
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Understanding preemption (2)
However, when the interrupt comes while the task is executing a
system call, this system call has to finish before another task ca
n
be scheduled.
By default, the Linux kernel does not do kernel preemption.
This means that the time before which the scheduler will be
called to schedule another task is unbounded.
Task A
(user mode)
Interrupt handler
Wakes up Task B
Task B
(user mode)
System call
Task A
(kernel mode)
Task A
(kernel mode)
45. Interrupt
?
Return from syscall
16
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Scheduler duration
Waiting
task
interrupt
latency
Interrupt
handler Scheduler
Running task
Interrupt
handler
duration
scheduler
latency
scheduler
duration
46. Makes the
task runnable
Time taken to execute the scheduler
and switch to the new task.
Scheduling latency
17
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Other non-deterministic mechanisms
Outside of the critical path detailed previously, other non-
deterministic mechanisms of Linux can affect the execution tim
e
of real-time tasks
Linux is highly based on virtual memory, as provided by an MM
U,
so that memory is allocated on demand. Whenever an applicatio
n
accesses code or data for the first time, it is loaded on demand,
which can creates huge delays.
Many C library services or kernel services are not designed with
real-time constraints in mind.
18
Free Electrons. Kernel, drivers and embedded Linux developme
47. nt, consulting, training and support. http://free-electrons.com
Priority inversion
Acquires
a lock
Priority
Time
preempted
Tries to get
the same
lock
waits
A process with a low priority might hold a lock needed by a hig
her
priority process, effectively reducing the priority of this process
.
Things can be even worse if a middle priority process uses the
CPU.
19
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Interrupt handler priority
top priority task
48. Any interrupt
top priority task
Any interrupt...
In Linux, interrupt handlers are executed directly by the CPU
interrupt mechanisms, and not under control of the Linux
scheduler. Therefore, all interrupt handlers have an higher
priority than all tasks running on the system.
20
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
The PREEMPT_RT project
Long-term project lead by Linux kernel developers Ingo Molnar
,
Thomas Gleixner and Steven Rostedt
https://rt.wiki.kernel.org
The goal is to gradually improve the Linux kernel regarding real
-
time requirements and to get these improvements merged into
the mainline kernel
PREEMPT_RT development works very closely with the mainli
ne
development
Many of the improvements designed, developed and debugged
inside PREEMPT_RT over the years are now part of the mainlin
49. e
Linux kernel
The project is a long-term branch of the Linux kernel that ultim
ately
should disappear as everything will have been merged
https://rt.wiki.kernel.org/
21
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Improvements in the mainline kernel
Coming from the
PREEMPT_RT project
Since the beginning of 2.6
O(1) scheduler
Kernel preemption
Better POSIX real-time API
support
Since 2.6.18
Priority inheritance support
for mutexes
Since 2.6.21
High-resolution timers
50. Since 2.6.30
Threaded interrupts
Since 2.6.33
Spinlock annotations
22
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
New preemption options in Linux 2.6
2 new preemption models offered by standard Linux 2.6:
23
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
1st option: no forced preemption
CONFIG_PREEMPT_NONE
Kernel code (interrupts, exceptions, system calls) never preempt
ed.
Default behavior in standard kernels.
Best for systems making intense computations,
on which overall throughput is key.
Best to reduce task switching to maximize CPU and cache usage
51. (by reducing context switching).
Still benefits from some Linux 2.6 improvements:
O(1) scheduler, increased multiprocessor safety (work on RT
preemption was useful to identify hard to find SMP bugs).
Can also benefit from a lower timer frequency
(100 Hz instead of 250 or 1000).
24
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
2nd option: voluntary kernel preemption
CONFIG_PREEMPT_VOLUNTARY
Kernel code can preempt itself
Typically for desktop systems, for quicker application reaction t
o
user input.
Adds explicit rescheduling points throughout kernel code.
Minor impact on throughput.
25
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
3rd option: preemptible kernel
52. CONFIG_PREEMPT
Most kernel code can be involuntarily preempted at any time.
When a process becomes runnable, no more need to wait for
kernel code (typically a system call) to return before running th
e
scheduler.
Exception: kernel critical sections (holding spinlocks), but a
rescheduling point occurs when exiting the outer critical section
,
in case a preemption opportunity would have been signaled whil
e
in the critical section.
Typically for desktop or embedded systems with latency
requirements in the milliseconds range.
Still a relatively minor impact on throughput.
26
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Priority inheritance
One classical solution to the priority inversion problem is called
priority inheritance
The idea is that when a task of a low priority holds a lock reque
sted
by an higher priority task, the priority of the first task gets temp
orarly
raised to the priority of the second task : it has inherited its prio
53. rity.
In Linux, since 2.6.18, mutexes support priority inheritance
In userspace, priority inheritance must be explictly enabled on a
per-mutex basis.
27
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
High resolution timers
The resolution of the timers used to be bound to the resolution o
f
the regular system tick
Usually 100 Hz or 250 Hz, depending on the architecture and th
e
configuration
A resolution of only 10 ms or 4 ms.
Increasing the regular system tick frequency is not an option as
it
would consume too much resources
The high-resolution timers infrastructure, merged in 2.6.21,
allows to use the available hardware timers to program interrupt
s
at the right moment.
Hardware timers are multiplexed, so that a single hardware time
54. r is
sufficient to handle a large number of software-programmed tim
ers.
Usable directly from user-space using the usual timer APIs
28
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Threaded interrupts
To solve the interrupt inversion problem, PREEMPT_RT has
introduced the concept of threaded interrupts
The interrupt handlers run in normal kernel threads, so that the
priorities of the different interrupt handlers can be configured
The real interrupt handler, as executed by the CPU, is only in
charge of masking the interrupt and waking-up the correspondin
g
thread
The idea of threaded interrupts also allows to use sleeping
spinlocks (see later)
Merged since 2.6.30, the conversion of interrupt handlers to
threaded interrupts is not automatic : drivers must be modified
In PREEMPT_RT, all interrupt handlers are switched to threade
d
interrupts
55. 29
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
PREEMPT_RT specifics
30
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
CONFIG_PREEMPT_RT (1)
The PREEMPT_RT patch adds a new « level » of preemption,
called CONFIG_PREEMPT_RT
This level of preemption replaces all kernel spinlocks by mutex
es
(or so-called sleeping spinlocks)
Instead of providing mutual exclusion by disabling interrupts an
d
preemption, they are just normal locks : when contention happe
ns,
the process is blocked and another one is selected by the schedu
ler
Works well with threaded interrupts, since threads can block, w
hile
usual interrupt handlers could not
Some core, carefully controlled, kernel spinlocks remain as nor
mal
spinlocks
56. 31
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
CONFIG_PREEMPT_RT (2)
With CONFIG_PREEMPT_RT, virtually all kernel code become
s
preemptible
An interrupt can occur at any time, when returning from the inte
rrupt
handler, the woken up process can start immediately
This is the last big part of PREEMPT_RT that isn't fully in the
mainline kernel yet
Part of it has been merged in 2.6.33 : the spinlock annotations.
The
spinlocks that must remain as spinning spinlocks are now
differentiated from spinlocks that can be converted to sleeping
spinlocks. This has reduced a lot the PREEMPT_RT patch size !
32
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Threaded interrupts
The mechanism of threaded interrupts in PREEMPT_RT is still
different from the one merged in mainline
57. In PREEMPT_RT, all interrupt handlers are unconditionally
converted to threaded interrupts.
This is a temporary solution, until interesting drivers in mainlin
e
get gradually converted to the new threaded interrupt API that
has been merged in 2.6.30.
33
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Setting up PREEMPT_RT
34
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
PREEMPT_RT setup (1)
PREEMPT_RT is delivered as a patch against the mainline
kernel
Best to have a board supported by the mainline kernel, otherwis
e
the PREEMPT_RT patch may not apply and may require some
adaptations
Many official kernel releases are supported, but not all. For
example, 2.6.31 and 2.6.33 are supported, but not 2.6.32.
58. Quick set up
Download and extract mainline kernel
Download the corresponding PREEMPT_RT patch
Apply it to the mainline kernel tree
35
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
PREEMPT_RT setup (2)
In the kernel configuration, be sure to enable
CONFIG_PREEMPT_RT
High-resolution timers
Compile your kernel, and boot
You are now running the real-time Linux kernel
Of course, some system configuration remains to be done, in
particular setting appropriate priorities to the interrupt threads,
which depend on your application.
36
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
59. Real-time application development
37
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Development and compilation
No special library is needed, the POSIX realtime API is part of
the standard C library
The glibc or eglibc C libraries are recommended, as the support
of some real-time features is not available yet in uClibc
Priority inheritance mutexes or NPTL on some architectures, for
example
Compile a program
ARCH-linux-gcc -o myprog myprog.c -lrt
To get the documentation of the POSIX API
Install the manpages-posix-dev package
Run man functioname
38
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
60. Process, thread ?
Confusion about the terms «process», «thread» and «task»
In Unix, a process is created using fork() and is composed of
An address space, which contains the program code, data, stack,
shared libraries, etc.
One thread, that starts executing the main() function.
Upon creation, a process contains one thread
Additional threads can be created inside an existing process,
using pthread_create()
They run in the same address space as the initial thread of the
process
They start executing a function passed as argument to
pthread_create()
39
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Process, thread: kernel point of view
The kernel represents each thread running in the system by a
structure of type task_struct
From a scheduling point of view, it makes no difference betwee
n
61. the initial thread of a process and all additional threads created
dynamically using pthread_create()
Address space
Thread
A
Process after fork()
Address space
Thread
A
Thread
B
Same process after pthread_create()
40
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Creating threads
Linux support the POSIX thread API
To create a new thread
pthread_create(pthread_t *thread,
pthread_attr_t *attr,
void *(*routine)(*void*),
void *arg);
62. The new thread will run in the same address space, but will be
scheduled independently
Exiting from a thread
pthread_exit(void *value_ptr);
Waiting for a thread termination
pthread_join(pthread_t *thread, void **value_ptr);
41
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Scheduling classes (1)
The Linux kernel scheduler support different scheduling classes
The default class, in which processes are started by default is a
time-sharing class
All processes, regardless of their priority, get some CPU time
The proportion of CPU time they get is dynamic and affected by
the
nice value, which ranges from -20 (highest) to 19 (lowest). Can
be
set using the nice or renice commands
The real-time classes SCHED_FIFO and SCHED_RR
The highest priority process gets all the CPU time, until it block
63. s.
In SCHED_RR, round-robin scheduling between the processes o
f
the same priority. All must block before lower priority processe
s get
CPU time.
Priorities ranging from 0 (lowest) to 99 (highest)
42
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Scheduling classes (2)
An existing program can be started in a specific scheduling clas
s
with a specific priority using the chrt command line tool
Example: chrt -f 99 ./myprog
The sched_setscheduler() API can be used to change the
scheduling class and priority of a process
int sched_setscheduler(pid_t pid, int policy,
const struct sched_param *param);
policy can be SCHED_OTHER, SCHED_FIFO, SCHED_RR, etc
.
param is a structure containing the priority
64. 43
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Scheduling classes (3)
The priority can be set on a per-thread basis when a thread is
created :
Then the thread can be created using pthread_create(),
passing the attr structure.
Several other attributes can be defined this way: stack size, etc.
struct sched_param parm;
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setinheritsched(&attr,
PTHREAD_EXPLICIT_SCHED);
pthread_attr_setschedpolicy(&attr, SCHED_FIFO);
parm.sched_priority = 42;
pthread_attr_setschedparam(&attr, &parm);
44
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Memory locking
In order to solve the non-determinism introduced by virtual
memory, memory can be locked
65. Guarantee that the system will keep it allocated
Guarantee that the system has pre-loaded everything into memor
y
mlockall(MCL_CURRENT | MCL_FUTURE);
Locks all the memory of the current address space, for currently
mapped pages and pages mapped in the future
Other, less useful parts of the API: munlockall, mock,
munlock.
Watch out for non-currently mapped pages
Stack pages
Dynamically-allocated memory
45
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Mutexes
Allows mutual exclusion between two threads in the same
address space
Initialization/destruction
pthread_mutex_init(pthread_mutex_t *mutex, const
pthread_mutexattr_t *mutexattr);
pthread_mutex_destroy(pthread_mutex_t *mutex);
66. Lock/unlock
pthread_mutex_lock(pthread_mutex_t *mutex);
pthread_mutex_unlock(pthread_mutex_t *mutex);
Priority inheritance must explictly be activated
pthread_mutexattr_t attr;
pthread_mutexattr_init (&attr);
pthread_mutexattr_getprotocol
(&attr, PTHREAD_PRIO_INHERIT);
46
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Timers
timer_create(clockid_t clockid,
struct sigevent *evp,
timer_t *timerid)
Create a timer. clockid is usually CLOCK_MONOTONIC.
sigevent defines what happens upon timer expiration : send a
signal or start a function in a new thread. timerid is the returned
timer identifier.
timer_settime(timer_t timerid, int flags,
struct itimerspec *newvalue,
struct itimerspec *oldvalue)
Configures the timer for expiration at a given time.
67. timer_delete(timer_t timerid), delete a timer
clock_getres(), get the resolution of a clock
Other functions: timer_getoverrun(), timer_gettime()
47
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Signals
Signals are an asynchronous notification mechanism
Notification occurs either
By the call of a signal handler. Be careful with the limitations o
f
signal handlers!
By being unblocked from the sigwait(), sigtimedwait() or
sigwaitinfo() functions. Usually better.
Signal behaviour can be configured using sigaction()
Mask of blocked signals can be changed with
pthread_sigmask()
Delivery of a signal using pthread_kill() or tgkill()
All signals between SIGRTMIN and SIGRTMAX, 32 signals un
der
Linux.
68. 48
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Inter-process communication
Semaphores
Usable between different processes using named semaphores
sem_open(), sem_close(), sem_unlink(), sem_init(),
sem_destroy(), sem_wait(), sem_post(), etc.
Message queues
Allows processes to exchange data in the form of messages.
mq_open(), mq_close(), mq_unlink(), mq_send(),
mq_receive(), etc.
Shared memory
Allows processes to communicate by sharing a segment of mem
ory
shm_open(), ftruncate(), mmap(), munmap(),
close(), shm_unlink()
49
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
69. Debugging real-time latencies
50
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
ftrace - Kernel function tracer
New infrastructure that can be used for debugging or analyzing
latencies and performance issues in the kernel.
Developed by Steven Rostedt. Merged in 2.6.27.
For earlier kernels, can be found from the rt-preempt patches.
Very well documented in Documentation/ftrace.txt
Negligible overhead when tracing is not enabled at run-time.
Can be used to trace any kernel function!
See our video of Steven's tutorial at OLS 2008:
http://free-electrons.com/community/videos/conferences/
http://free-electrons.com/community/videos/conferences/
51
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Using ftrace
Tracing information available through the debugfs virtual fs
(CONFIG_DEBUG_FS in the Kernel Hacking section)
70. Mount this filesystem as follows:
mount -t debugfs nodev /debug
When tracing is enabled (see the next slides),
tracing information is available in /debug/tracing.
Check available tracers
in /debug/tracing/available_tracers
52
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Scheduling latency tracer
CONFIG_SCHED_TRACER (Kernel Hacking section)
Maximum recorded time between waking up a top priority task
and its scheduling on a CPU, expressed in µs.
Check that wakeup is listed in
/debug/tracing/available_tracers
To select, reset and enable this tracer:
echo wakeup > /debug/tracing/current_tracer
echo 0 > /debug/tracing/tracing_max_latency
echo 1 > /debug/tracing/tracing_enabled
Let your system run, in particular real-time tasks.
Example: chrt -f 5 sleep 1
Disable tracing:
echo 0 > /debug/tracing/tracing_enabled
71. Read the maximum recorded latency and the corresponding trac
e:
cat /debug/tracing/tracing_max_latency
53
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Useful reading
About real-time support in the standard Linux kernel
Internals of the RT Patch, Steven Rostedt, Red Hat, June 2007
http://www.kernel.org/doc/ols/2007/ols2007v2-pages-161-172.p
df
Definitely worth reading.
The Real-Time Linux Wiki: http://rt.wiki.kernel.org
“The Wiki Web for the CONFIG_PREEMPT_RT community,
and real-time Linux in general.”
Contains nice and useful documents!
See also our books page.
http://www.kernel.org/doc/ols/2007/ols2007v2-pages-161-
172.pdf
http://rt.wiki.kernel.org/
54
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Approach 2
72. Real-time extensions to the Linux kernel
55
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Linux real-time extensions
Three generations
RTLinux
RTAI
Xenomai
A common principle
Add a extra layer between the
hardware and the Linux kernel,
to manage real-time tasks
separately.
Hardware
Micro-kernel
Linux
kernel
real-time
tasks
real-time
73. tasks
56
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
RTLinux
First real-time extension for Linux, created by Victor Yodaiken.
Nice, but the author filed a software patent covering the additio
n of real-
time support to general operating systems as implemented in RT
Linux!
Its Open Patent License drew many developers away and frighte
ned
users. Community projects like RTAI and Xenomai now attract
most
developers and users.
February, 2007: RTLinux rights sold to Wind River.
Now supported by Wind River as “RealTime Core for Wind Ri
ver Linux.”
Free version still advertised by Wind River on http://www.rtlinu
xfree.com,
but no longer a community project.
http://www.rtlinuxfree.com/
57
Free Electrons. Kernel, drivers and embedded Linux developme
74. nt, consulting, training and support. http://free-electrons.com
RTAI
http://www.rtai.org/ - Real-Time Application Interface for Linu
x
Created in 1999, by Prof. Paolo Montegazza (long time
contributor to RTLinux), Dipartimento di Ingegneria
Aerospaziale Politecnico di Milano (DIAPM).
Community project. Significant user base.
Attracted contributors frustrated by the RTLinux legal issues.
Only really actively maintained on x86
May offer slightly better latencies than Xenomai, at the
expense of a less maintainable and less portable code base
Since RTAI is not really maintained on ARM and other
embedded architectures, our presentation is focused on
Xenomai.
http://www.rtai.org/
58
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Xenomai project
http://www.xenomai.org/
Started in 2001 as a project aiming at emulating
traditional RTOS.
75. Initial goals: facilitate the porting of programs to GNU / Linux.
Initially related to the RTAI project (as the RTAI / fusion
branch), now independent.
Skins mimicking the APIs of traditional
RTOS such as VxWorks, pSOS+, and VRTXsa as well as the
POSIX API, and a “native” API.
Aims at working both as a co-kernel and on top of
PREEMPT_RT in the upcoming 3.0 branch.
Will never be merged in the mainline kernel.
http://www.xenomai.org/
59
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Xenomai architecture
Adeos I-Pipe
Xenomai RTOS
(nucleus)
VxWorks application
glibc
Xenomai
libvxworks
76. POSIX application
glibc
Xenomai
libpthread_rt
Linux application
glibc
VFS Network
Memory ...
System calls
Linux
kernel space
Pieces added
by Xenomai
Xenomai
skins
60
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
The Adeos interrupt pipeline abstraction
From Adeos point of view, guest OSes are prioritized domains.
77. For each event (interrupts, exceptions, syscalls, etc...), the
various domains may handle the event or pass it down the
pipeline.
61
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Adeos virtualized interrupts disabling
Each domain may be “stalled”, meaning that it does not accept
interrupts.
Hardware interrupts
are not disabled
however (except
for the domain
leading the pipeline),
instead the interrupts
received during that
time are logged and
replayed when the
domain is unstalled.
62
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Adeos additional features
The Adeos I-pipe patch implement additional features, essential
for the implementation of the Xenomai real-time extension:
78. Disables on-demand mapping of kernel-space vmalloc/ioremap
areas.
Disables copy-on-write when real-time processes are forking.
Allow subscribing to event allowing to follow progress of the Li
nux
kernel, such as Linux system calls, context switches, process
destructions, POSIX signals, FPU faults.
On the ARM architectures, integrates the FCSE patch, which all
ows
to reduce the latency induced by cache flushes during context
switches.
63
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Xenomai features
Factored real-time core with skins implementing various real-ti
me
APIs
Seamless support for hard real-time in user-space
No second-class citizen, all ports are equivalent feature-wise
Xenomai support is as much as possible independent from the
Linux kernel version (backward and forward compatible when
reasonable)
79. Each Xenomai branch has a stable user/kernel ABI
Timer system based on hardware high-resolution timers
Per-skin time base which may be periodic
RTDM skin allowing to write real-time drivers
64
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Xenomai user-space real-time support.
Xenomai supports real-time in user-space on 5 architectures,
including 32 and 64 bits variants.
Two modes are defined for a thread
the primary mode, where the thread is handled by Xenomai
scheduler
the secondary mode, when it is handled by Linux scheduler.
Thanks to the services of the Adeos I-pipe service, Xenomai
system calls are defined.
A thread migrates from secondary mode to primary mode when
such a system call is issued
It migrates from primary mode to secondary mode when a Linux
system call is issued, or to handle gracefully exceptional events
such as exceptions or Linux signals.
80. 65
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Life of a Xenomai application
Xenomai applications are started like normal Linux processes,
they are initially handled by the Linux scheduler and have acces
s
to all Linux services
After their initialization, they declare themselves as real-time
application, which migrates them to primary mode. In this mode
:
They are scheduled directly by the Xenomai scheduler, so they
have the real-time properties offered by Xenomai
They don't have access to any Linux service, otherwise they get
migrated back to secondary mode and looses all real-time
properties
They can only use device drivers that are implemented in Xeno
mai,
not the ones of the Linux kernel
Need to implement device drivers in Xenomai, and to split real-
time and non real-time parts of your applications.
66
Free Electrons. Kernel, drivers and embedded Linux developme
81. nt, consulting, training and support. http://free-electrons.com
Real Time Driver Model (RTDM)
An approach to unify the interfaces for developing device driver
s
and associated applications under real-time Linux
An API very similar to the native Linux kernel driver API
Allows the development, in kernel space, of
Character-style device drivers
Network-style device drivers
See the whitepaper on
http://www.xenomai.org/documentation/xenomai-2.4/pdf/RTDM
-and-Applications.pdf
Current notable RTDM based drivers:
Serial port controllers;
RTnet UDP/IP stack;
RT socket CAN, drivers for CAN controllers;
Analogy, fork of the Comedy project, drivers for acquisition car
ds.
http://www.xenomai.org/documentation/xenomai-
2.4/pdf/RTDM-and-Applications.pdf
67
82. Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Setting up Xenomai
68
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
How to build Xenomai
Download Xenomai sources at
http://download.gna.org/xenomai/stable/
Download one of the Linux versions supported by this release
(see ksrc/arch/<arch>/patches/)
Since version 2.0, split kernel/user building model.
Kernel uses a script called script/prepare-kernel.sh which
integrates Xenomai kernel-space support in the Linux sources.
Run the kernel configuration menu.
http://download.gna.org/xenomai/stable/
69
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Linux options for Xenomai configuration
83. 70
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Xenomai user-space support
User-space libraries are compiled using the traditional autotools
./configure --target=arm-linux && make &&
make DESTDIR=/your/rootfs/ install
The xeno-config script, installed when installing Xenomai user-
space support helps you compiling your own programs.
See Xenomai's examples directory.
Installation details may be found in the README.INSTALL gui
de.
For an introduction on programming with the native API, see:
http://www.xenomai.org/documentation/branches/v2.3.x/pdf/Nat
ive-API-Tour-rev-C.pdf
For an introduction on programming with the POSIX API, see:
http://www.xenomai.org/index.php/Porting_POSIX_applications
_to_Xenomai
http://www.xenomai.org/documentation/branches/v2.3.x/pdf/Nat
ive-API-Tour-rev-C.pdf
http://www.xenomai.org/index.php/Porting_POSIX_applications
_to_Xenomai
71
Free Electrons. Kernel, drivers and embedded Linux developme
84. nt, consulting, training and support. http://free-electrons.com
Developing applications on Xenomai
72
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
The POSIX skin
The POSIX skin allows to recompile without changes a tradition
al
POSIX application so that instead of using Linux real-time
services, it uses Xenomai services
Clocks and timers, condition variables, message queues, mutexe
s,
semaphores, shared memory, signals, thread management
Good for existing code or programmers familiar with the POSIX
API
Of course, if the application uses any Linux service that isn't
available in Xenomai, it will switch back to secondary mode
To link an application against the POSIX skin
DESTDIR=/path/to/xenomai/
export DESTDIR
CFL=`$DESTDIR/bin/xeno-config --posix-cflags`
LDF=`$DESTDIR/bin/xeno-config --posix-ldflags`
ARCH-gcc $CFL -o rttest rttest.c $LDF
85. 73
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Communication with a normal task
If a Xenomai real-time application using the POSIX skin wishes
to
communicate with a separate non-real-time application, it must
use the rtipc mechanism
In the Xenomai application, create an IPCPROTO_XDDP socket
socket(AF_RTIPC, SOCK_DGRAM, IPCPROTO_XDDP);
setsockopt(s, SOL_RTIPC, XDDP_SETLOCALPOOL,&poolsz,
sizeof(poolsz));
memset(&saddr, 0, sizeof(saddr));
saddr.sipc_family = AF_RTIPC;
saddr.sipc_port = MYAPPIDENTIFIER;
ret = bind(s, (struct sockaddr *)&saddr, sizeof(saddr));
And then the normal socket API sendto() / recvfrom()
In the Linux application
Open /dev/rtpX, where X is the XDDP port
Use read() and write()
74
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
The native API (1)
86. A Xenomai-specific API for developing real-time tasks
Usable both in user-space and kernel space. Development of tas
ks
in user-space is the preferred way.
More coherent and more flexible API than the POSIX API. Easi
er to
learn and understand. Certainly the way to go for new applicatio
ns.
Applications should include <native/service.h>, where
service can be alarm, buffer, cond, event, heap,
intr, misc, mutex, pipe, queue, sem, task, timer
To compile applications :
DESTDIR=/path/to/xenomai/
export DESTDIR
CFL=`$DESTDIR/bin/xeno-config --xeno-cflags`
LDF=`$DESTDIR/bin/xeno-config --xeno-ldflags`
ARCH-gcc $CFL -o rttest rttest.c $LDF -lnative
75
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
The native API (2)
Task management services
rt_task_create(), rt_task_start(),
rt_task_suspend(), rt_task_resume(),
rt_task_delete(), rt_task_join(), etc.
87. Counting semaphore services
rt_sem_create(), rt_sem_delete(), rt_sem_p(),
rt_sem_v(), etc.
Message queue services
rt_queue_create(), rt_queue_delete(),
rt_queue_alloc(), rt_queue_free(),
rt_queue_send(), rt_queue_receive(), etc.
Mutex services
rt_mutex_create(), rt_mutex_delete(),
rt_mutex_acquire(), rt_mutex_release(), etc.
76
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
The native API (3)
Alarm services
rt_alarm_create(), rt_alarm_delete(),
rt_alarm_start(), rt_alarm_stop(),
rt_alarm_wait(), etc.
Memory heap services
Allows to share memory between processes and/or to pre-allocat
e
a pool of memory
88. rt_heap_create(), rt_heap_delete(),
rt_heap_alloc(), rt_heap_bind()
Condition variable services
rt_cond_create(), rt_cond_delete(),
rt_cond_signal(), rt_cond_broadcast(),
rt_cond_wait(), etc.
77
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Xenomai and normal task communication
Using rt_pipes
In the native Xenomai application, use the Pipe API
rt_pipe_create(), rt_pipe_delete(),
rt_pipe_receive(), rt_pipe_send(),
rt_pipe_alloc(), rt_pipe_free()
In the normal Linux application
Open the corresponding /dev/rtpX file, the minor is specified at
rt_pipe_create() time
Then, just read() and write() to the opened file
Xenomai application
Uses the rt_pipe_*() API
Linux application
89. open(“/dev/rtpX”)
78
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Real-time approaches
The following table is Paul Mac Kenney's summary of his own
article describing the various approaches for real-time on Linux
:
Inspection API
POSIX + RT N/A None
PREEMPT POSIX + RT N/A None
RTOS Excellent
PREEMPT_RT POSIX + RT None
OK
POSIX + RT None
Approach Quality Complexity
Fault
isolation
HW/SW
Configs
Vanilla Linux
90. 10s of ms
all services All All
100s of us
Schd, Int
preempt or
irq disable All
Nested OS
(co-kernel)
~10us
RTOS svcs
RTOS,
hw irq disable
RTOS (can
be POSIX RT) Dual env. Good All
Dual-OS/Dual-Core
(ASMP)
<1us
RTOS svcs
RTOS (can
be POSIX RT) Dual env. Specialized
10s of us
Schd, Int
preempt and irq
disable (most
ints in process ctx),
(mostly drivers)
91. "Modest" patch
(careful tuning)
All (except
some
drivers)
Migration between OSes ? us
RTOS svcs
RTOS,
hw irq disable
RTOS (can
be POSIX RT)
Dual env. (easy
mix) All
Migration within OS
? us
RTOS svcs
Sched,
RTOS svcs Small patch All?
(additions in blue)
Full story at http://lwn.net/Articles/143323
http://lwn.net/Articles/143323
79
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
92. Books
Building Embedded Linux Systems, O'Reilly
By Karim Yaghmour, Jon Masters,
Gilad Ben-Yossef, Philippe Gerum and others
(including Michael Opdenacker), August 2008
A nice coverage of Xenomai (Philippe Gerum)
and the RT patch (Steven Rostedt)
http://oreilly.com/catalog/9780596529680/
http://oreilly.com/catalog/9780596529680/
80
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http://free-electrons.com
Organizations
http://www.realtimelinuxfoundation.org/
Community portal for real-time Linux.
Organizes a yearly workshop.
http://www.osadl.org
Open Source Automation Development Lab (OSADL)
Created as an equivalent of OSDL for machine and plant control
systems. Member companies are German so far (Thomas Gleixn
er
is on board). One of their goals is to supports the development o
f
RT preempt patches in the mainline Linux kernel (HOWTOs, liv
e
CD, patches).
93. http://www.realtimelinuxfoundation.org/
http://www.osadl.org/
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http//free-electrons.com
Related documents
All our technical presentations
on http://free-electrons.com/docs
Linux kernel
Device drivers
Architecture specifics
Embedded Linux system development
http://free-electrons.com/docs
Free Electrons. Kernel, drivers and embedded Linux developme
nt, consulting, training and support. http//free-electrons.com
How to help
You can help us to improve and maintain this document...
By sending corrections, suggestions, contributions and
translations
By asking your organization to order development, consulting
and training services performed by the authors of these
documents (see http://free-electrons.com/).
By sharing this document with your friends, colleagues
94. and with the local Free Software community.
By adding links on your website to our on-line materials,
to increase their visibility in search engine results.
http://free-electrons.com/
Custom Development
System integration
Embedded Linux demos and prototypes
System optimization
Application and interface development
Free Electrons
Our services
Embedded Linux Training
All materials released with a free license!
Unix and GNU/Linux basics
Linux kernel and drivers development
Real-time Linux, uClinux
Development and profiling tools
Lightweight tools for embedded systems
Root filesystem creation
Audio and multimedia
System optimization
Consulting and technical support
Help in decision making
System architecture
95. System design and performance review
Development tool and application support
Investigating issues and fixing tool bugs
Linux kernel
Linux device drivers
Board support code
Mainstreaming kernel code
Kernel debugging
Question 1 Real time issues in embedded systems
Write a discussion of the issues involved in designing real time
systems. Include the following systems: Bare metal
programming, Linux or Unix operating systems, and
microkernel designs.
Describe the advantages and potential problems of these types
of system
Some information and references can be found in the folder
Question 2 JTAG description, and use for testing and flash
programming
To answer this question, you may cut and paste any diagrams
and paraphrase, but preferably condense, any text you wish.
Please reference all sources you use. Format your answer as you
wish, but try to cover all the following points.
Using the references below and/or any others you can find,
answer the following questions.
Describe briefly the principles and methods of the boundary
scan testing through the JTAG interface. Refer to:
http://en.wikipedia.org/wiki/Joint_Test_Action_Group