1

I want to write a program that can save a process's state when it exits in a file and another program to reload this process's state and run it from were it left in xv6 OS. Something like keeping processes' state when you are changing among processes in a scheduler.

But the problem is I'm new to the xv6 OS and I have no idea where to start with. I think I can do the saving part but I don't knew how is it possible to reload a process state into CPU and run it.

Can anyone help me with some resources to start with?
Any help with the xv6 programming would be good.

Sparrow7000
  • 79
  • 1
  • 11
  • Maybe reading proc.c will help you!! It's all about reading the saved file again, get it back into the ptable and changing the state to runnable. – Sarah Akhavan Jan 15 '16 at 00:27

1 Answers1

0

Till now I realized that I should write two new system calls and add them to the xv6 OS kernel. So using one system call I can save process state and using the other one I can reload the previous state and continue.
The OS kernel files which need to be modified are mention in this post https://stackoverflow.com/a/13205101/3057558 .
If you check the files you will understand which lines you need to change.

Community
  • 1
  • 1
Sparrow7000
  • 79
  • 1
  • 11