My question is how cmd arguments are passed from the shell to the process memory ? How the loader loads them and if there are passed with some sort of syscall ? ill be happy if some one can explain in details or point to a relevant article.
For windows, the Loader will copy the parameters into the process' address space during process setup. Specifically it happens when the Address Space is initialized
See Stage 3D Step 8 in Windows Internals:
- The user process parameters are written into the process, copied, and fixed up (meaning converted from absolute form to a relative form so that a single memory block is needed).