DEV Community

Van a performance artist
Van a performance artist

Posted on

how to pass pointer from user to kernel in xv6

the addr in usermode and kernel mode it different. so while passing pointer to kernel mode, we should just pass a uint64 var to it.
then we can get it through function as a var.
Image description
it is more like a offset, later we can locate it.

Image description
argaddr works same like argint, it capture the arg of syscall from proc sturcture

Image description
then we can get the real address of the virtual address by its pagetable and offset easily

Image description

Image description
memmove part is pretty simple, kernel mode has the right to access all address
Image description

Heroku

Deploy with ease. Manage efficiently. Scale faster.

Leave the infrastructure headaches to us, while you focus on pushing boundaries, realizing your vision, and making a lasting impression on your users.

Get Started

Top comments (0)

DevCycle image

Ship Faster, Stay Flexible.

DevCycle is the first feature flag platform with OpenFeature built-in to every open source SDK, designed to help developers ship faster while avoiding vendor-lock in.

Start shipping