From: AceVest Date: Mon, 28 Jul 2014 16:36:51 +0000 (+0800) Subject: success on qemu X-Git-Url: http://zhaoyanbai.com/repos/%22http:/static/doc/zpipe.c?a=commitdiff_plain;h=02e92021335bcc50d3f4840918b2f81b6e2d7cc1;p=kernel.git success on qemu --- diff --git a/kernel/syscall.c b/kernel/syscall.c index a864bad..c60d5ac 100644 --- a/kernel/syscall.c +++ b/kernel/syscall.c @@ -59,7 +59,11 @@ int sysc_test() int sysc_debug(unsigned int v) { static unsigned int cnt=0; - printl(MPL_DEBUG, "Task Debug Syscall %u Value %08x", cnt++, v); +#if 1 + printl(MPL_DEBUG, "task debug syscall %u", cnt++); +#else + printl(MPL_DEBUG, "task debug syscall %u value %08x", cnt++, v); +#endif } void init_sysc_handler_table() diff --git a/mm/page.c b/mm/page.c index 3b1b869..22ecae8 100644 --- a/mm/page.c +++ b/mm/page.c @@ -79,6 +79,10 @@ void do_no_page(void *addr) void do_wp_page(void *addr) { printk("%s addr %08x\n", __func__, (unsigned long)addr); + if((unsigned long) addr >= PAGE_OFFSET) + { + panic("%s invalid addr", __func__); + } #if 1 int npde = get_npd(addr); int npte = get_npt(addr); @@ -86,6 +90,9 @@ void do_wp_page(void *addr) pde_t *page_dir = (pde_t *)current->cr3; pte_t *page_tbl = pa2va(PAGE_ALIGN(page_dir[npde])); + //printk("%s addr %08x dirent %08x\n", __func__, (unsigned long)addr, page_dir[npde]); + //assert(page_dir[npde] != 0); + unsigned long wp_pa_addr = PAGE_ALIGN(page_tbl[npte]); page_t *page = pa2page(wp_pa_addr); @@ -104,6 +111,11 @@ void do_wp_page(void *addr) } page_tbl[npte] |= PAGE_WR; +#if 0 + page_tbl[npte] |= PAGE_US; + page_dir[npde] |= PAGE_WR; + page_dir[npde] |= PAGE_US; +#endif load_cr3(current);