1

If I want to add my system call vfork(copy on write) what exactly need to be edited in syscall.c? Where would I add my fragment of vfork's code. In short, how would I implement vfork in xv6?

smac89
  • 39,374
  • 15
  • 132
  • 179
ahmad
  • 11
  • 1
  • Possible duplicate of [how do i add a system call / utility in xv6](http://stackoverflow.com/questions/8021774/how-do-i-add-a-system-call-utility-in-xv6) – smac89 Nov 26 '16 at 04:31

1 Answers1

1

For adding the system call in xv6's shell; amend the following files:

  • sysproc.c add the real implementation of your method here
  • syscall.h define the position of the system call vector that connect to your implementation
  • user.h define the function that can be called through the shell
  • syscall.c external define the function that connect the shell and the kernel, use the position defined in syscall.h to add the function to the system call vector
  • usys.S use the macro to define connect the call of user to the system call function

Also you can check the following link.

Community
  • 1
  • 1
suneet saini
  • 592
  • 3
  • 16