Hi everyone,<br><br>there are some functions can alloc memory in kernel, but it seems that I cannot use it directly. Here is my code:<br><br>static int mytest_vm(){<br><br>        struct vm_struct *v_start;<br><br>        v_start=alloc_vm_area(PAGE_SIZE,NULL); //the kernel api has changed, I don&#39;t understand why there is a second parameter<br>
        if(v_start==NULL){<br>                printk(&quot;cannot alloc page\n&quot;);<br>                return -1;<br>        }<br><br>        sprintf((char *)v_start-&gt;addr,&quot;this is a test.\n&quot;);<br>        printk(&quot;after sprintk:%s&quot;,(char *)v_start-&gt;addr);<br>
<br>        free_vm_area(v_start);<br><br>        return 0;<br>}<br>module_init(mytest_vm);<br><br>but it just got a kernel Oops. Can anyone explain this to me? Thanks very much!<br><br>