In Sec. 4.8.4, it was pointed out that it would be better to search for holes for
Question:
In Sec. 4.8.4, it was pointed out that it would be better to search for holes for the text and data segments separately. Implement this improvement.
Data from Sec. 4.8.4
Transcribed Image Text:
The code for exec follows the outline of Fig. 4-40. It is contained in the pro- cedure do_exec (line 18747) in exec.c. After making a few validity checks, the PM fetches the name of the file to be executed from user space (lines 18773 to 18776). Recall that the library procedures which implement exec build a stack within the old core image, as we saw in Fig. 4-38. This stack is fetched into the PM's memory space next (line 18782). The next few steps are written as a loop (lines 18789 to 18801). However, for ordinary binary executables only one pass through the loop takes place. We will first describe this case. On line 18791 a message to the file system switches to the user's directory so the path to the file will be interpreted relative to the user's, rather than to PM's, working directory. Then allowed is called-if execution is allowed it opens the file. If the test fails a negative number is returned instead of a valid file descriptor, and do exit terminates indicating failure. If the file is present and executable, the PM calls read_header and gets the segment sizes. For an ordinary binary the return code from read header will cause an exit from the loop at line 18800. Now we will look at what happens if the executable is a script. MINIX 3, like most UNIX-like operating systems, supports executable scripts. Read_header tests the first two bytes of the file for the magic shebang (#!) sequence and returns a special code if this is found, indicating a script. The first line of a script marked this way specifies the interpreter for the script, and possibly also specifies flags and options for the interpreter. For instance, a script can be written with a first line like
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 77% (9 reviews)
Answered By
GERALD KAMAU
non-plagiarism work, timely work and A++ work
4.40+
6+ Reviews
11+ Question Solved
Related Book For
Operating Systems Design And Implementation
ISBN: 9780131429383
3rd Edition
Authors: Andrew Tanenbaum, Albert Woodhull
Question Posted:
Students also viewed these Computer science questions
-
Hyten Corporation On June 5, 1998, a meeting was held at Hyten Corporation, between Bill Knapp, Director of Marketing/Sales, and John Rich, director of engineering. The purpose of the meeting was to...
-
In this chapter it was pointed out that market geography is subject to changes. Why should the channel manager be concerned with such changes?
-
For years, Dell's seemingly magical power to squeeze efficiencies out of its supply chain and drive down costs made it a darling of the financial markets. Now we learn that the magic was at least...
-
1. List five line coding schemes discussed in this book. 2. Define block coding and give its purpose. 3. Define scrambling and give its purpose. 4. Compare and contrast PCM and DM 5. What are the...
-
Elegant Outdoor Furniture Company included the following stockholders equity on its year-end balance sheet at February 28, 2011: Stockholders' Equity Preferred stock, 6.5% cumulative par value $35...
-
What is a bond? AppendixLO1
-
Assuming that MNC entered into no forward contract, how much foreign exchange gain or loss should it report on its 2009 income statement with regard to this transaction? LO9 a. $5,000 gain. b. $3,000...
-
Sound Investments, Inc. is a large retailer of stores equipment. The controller is about to prepare the budget for the first quarter of 20x2. Past experience has indicated that 75 percent of the...
-
CariTech (CT) Company produces and sells 7,000 Special purpose chairs per year at a selling price of $850 each. Its current production equipment, purchased for $1,850,000 and with a five-year useful...
-
If an instruction takes 1 nsec and a page fault takes an additional n nsec, give a formula for the effective instruction time if page faults occur every k instructions.
-
Now revisit the previous question using a hole list. How much memory is needed for the list in the best case and in the worst case? Assume the operating system occupies the bottom 512 KB of memory.
-
Differentiate. y = x 2 + 1/x 3 - 1
-
Identify a public conflict (such as a recent Congressional debate or even a celebrity breakup) that has come to the forefront in the media (or public's attention) in the last thirty days. You have...
-
Performance Management Issues You have been asked to return to your alma mater and speak to current students about performance management issues. To make the most of this experience for yourself and...
-
Analysis of competitor organization of our selected organization Walmart and its competitor Safeway. 1. Complete analysis of competitor organization; addresses all relevant factors and typically uses...
-
Defining Program Objectives of Youth centers Clearly define the objectives of your program or center. What specific outcomes do you hope to achieve? Examples may include promoting physical fitness,...
-
Identify a local or regional organization and analyze how they demonstrate servant leadership in their operations. You will want to review their website, social media, news, and other resources to...
-
FCR Realty, LLC, and Clifford B. Green & Sons, Inc., were co-owned by three brothers-Frederick, Clifford Jr., and Richard Green. Each brother was a shareholder of the corporation. Frederick was a...
-
The roof of a refrigerated truck compartment is of composite construction, consisting of a layer of foamed urethane insulation (t2 = 50 mm, ki = 0.026 W/m K sandwiched between aluminum alloy panels...
-
Calculate 1.666015625 10 0 (1.9760 10 4 + -1.9744 10 4 ) by hand, assuming each of the values are stored in the 16-bit half precision format described in Exercise 3.27 (and also described in the...
-
Calculate (1.666015625 10 0 1.9760 10 4 ) + (1.666015625 10 0 -1.9744 10 4 ) by hand, assuming each of the values are stored in the 16-bit half precision format described in Exercise 3.27 (and...
-
Based on your answers to 3.38 and 3.39, does (1.666015625 10 0 1.9760 10 4 ) + (1.666015625 10 0 -1.9744 10 4 ) = 1.666015625 10 0 (1.9760 10 4 + -1.9744 10 4 )?
-
Minden Company introduced a new product last year for which it is trying to find an optimal selling price. Marketing studies suggest that the company can increase sales by 5,000 units for each $2...
-
Prepare the adjusting journal entries and Post the adjusting journal entries to the T-accounts and adjust the trial balance. Dresser paid the interest due on the Bonds Payable on January 1. Dresser...
-
Venneman Company produces a product that requires 7 standard pounds per unit. The standard price is $11.50 per pound. If 3,900 units required 28,400 pounds, which were purchased at $10.92 per pound,...
Study smarter with the SolutionInn App