Skip to content

Add "copy" function between different memory spaces #2

@marklang1993

Description

@marklang1993

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions