copy also the entries of the pgt container
This commit is contained in:
parent
6613b13c1c
commit
fc407a3eda
1 changed files with 9 additions and 3 deletions
|
@ -163,8 +163,10 @@ int create_pgd(task_t* task, int copy)
|
|||
continue;
|
||||
|
||||
phyaddr = copy_page_table(task, i, (page_table_t*) ((KERNEL_SPACE - 1024*PAGE_SIZE + i*PAGE_SIZE) & 0xFFFFF000), &counter);
|
||||
if (phyaddr)
|
||||
if (phyaddr) {
|
||||
pgd->entries[i] = (phyaddr & 0xFFFFF000) | (curr_task->pgd->entries[i] & 0xFFF);
|
||||
pgt->entries[i] = (phyaddr & 0xFFFFF000) | KERN_PAGE;
|
||||
}
|
||||
}
|
||||
|
||||
spinlock_unlock(&curr_task->pgd_lock);
|
||||
|
@ -607,9 +609,13 @@ int arch_paging_init(void)
|
|||
for(i=0; i<KERNEL_SPACE/(1024*PAGE_SIZE)-1; i++) {
|
||||
size_t phyaddr = get_page();
|
||||
|
||||
if (!phyaddr)
|
||||
continue;
|
||||
if (!phyaddr) {
|
||||
kputs("arch_paging_init: Not enough memory!\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
memset((void*) phyaddr, 0, PAGE_SIZE);
|
||||
per_core(current_task)->pgd->entries[i] = (phyaddr & 0xFFFFF000)|KERN_TABLE;
|
||||
pgt->entries[i] = (phyaddr & 0xFFFFF000)|KERN_PAGE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue