Search code examples
coperating-systemxv6

How to pass arguments to system call at xv6?


I am trying to implement a new system call at xv6. Had some trouble to pass arguments. Lets say this is my system call.

sys_mySystemcall(int* x ,struct myStruct * y);

How do I get these 2 pointers at sysproc.c? Thanks,


Solution

  • The helper functions argint, argptr, argstr,and argfd retrieve the n’th system call argument, as either an integer, pointer, a string,or a file descriptor.