diff --git a/src/proc/thread/mod.rs b/src/proc/thread/mod.rs index 21401a5..dd4bf94 100644 --- a/src/proc/thread/mod.rs +++ b/src/proc/thread/mod.rs @@ -1,9 +1,17 @@ +use alloc::alloc::{alloc, dealloc, Layout}; + +const STACK_SIZE: usize = 4096 * 20; + pub struct Thread { rsp: u64 } impl Thread { - pub fn new() { - + pub fn new() -> Self { + unsafe { + Thread { + rsp: alloc(Layout::new::<[u8; STACK_SIZE]>()) as u64, + } + } } } \ No newline at end of file