Re: problem is with process 0 and process 1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Selon Guillaume Thouvenin <guillaume.thouvenin@polymtl.ca>:

> I changed function elsa_copy_parent_bank(struct task_struct *p) to
> elsa_copy_parent_bank(struct task_struct *from, struct task_struct *to)
> where
> "from" is the parent and "to" is the child. I also added a printk to see pid
> of
> processus implied in the crash. I can see that crash occured when:
> "elsa_copy_parent_bank: from pid#0 to pid#1"
> 
> AFAIK, process 0 is the idle task and process 1 is "init". My question is,
> where
>  are process 0 fields initilized? Others processes are initialized during
> the
> fork (right?) but how/where process 0 starts? 

I think that I found the problem but I'm not sure that's why I'd like to have a
confirmation.

I think that the initialization of the process that I put in kernel/fork.c
inside copy_process() is not enough. It seems that by doing that, process 0 is
not initialized (I don't know why). So, when calling elsa_copy_parent_bank(0,1),
it causes an oops because current->bank_head is not initialized. To correct that
I add another initialization in fork_init()..... 

I understand that fork_init() is called when kernel starts to initialize
information used during fork so, this function is just called once, right? Is
copy_process() called with current->pid == 0? I'm not very happy with my
implementation because I must initialize the process 0 and other process, is it
possible to do it in the same appropriate place for all processes?

Thanks,
Guillaume  

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux