Question

In: Computer Science

System calls pass parameters to the kernel using one of three methods: in registers, in a...

System calls pass parameters to the kernel using one of three methods: in registers, in a block or table and the address of the block passed as parameter in a register, on the stack. Discuss the advantages and disadvantages of each.

Also, what does it mean when we say “a program is a passive entity while a process is an active entity”?

Also, in detail why does the Operating System switches the process from Running state to Waiting state when it issues any I/O operation.

Solutions

Expert Solution

1) System call:

A system call is an interface to the services of the OS. Application developers often do not have direct access to the system calls, but can access them through an application programming interface (API).

Passing Parameters:

There are 3 main methods.

(a) Parameters can be passed in registers.

Advantage: Easy and simplest method. Also direct way to pass parameters.

Faster. Can be immediately used.

Disadvantage: This is insufficient when there are more parameters than number of registers.

(b) Parameters can be stored in a block and the block address can be passed as a parameter to a register.

Advantage: When there are more parameters than registers, this method can be used.

Disadvantage: Limited to only Linux and Solaris.

(c) Parameters can also be pushed on or popped off the stack by the operating system.

Advantage: It do not limit the number or length of parameters passed. Can pass any number of parameters.

Disadvantage: Code becomes a bit more complex.

2) Program and Process:

Process:

A process is an instance of a computer program that is being sequentially executed by a computer system.

Process is an active entity as it is created during execution and loaded into the main memory.

Process is a dynamic entity.

Program:

A computer program is just a source code compiled into machine instructions, while a process is the actual execution of those instructions.

Program is a passive entity as it resides in the secondary memory.

Program is a static entity.

3) It is due to the Non-Preemptive Scheduling technique in OS.

Here there is no choice. A new process must be selected.

Once a process starts running it keeps running, until it either voluntarily blocks or until it finishes.

  Whenever the process requests access to I/O or needs input from the user it enters the blocked or wait state.


Related Solutions

Give four reasons why system calls are typically implemented using interrupts instead of function calls.
Give four reasons why system calls are typically implemented using interrupts instead of function calls.
Write a program calls each of the three methods described below and prints out the result...
Write a program calls each of the three methods described below and prints out the result of the two methods which return value reverse- a void method that reverses the elements of the array. Print the array before you call the method and after call the method. getMin- an int method that returns the smallest value in the array Sample output array: 22,34,21,35,12,4,2,3,99,81 array in reverse: 81,99,3,2,4,12,35,21,34,22 the smallest number is 2
Using the indicated parameters for each system element (P in, G1, L & G2) and with...
Using the indicated parameters for each system element (P in, G1, L & G2) and with impedances matched for each junction (node, Ni ) of this end-to-end system, compute a) the net linear system gain, b) the net system gain in dB, and c )the power levels (in dB) at each stage of this cascaded system (i.e. Pin, N1, N2, and P out). Pin=0.1 W, G1=400, L=2,000, G2=500
To evaluate the system parameters, one uses Monte Carlo methodology and simulates one of its vital...
To evaluate the system parameters, one uses Monte Carlo methodology and simulates one of its vital characteristics X, a continuous random variable with the density f(x) = 2/9 (1+x) if -1 < x < 2, otherwise 0 Explain how one can generate X, given a computer-generated Standard Uniform variable U. If U = 0.2396, compute X.
"Any intellectual activity involves the independent functioning of three neurological system". Explain with reference to PASS model.
"Any intellectual activity involves the independent functioning of three neurological system". Explain with reference to PASS model.
Describe the three basic methods for contructing a life table (2 main methods, one of which...
Describe the three basic methods for contructing a life table (2 main methods, one of which has 2 submethods). For each one explain how data are collected and entered into a life table. Identify a positive and negative aspect for each.
JavaScript Task Load three images of colorful fall leaves and using functions with parameters do the...
JavaScript Task Load three images of colorful fall leaves and using functions with parameters do the following. (Remember you can call the same function multiple times sending the function different values.) When you move the mouse over the first image, have the second image change to a pumpkin. When you move the mouse off of the first image, have the second image change back to the original leaves. When you move the mouse over the second image, have the third...
Write three functions that compute the square root of an argument x using three different methods....
Write three functions that compute the square root of an argument x using three different methods. The methods are increasingly sophisticated, and increasingly efficient. The square root of a real number x is the value s such that s*s == x. For us, the values will be double precision variables and so may not be perfectly accurate. Also, for us, assume that x is in the range 0.0 to 100.0. You program should have a main() that asks the user...
Please create an array of Leg objects, one constructor that takes three parameters as constant C...
Please create an array of Leg objects, one constructor that takes three parameters as constant C string, and one number representing the distance in miles between the two cities Write a code block to create a static array (that is, not dynamic and not a vector) of 3 Leg objects using city names of your choosing. That's THREE objects, each created using THREE parameters. For example, the Leg class declaration looked like, class Leg { const char* const startCity; const...
2. In terms of estimating population parameters using sample statistics, one would think that the highest...
2. In terms of estimating population parameters using sample statistics, one would think that the highest level of confidence in an estimate (in other words, the 99% confidence level) would always be preferred by researchers. A. What is/are the advantage(s) of reporting a confidence interval at the 99% confidence level? B. Explain why researchers might rather choose a lower level of confidence (say the 95% or 90% confidence level) in their estimation of confidence intervals. Show all work, do not...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT