Argument Passing FAQ
Questions
- Isn’t the top of stack in kernel virtual memory?
- Is
PHYS_BASE
fixed? - How do I handle multiple spaces in an argument list?
- Can I enforce a maximum size on the arguments list?
Isn’t the top of stack in kernel virtual memory?
The top of stack is at PHYS_BASE
, typically 0xc0000000
, which is also where kernel virtual memory starts. However, before the processor pushes data on the stack, it decrements the stack pointer. Thus, the first (4-byte) value pushed on the stack will be at address 0xbffffffc
.
Is PHYS_BASE
fixed?
No. You should be able to support PHYS_BASE
values that are any multiple of 0x10000000
from 0x80000000
to 0xf0000000
, simply via recompilation.
How do I handle multiple spaces in an argument list?
Multiple spaces should be treated as one space. You do not need to support quotes or any special characters other than space.
Can I enforce a maximum size on the arguments list?
You can set a reasonable limit on the size of the arguments.