Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "copy" function between different memory spaces #2

Open
marklang1993 opened this issue Aug 5, 2017 · 0 comments
Open

Add "copy" function between different memory spaces #2

marklang1993 opened this issue Aug 5, 2017 · 0 comments

Comments

@marklang1993
Copy link
Owner

After splitting Kernel Space and Non-Kernel Space and adding Paging mechanism, copying between different processes (with different privileges) is required.

Between kernel and non-kernel processes (Ring 0 <-> Ring 1, 2, 3):

  • void copy_to_kernel(void* dst, void* src, uint32 size, uint32 pid);
    From (src, pid) to (dst)
  • void copy_to_non_kernel(void* dst, void* src, uint32 size, uint32 pid);
    From (src) to (dst, pid)
    NOTE: Must be called by kernel process.

Between non-kernel processes (Ring 1, 2, 3 <-> Ring 1, 2, 3)

  • void copy_to(void* dst, void* src, uint32 size, uint32 pid);
    From (src, CURRENT_PID) to (dst, pid)
  • void copy_from(void* dst, void* src, uint32 size, uint32 pid);
    From (src, pid) to (dst, CURRENT_PID)
    NOTE: subject is the process of the caller.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant