p_nr to pid - Minix

This is a discussion on p_nr to pid - Minix ; Hi, Is there any way by which we can get the actual pid(process id) from p_nr(process number) which is defined in proc structure in kernel/proc.h Thanks DKR...

+ Reply to Thread
Results 1 to 8 of 8

Thread: p_nr to pid

  1. p_nr to pid

    Hi,

    Is there any way by which we can get the actual pid(process id) from
    p_nr(process number) which is defined in proc structure in kernel/proc.h

    Thanks
    DKR

  2. Re: p_nr to pid

    All,

    > Is there any way by which we can get the actual pid(process id) from
    > p_nr(process number) which is defined in proc structure in kernel/proc.h


    Not from the kernel. Only PM knows about pids. So you have to obtain
    the PM process table and look up the pid in that.

    =Ben



  3. Re: p_nr to pid

    hello ben/deepak
    im working on similar thing as deepak. i'm figuring out how to pass pid
    of a usrprocess to kernel so as to execute the usrprocess of my choice.

    according to ben suggestion i was trying to locate which part of the
    code in PM , takes care of this. if the kernel is not able to identify
    the pid of a usrprocess my assumption is , the PM converts pid into a
    parameter and supplies that to kernel.

    or if sendrec can manage this, how do i work with sendrec to pass pid
    of a usrprocess to kernel
    thank u
    pavan

    Ben Gras wrote:
    > All,
    >
    > > Is there any way by which we can get the actual pid(process id) from
    > > p_nr(process number) which is defined in proc structure in kernel/proc.h

    >
    > Not from the kernel. Only PM knows about pids. So you have to obtain
    > the PM process table and look up the pid in that.
    >
    > =Ben



  4. Re: p_nr to pid

    All,

    > im working on similar thing as deepak. i'm figuring out how to pass pid
    > of a usrprocess to kernel so as to execute the usrprocess of my choice.
    >
    > according to ben suggestion i was trying to locate which part of the
    > code in PM , takes care of this. if the kernel is not able to identify
    > the pid of a usrprocess my assumption is , the PM converts pid into a
    > parameter and supplies that to kernel.
    >
    > or if sendrec can manage this, how do i work with sendrec to pass pid
    > of a usrprocess to kernel


    ?

    If the PM wants do make the kernel do something with a process based on
    a pid, then yes, the PM converts it to a process slot number in 3.1.1.
    In 3.1.2 this is an endpoint number, but the difference isn't relevant
    now.

    But I don't understand what you are trying to accomplish from your
    message.

    =Ben



  5. Re: p_nr to pid

    how can i work with sendrec to pass pid from a userprocess to the
    kernel?
    thank u
    pavan


  6. Re: p_nr to pid

    I need to execute only the specified user process.
    Which part of the code do I need to modify to pass pid (of a user
    process) to kernel so that I can execute only the specified user
    process ?


  7. Re: p_nr to pid

    pavan.kristipati@gmail.com wrote:
    > I need to execute only the specified user process.
    > Which part of the code do I need to modify to pass pid (of a user
    > process) to kernel so that I can execute only the specified user
    > process ?
    >


    Do you realize that if you limit execution to just one user process that
    you **** yourself over in the fact that you cannot:

    * Read or write to a terminal
    * Use the disks
    * Use the network

    This is because *all* drivers are USERLAND PROCESSES as well! Thanks to
    the microkernel architechure, you are a retard and have just ****ed
    yourself.

  8. Re: p_nr to pid

    All,

    On 28 Mar 2006 16:05:17 -0800, pavan.kristipati@gmail.com wrote:
    > I need to execute only the specified user process.
    > Which part of the code do I need to modify to pass pid (of a user
    > process) to kernel so that I can execute only the specified user
    > process ?


    That's an interesting coincedence, I answered the same question by
    email this weekend.. I wonder what's going on?

    Ah, here it is:
    http://www.iit.edu/~manov/CS551P1F2003.htm

    It's just the first assignment!

    =Ben



+ Reply to Thread