Discussion:
'Name' field in Sys_PS
(too old to reply)
Daniel Ramsbrock
2005-09-13 17:04:02 UTC
Permalink
In the project description, it says that the 'name' field in
Process_Info needs to come from the 'program' argument of Spawn(), but I
don't see Spawn() storing this information anywhere. Should we be
creating a new field for this in the User_Context struct? Perhaps even
store a pointer to an entire Process_Info struct inside User_Context? Or
should we be extracting the program name from the argument block
(pointed to by User_Context->argBlockAddr)?

If not either of those, what would be the recommended approach?

Thanks,

Daniel
Iulian Neamtiu
2005-09-17 04:37:16 UTC
Permalink
Post by Daniel Ramsbrock
In the project description, it says that the 'name' field in
Process_Info needs to come from the 'program' argument of Spawn(), but I
don't see Spawn() storing this information anywhere. Should we be
creating a new field for this in the User_Context struct?
Yes, that seems the most natural approach.

Perhaps even
Post by Daniel Ramsbrock
store a pointer to an entire Process_Info struct inside User_Context?
Well, info such as 'status' changes continously, so keeping this struct
Process_Info up-to-date would be tedious. Plus, 'priority' and 'pid' are
in struct Kernel_Thread already.

Or
Post by Daniel Ramsbrock
should we be extracting the program name from the argument block
(pointed to by User_Context->argBlockAddr)?
Nope. That resides in user space, and is not to be trusted (the user
might have overwritten it with some faux data).

Iulian

Loading...