According to the standard Operating System Concepts classification, which…
2022
According to the standard Operating System Concepts classification, which parameter-passing method is identified as being used by Linux and Solaris for system calls?
Answer: B. Using a memory block or table — System calls need a way to hand arguments from user code to the kernel, and operating-system theory identifies three general techniques for doing this: Pass…
- A.
Using registers
- B.
Using a memory block or table
- C.
Using a stack
- D.
Using a queue
Attempted by 772 students.
Show answer & explanation
Correct answer: B
System calls need a way to hand arguments from user code to the kernel, and operating-system theory identifies three general techniques for doing this:
Pass the parameters directly in CPU registers.
Store the parameters in a block (table) in memory, and pass only the address of that block in a register.
Push the parameters onto the stack, to be popped off by the operating system.
Register-only passing is simple but is limited by the number of registers available, so it cannot scale to calls with many arguments. To avoid that limit, Linux (along with Solaris) uses the block/table technique: the calling program packs its parameters into a memory block and loads just that block's address into a register before trapping into the kernel, so the kernel can read an arbitrary number of arguments through this indirection.
Option | Mechanism | Matches Linux's parameter-passing scheme? |
|---|---|---|
By using registers | Each parameter is placed in its own CPU register. | No -- limited to however many registers the CPU dedicates to arguments. |
By using block or table | Parameters are packed into one memory block; only the block's address is passed in a register. | Yes -- this is the technique Linux (and Solaris) use. |
By using stack | Parameters are pushed onto the stack and popped off by the operating system. | No -- a separate calling-convention technique, not the one named for Linux here. |
By using queue | A first-in-first-out structure used for scheduling or inter-process messaging. | No -- not used to hand parameters to a system call at all. |
The real x86-64 Linux syscall ABI does load the first several arguments directly into specific CPU registers (such as RDI, RSI, and RDX) -- that is a hardware/ABI-level implementation detail. The standard operating-systems textbook treatment (Silberschatz/Galvin) that this question is drawn from separately classifies parameter-passing into the three techniques above and explicitly attributes the block/table scheme to Linux (and Solaris). Among the four techniques offered here, it is that block/table scheme -- not the register-ABI detail -- which the question and its answer key are testing, which is why "By using block or table" is the technique that matches.
A video solution is available for this question — log in and enroll to watch it.