Subject: evbarm, new board, start_init function USRSTACK problem
To: None <port-arm@NetBSD.org>
From: Janusz Dziedzic <janusz.dziedzic@gmail.com>
List: port-arm
Date: 11/02/2007 16:24:12
------=_Part_15718_30416432.1194017052203
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hello,

Two weeks ago I've started with my board and NetBSD.

Now I have problem with start_init function. I don't know that is a UVM
problem or I don't understand everything correctly.



    /*
     * Need just enough stack to hold the faked-up "execve()" arguments.
     */
    addr = (vaddr_t)STACK_ALLOC(USRSTACK, PAGE_SIZE);    // is 0xBFFFF000

    /* should this add maping ( 0xBFFFF000 <---> Physical_Memory)  to
pagetable? */
    if (uvm_map(&p->p_vmspace->vm_map, &addr, PAGE_SIZE,
                    NULL, UVM_UNKNOWN_OFFSET, 0,
                    UVM_MAPFLAG(UVM_PROT_ALL, UVM_PROT_ALL, UVM_INH_COPY,
            UVM_ADV_NORMAL,
                    UVM_FLAG_FIXED|UVM_FLAG_OVERLAY|UVM_FLAG_COPYONW)) != 0)
        panic("init: couldn't allocate argument space");
    p->p_vmspace->vm_maxsaddr = (void *)STACK_MAX(addr, PAGE_SIZE);

    ipx = 0;

   ....
   /* here I have data abort, because 0xBFFFFFFD is not mapped in MMU page
table */
   (void)copyout((void *)flags, arg1, i);

  So should I map this address in machdep file or where can I find problem?


Additional information:
http://valhalla.bofh.pl/~l4mer/userstack.PNG           // from Lauterbach -
useful
http://valhalla.bofh.pl/~l4mer/beast.txt                   // console output
http://valhalla.bofh.pl/~l4mer/beast_machdep.c      // machdep fiele
http://valhalla.bofh.pl/~l4mer/beast_start.S            // startup file


KERNEL_BASE_PHYS=0x00200000
KERNEL_BASE_VIRT=0xc0200000


BR
-- 
Janusz

------=_Part_15718_30416432.1194017052203
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hello,<br><br>Two weeks ago I&#39;ve started with my board and NetBSD.<br><br>Now I have problem with start_init function. I don&#39;t know that is a UVM problem or I don&#39;t understand everything correctly.<br><br><br><br>
&nbsp;&nbsp;&nbsp; /*<br>&nbsp;&nbsp;&nbsp; &nbsp;* Need just enough stack to hold the faked-up &quot;execve()&quot; arguments.<br>&nbsp;&nbsp;&nbsp; &nbsp;*/<br>&nbsp;&nbsp;&nbsp; addr = (vaddr_t)STACK_ALLOC(USRSTACK, PAGE_SIZE);&nbsp;&nbsp;&nbsp; // is 0xBFFFF000<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; /* <span style="font-weight: bold;">
should this add maping ( 0xBFFFF000 &lt;---&gt; Physical_Memory)&nbsp; to pagetable?</span> */<br>&nbsp;&nbsp;&nbsp; if (uvm_map(&amp;p-&gt;p_vmspace-&gt;vm_map, &amp;addr, PAGE_SIZE,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NULL, UVM_UNKNOWN_OFFSET, 0,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UVM_MAPFLAG(UVM_PROT_ALL, UVM_PROT_ALL, UVM_INH_COPY,
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; UVM_ADV_NORMAL,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UVM_FLAG_FIXED|UVM_FLAG_OVERLAY|UVM_FLAG_COPYONW)) != 0)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; panic(&quot;init: couldn&#39;t allocate argument space&quot;);<br>&nbsp;&nbsp;&nbsp; p-&gt;p_vmspace-&gt;vm_maxsaddr = (void *)STACK_MAX(addr, PAGE_SIZE);
<br><br>&nbsp;&nbsp;&nbsp; ipx = 0;<br><br>&nbsp;&nbsp; ....<br>&nbsp;&nbsp; /* <span style="font-weight: bold;">here I have data abort, because 0xBFFFFFFD is not mapped in MMU page table</span> */<br>&nbsp;&nbsp; (void)copyout((void *)flags, arg1, i);<br><br>&nbsp; So should I map this address in machdep file or where can I find problem?
<br><br><br clear="all">Additional information:<br><a href="http://valhalla.bofh.pl/~l4mer/userstack.PNG">http://valhalla.bofh.pl/~l4mer/userstack.PNG</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // from Lauterbach - useful<br><a href="http://valhalla.bofh.pl/~l4mer/beast.txt">
http://valhalla.bofh.pl/~l4mer/beast.txt</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // console output<br><a href="http://valhalla.bofh.pl/~l4mer/beast_machdep.c">http://valhalla.bofh.pl/~l4mer/beast_machdep.c</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // machdep fiele<br><a href="http://valhalla.bofh.pl/~l4mer/beast_start.S">
http://valhalla.bofh.pl/~l4mer/beast_start.S</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // startup file<br><br><br>KERNEL_BASE_PHYS=0x00200000<br>KERNEL_BASE_VIRT=0xc0200000<br><br><br>BR<br>-- <br>Janusz<br>

------=_Part_15718_30416432.1194017052203--