Discussion:
passing value of Process_Info array
(too old to reply)
Andrew Schultz
2005-09-20 08:57:10 UTC
Permalink
I am having trouble getting the contents of the Process_Info array from the
syscall to ps.c. I set a Process_Info* to state->ebx, which should just be
a pointer, I make modifications to that array in Sys_PS but when I return
fromt he Syscall to ps.c those values are not in the array I orriginally
passed in. I conclude I must be messing something up with passing by
reference, my lack of proficiency in c halting my progress. Any tips on
this? Am I messing up the syntax or pointer logic or is there a larger
problem here? Any help would be appreciated.
Iulian Neamtiu
2005-09-20 13:49:32 UTC
Permalink
You using Copy_To_User() ? If not, you should. The userland pointer
translates to a different pointer in kernelspace. Remember the
segmentation story in recitation ? Most probably, you're using the
user-passed pointer 'as is', trash the kernel's memory space when
writing there and return nothing to the user process.

Iulian
Post by Andrew Schultz
I am having trouble getting the contents of the Process_Info array from the
syscall to ps.c. I set a Process_Info* to state->ebx, which should just be
a pointer, I make modifications to that array in Sys_PS but when I return
fromt he Syscall to ps.c those values are not in the array I orriginally
passed in. I conclude I must be messing something up with passing by
reference, my lack of proficiency in c halting my progress. Any tips on
this? Am I messing up the syntax or pointer logic or is there a larger
problem here? Any help would be appreciated.
Continue reading on narkive:
Loading...