Implement the system call pstate in xv6. Similar to the Unix command ps, it prints out...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Implement the system call pstate in xv6. Similar to the Unix command ps, it prints out the state of the current user processes. For simplicity, there is no argument to the command. Consider only those user processes in SLEEPING, RUNNING, or RUNNABLE state. The display for each process should include process id, process name, process state, and parent name. Use (init) for the parent name of the init process. The command also prints out the total number of the processes that are currently in SLEEPING, RUNNING, or RUNNABLE state. The command also prints out the status of each CPU, where the status is either idle or the name of the current process it is running. sh.c should not be modified. There will be a penalty for any unnecessary modifications to xv6. The implementation of additional user programs (like the pi in the sample run) for testing purpose is not mandatory. $ pi & $ pi & $ pi & [$pstate pid 1 2 34 29 31 33 total: 6 cpu 0: pstate cpu 1: pi 1 name init sh pstate pi pi pi [$pstate pid 2 35 29 31 33 name init sh pi pi pi state total: 6 cpu 0: pi cpu 1: pstate SLEEPING SLEEPING RUNNING RUNNABLE RUNNABLE RUNNING SLEEPING SLEEPING pstate RUNNING RUNNING RUNNABLE RUNNABLE state parent (init) init sh init init init parent (init) init sh init init init Implement the system call pstate in xv6. Similar to the Unix command ps, it prints out the state of the current user processes. For simplicity, there is no argument to the command. Consider only those user processes in SLEEPING, RUNNING, or RUNNABLE state. The display for each process should include process id, process name, process state, and parent name. Use (init) for the parent name of the init process. The command also prints out the total number of the processes that are currently in SLEEPING, RUNNING, or RUNNABLE state. The command also prints out the status of each CPU, where the status is either idle or the name of the current process it is running. sh.c should not be modified. There will be a penalty for any unnecessary modifications to xv6. The implementation of additional user programs (like the pi in the sample run) for testing purpose is not mandatory. $ pi & $ pi & $ pi & [$pstate pid 1 2 34 29 31 33 total: 6 cpu 0: pstate cpu 1: pi 1 name init sh pstate pi pi pi [$pstate pid 2 35 29 31 33 name init sh pi pi pi state total: 6 cpu 0: pi cpu 1: pstate SLEEPING SLEEPING RUNNING RUNNABLE RUNNABLE RUNNING SLEEPING SLEEPING pstate RUNNING RUNNING RUNNABLE RUNNABLE state parent (init) init sh init init init parent (init) init sh init init init
Expert Answer:
Answer rating: 100% (QA)
Solutions Step 1 To implement the pstate system call in xv6 you need to modify the kernel code to add the new system call and modify the userlevel ps command to display the required information Here a... View the full answer
Related Book For
Smith and Roberson Business Law
ISBN: 978-0538473637
15th Edition
Authors: Richard A. Mann, Barry S. Roberts
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
Googles ease of use and superior search results have propelled the search engine to its num- ber one status, ousting the early dominance of competitors such as WebCrawler and Infos- eek. Even later...
-
Tabulate the function f(x) = sin x for x = 0.0(0.2)1.6. From this table estimate, by linear interpolation, the value of sin 1.23. Construct a table equivalent to Figure 2.102, and so estimate the...
-
Duncan Trophies Inc. uses a job order cost system for determining the cost to manufacture award products (plaques and trophies). Among the company's products is an engraved plaque that is awarded to...
-
The books of Torrent Company show the following account balances as of March 1: The work in process account is supported by the following job order cost sheets: During March, the following...
-
The ratio of width of bucket for a Pelton wheel to the diameter of jet is of the order of: (a) 15 (b) 14 (c) 13 (d) 12
-
A financial plan has to be either a prediction about the future or a statement of goals; it cant be both. Explain this statement and comment on its validity.
-
7. Are there issues associated with keeping the large sum of money in accumulated earnings? The corporation has a large amount of money in retained earnings. The corporations retained earnings...
-
Fitz Products Inc. reported $1,075,049 profit in 2023 and declared preferred dividends of $75,100. The following changes in common shares outstanding occurred during the year. Jan. 1 78,000 common...
-
Multiple Choice Questions: The operations manager for the Blue Moon Brewing Co. produces two beers: Lite (L) and Dark (D). Two of his resources are constrained: production time, which is limited to 8...
-
What is your basic attitude toward the realities you face? Is your reality a gift or an obstacle, a friend or an enemy?
-
Are the leadership and management development programs provided to our managers well equipped to help develop the skills and competences needed to adequately employ an integrative responsible...
-
A different perspective may be observed from the #Metoo movement, as it can be examined as a manifestation of leading, with the potential to challenge our understanding of leadership. Could #Metoo be...
-
How can you incorporate mindfulness practice and training into your personal and organizational business routines?
-
Do I engage and involve middle managers sufficiently in wicked change problems?
-
After the addition of an acid, a solution has a volume of 90 milliliters. The volume of the solution is 3 milliliters greater than 3 times the volume of the solution before the acid was added. What...
-
You are thinking of investing in one of two companies. In one annual report, the auditors opinion states that the financial statements were prepared in accordance with generally accepted accounting...
-
In 2002, Roy Martin and his wife, Alice, their son, Hiram, and Hirams wife, Myrna acquired title to a 240-acre farm. The deed ran to Roy Martin and Alice Martin, the father and mother, as joint...
-
Clark, who owned a vacant lot, and Bird, who was engaged in building houses, entered into an oral agreement by which Bird was to erect a house on the lot. Upon the sale of the house and lot, Bird was...
-
The city of Boston sought to condemn land in fee simple for use in constructing an entrance to an underground terminal for a subway. The owners of the land contend that no more than surface and...
-
Powerhouse Ltd purchased machinery on 2 January 2019, at a cost of $800 000. The machinery is depreciated using the straightline method over a useful life of 8 years with a residual value of $80 000....
-
The purchases and sales of Big Flower Pty Ltd of one brand of lawn fertiliser for the year ended 31 December 2019 are contained in the schedule below. The selling price up to 30 June was $12 per unit...
-
In groups of four or five, consider the following information. On 1 July 2019, Stevenson Pty Ltd, a proprietary company with three shareholders, acquired some property by issuing 100 000 shares to...
Study smarter with the SolutionInn App