1
0
mirror of https://github.com/sgmarz/osblog.git synced 2024-11-23 18:06:20 +04:00

Use zalloc to clear page tables.

This commit is contained in:
Stephen Marz 2019-11-28 12:02:37 -05:00
parent c5179e60d6
commit c99bff8944

View File

@ -4,7 +4,7 @@
// 27 Nov 2019
use crate::{cpu::TrapFrame,
page::{alloc, dealloc, Table, PAGE_SIZE}};
page::{alloc, dealloc, zalloc, Table, PAGE_SIZE}};
use alloc::collections::linked_list::LinkedList;
const STACK_PAGES: usize = 2;
@ -142,7 +142,7 @@ impl Process {
stack: alloc(STACK_PAGES),
program_counter: func as usize,
pid: pd,
root: alloc(1) as *mut Table,
root: zalloc(1) as *mut Table,
state: ProcessState::Waiting,
data: ProcessData::zero(), };
// Now we move the stack pointer to the bottom of the