diff --git a/src/interrupts/pic/pit.rs b/src/interrupts/pic/pit.rs index 23a1cc1..50acdd8 100644 --- a/src/interrupts/pic/pit.rs +++ b/src/interrupts/pic/pit.rs @@ -9,6 +9,7 @@ pub fn gettick() -> u64 { } pub extern "x86-interrupt" fn timer_interrupt_handler(_stack_frame: InterruptStackFrame) { + // TODO: thread preemption unsafe { TICKS += 1; PICS.lock() diff --git a/src/proc/scheduler/mod.rs b/src/proc/scheduler/mod.rs index 7d09de8..a5eef06 100644 --- a/src/proc/scheduler/mod.rs +++ b/src/proc/scheduler/mod.rs @@ -15,6 +15,7 @@ use futures_util::task::AtomicWaker; use lazy_static::lazy_static; lazy_static! { + // TODO: put this in a spin mutex instead pub static ref SCHEDULER: AsyncMutex = AsyncMutex::new(Scheduler::new()); } @@ -23,6 +24,7 @@ pub type Threadt = Arc>; pub const K_THREAD_ID: ThreadId = ThreadId(0); // Kernel main thread identifier struct ThreadStream { + // TODO: add the double scheduler queue ids: ArrayQueue, waker: AtomicWaker, } diff --git a/src/utils/mutex.rs b/src/utils/mutex.rs index 70ffb13..24f4bef 100644 --- a/src/utils/mutex.rs +++ b/src/utils/mutex.rs @@ -11,6 +11,7 @@ use futures_util::task::AtomicWaker; #[derive(Clone)] struct Lock { lock: Arc, + // TODO: Make a queue of wakers waker: Arc, }