kern

diff src/proc.c @ 69:b45e2d5f0ae1

ok I *think* i've fixed it now
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 12 Oct 2011 14:39:40 +0300
parents 0a205396e1a0
children 3941e82b07f2
line diff
     1.1 --- a/src/proc.c	Mon Oct 10 04:16:01 2011 +0300
     1.2 +++ b/src/proc.c	Wed Oct 12 14:39:40 2011 +0300
     1.3 @@ -93,7 +93,7 @@
     1.4  	memcpy((void*)img_start_addr, test_proc, proc_size_pg * PGSIZE);
     1.5  	printf("copied init process at: %x\n", img_start_addr);
     1.6  
     1.7 -	/* allocate the first page of the process stack */
     1.8 +	/* allocate the first page of the user stack */
     1.9  	stack_pg = ADDR_TO_PAGE(KMEM_START) - 1;
    1.10  	if(pgalloc_vrange(stack_pg, 1) == -1) {
    1.11  		panic("failed to allocate user stack page\n");
    1.12 @@ -194,7 +194,8 @@
    1.13  	/* will be copied on write */
    1.14  	p->user_stack_pg = parent->user_stack_pg;
    1.15  
    1.16 -	p->ctx.pgtbl_paddr = clone_vm(CLONE_COW);
    1.17 +	/* clone the parent's virtual memory */
    1.18 +	clone_vm(p, parent, CLONE_COW);
    1.19  
    1.20  	/* done, now let's add it to the scheduler runqueue */
    1.21  	add_proc(p->id);