mirror of
https://github.com/sgmarz/osblog.git
synced 2024-11-24 02:16:19 +04:00
Use zalloc to clear page tables.
This commit is contained in:
parent
c5179e60d6
commit
c99bff8944
@ -4,7 +4,7 @@
|
|||||||
// 27 Nov 2019
|
// 27 Nov 2019
|
||||||
|
|
||||||
use crate::{cpu::TrapFrame,
|
use crate::{cpu::TrapFrame,
|
||||||
page::{alloc, dealloc, Table, PAGE_SIZE}};
|
page::{alloc, dealloc, zalloc, Table, PAGE_SIZE}};
|
||||||
use alloc::collections::linked_list::LinkedList;
|
use alloc::collections::linked_list::LinkedList;
|
||||||
|
|
||||||
const STACK_PAGES: usize = 2;
|
const STACK_PAGES: usize = 2;
|
||||||
@ -142,7 +142,7 @@ impl Process {
|
|||||||
stack: alloc(STACK_PAGES),
|
stack: alloc(STACK_PAGES),
|
||||||
program_counter: func as usize,
|
program_counter: func as usize,
|
||||||
pid: pd,
|
pid: pd,
|
||||||
root: alloc(1) as *mut Table,
|
root: zalloc(1) as *mut Table,
|
||||||
state: ProcessState::Waiting,
|
state: ProcessState::Waiting,
|
||||||
data: ProcessData::zero(), };
|
data: ProcessData::zero(), };
|
||||||
// Now we move the stack pointer to the bottom of the
|
// Now we move the stack pointer to the bottom of the
|
||||||
|
Loading…
Reference in New Issue
Block a user