Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Jul 2009 11:48:02 -0500 (CDT)
From:      Mark Tinguely <tinguely@casselton.net>
To:        freebsd-arm@freebsd.org, xiechao.mail@gmail.com
Subject:   Re: start_init data abort
Message-ID:  <200907211648.n6LGm2KW076061@casselton.net>
In-Reply-To: <c11a0ecf0907192038t6ba7ba11g2b41591fe4285e3@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
>
>  hi
>  I am trying to port Freebsd to pxa310. After I have compiled, and get
>  kernel.bin, i will directly download it to SDRAM, and begin to run it. The
>  SYSINITs are all right, and i get the final init - start_init. At this time,
>  a exception of data abort happens.
>  After i debug it, i find it is caused by subyte at the following code.
>  /*
>           * Move out the boot flag argument.
>           */
>          options = 0;
>          ucp = (char *)p->p_sysent->sv_usrstack;
>          (void)subyte(--ucp, 0);        /* trailing zero */
>          if (boothowto & RB_SINGLE) {
>              (void)subyte(--ucp, 's');
>              options = 1;
>          }
>
>  It seems that subyte will store a byte to user stack of initproc. The user
>  stack of initproc is started at 0xC0000000. i have checked the page mapping,
>  and find the veirtual address 0xC0000000 - PAGESIZE to 0xC0000000 is not
>  mapped. So i get the data abort.
>  I am confuesed. Where should i map the user stack of initproc? I appreciate
>  that someone can help me.Thanks.

In the begining of that routine, the user stack is put into the map
backed by a default (NULL) object. A page for the stack should fault
a page into that location when accessed. For testing, you can speed it
along a bit by setting the MAP_PREFAULT bit:

	addr = p->p_sysent->sv_usrstack - PAGE_SIZE;
	if (vm_map_find(&p->p_vmspace->vm_map, NULL, 0, &addr, PAGE_SIZE,
-			FALSE, VM_PROT_ALL, VM_PROT_ALL, 0) != 0)
+			FALSE, VM_PROT_ALL, VM_PROT_ALL, MAP_PREFAULT) != 0)
                panic("init: couldn't allocate argument space");

If there is still no page at that location and you have a console, you
can print out the vm_map.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907211648.n6LGm2KW076061>