From: AceVest Date: Mon, 28 Jul 2014 15:44:52 +0000 (+0800) Subject: success on bochs X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=d278012d1e418a471dc7ce374288a937e8f1e776;p=kernel.git success on bochs --- diff --git a/bin/shell.c b/bin/shell.c index 9631d97..b3e5724 100644 --- a/bin/shell.c +++ b/bin/shell.c @@ -22,7 +22,7 @@ int main() if(pid > 0) { int n = 10000000; - while(n--); + //while(n--); printf("parent\n"); while(1) { diff --git a/kernel/exec.c b/kernel/exec.c index d76a35b..d6ffd26 100644 --- a/kernel/exec.c +++ b/kernel/exec.c @@ -43,8 +43,7 @@ void put_paging(unsigned long vaddr, unsigned long paddr, unsigned long flags) assert(page_table != 0); } - - page_dir[npde] = (unsigned long) page_table | flags; + page_dir[npde] = (unsigned long) page_table | flags | PAGE_P | PAGE_WR; page_table = pa2va(page_table); page_table[npte] = paddr | flags; } @@ -115,7 +114,7 @@ int sysc_exec(const char *path, char *const argv[]) disable_irq(); pt_regs_t *regs = ((pt_regs_t *)(TASK_SIZE+(unsigned long)current)) - 1; -#if 0 +#if 1 memset((void*)regs, 0, sizeof(pt_regs_t)); regs->ss = SELECTOR_USER_DS; regs->ds = SELECTOR_USER_DS; diff --git a/mm/page.c b/mm/page.c index fa4b16e..3b1b869 100644 --- a/mm/page.c +++ b/mm/page.c @@ -19,8 +19,7 @@ void do_no_page(void *addr) { - //printk("%s addr %08x\n", __func__, (unsigned long)addr); - + printk("%s addr %08x\n", __func__, (unsigned long)addr); #if 1 pde_t *page_dir = (pde_t *)current->cr3; pte_t *page_tbl = 0; @@ -79,6 +78,7 @@ void do_no_page(void *addr) void do_wp_page(void *addr) { + printk("%s addr %08x\n", __func__, (unsigned long)addr); #if 1 int npde = get_npd(addr); int npte = get_npt(addr);