Compare commits

..

2 Commits

Author SHA1 Message Date
bc0c885052 add memory allocation for thread stack
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: Julien CLEMENT <julien.clement@epita.fr>
2022-12-31 00:05:17 +01:00
268b36188e start thread new
Signed-off-by: Julien CLEMENT <julien.clement@epita.fr>
2022-12-30 23:51:03 +01:00

@ -1,3 +1,17 @@
use alloc::alloc::{alloc, dealloc, Layout};
const STACK_SIZE: usize = 4096 * 20;
pub struct Thread { pub struct Thread {
rsp: u64 rsp: u64
} }
impl Thread {
pub fn new() -> Self {
unsafe {
Thread {
rsp: alloc(Layout::new::<[u8; STACK_SIZE]>()) as u64,
}
}
}
}