Sam
2011-07-22 06:22:49 UTC
Hi,
We are having a bit of trouble loading pages into memory.
We know that our implementation should be based on the load_segment code
provided, but we would like the following to be clarified a bit:
1. We know that we could refer to a physical address by a virtual address.
We noticed that there is a macro called "PADDR_TO_KVADDR(paddr)" which
returns a kernel virtual address of paddr. What we are not sure is that,
is this returned vaddr a "reference" to the passed in paddr? Could we make
use of this if we are trying to load something into the paddr?
2. If possible, we would like to know what kind of values should be stored
into the fields of a uio structure.
3. We made use of VOP_READ for loading values onto memory (please hint us
if our approach is incorrect). As mentioned in previous posts, load_elf
should call a function (say save_info) that saves vnodes, offsets, and
sizes for future use. However, when we tried to run palin, the load_elf
function never called save_info on stack segment. Since VOP_READ requires
a vnode, how could a stack segment be loaded in this case?
Thanks in advance!
We are having a bit of trouble loading pages into memory.
We know that our implementation should be based on the load_segment code
provided, but we would like the following to be clarified a bit:
1. We know that we could refer to a physical address by a virtual address.
We noticed that there is a macro called "PADDR_TO_KVADDR(paddr)" which
returns a kernel virtual address of paddr. What we are not sure is that,
is this returned vaddr a "reference" to the passed in paddr? Could we make
use of this if we are trying to load something into the paddr?
2. If possible, we would like to know what kind of values should be stored
into the fields of a uio structure.
3. We made use of VOP_READ for loading values onto memory (please hint us
if our approach is incorrect). As mentioned in previous posts, load_elf
should call a function (say save_info) that saves vnodes, offsets, and
sizes for future use. However, when we tried to run palin, the load_elf
function never called save_info on stack segment. Since VOP_READ requires
a vnode, how could a stack segment be loaded in this case?
Thanks in advance!