start_init data abort
Mark Tinguely
tinguely at casselton.net
Tue Jul 21 16:48:03 UTC 2009
>
> 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.
More information about the freebsd-arm
mailing list