Ran cargo fmt, clippy fixes, suppressed some warns

I will start working on stack traces tonight and tomorrow.

We need to be able to 'unwind' by finding calling functions.
This commit is contained in:
2025-03-04 23:06:47 +00:00
parent 8704b5d249
commit d53661b9a0
25 changed files with 300 additions and 176 deletions
@@ -2,7 +2,6 @@
//!
//! Written by @zxq5 for the most part with code from
//! [here](https://github.com/phil-opp/blog_os/).
//!
use alloc::boxed::Box;
use alloc::collections::BTreeMap;
@@ -81,9 +80,9 @@ impl Executor {
Some(task) => task,
None => continue, // task no longer exists
};
let waker = waker_cache
.entry(task_id)
.or_insert_with(|| TaskWaker::new_waker(task_id, task_queue.clone()));
let waker = waker_cache.entry(task_id).or_insert_with(|| {
TaskWaker::new_waker(task_id, task_queue.clone())
});
let mut context = Context::from_waker(waker);
match task.poll(&mut context) {
Poll::Ready(()) => {
@@ -129,7 +128,10 @@ impl TaskWaker {
self.task_queue.push(self.task_id).expect("task_queue full");
}
fn new_waker(task_id: TaskId, task_queue: Arc<ArrayQueue<TaskId>>) -> Waker {
fn new_waker(
task_id: TaskId,
task_queue: Arc<ArrayQueue<TaskId>>,
) -> Waker {
Waker::from(Arc::new(Self {
task_id,
task_queue,
+2 -1
View File
@@ -1,3 +1,4 @@
#![expect(unused)]
pub mod async_io;
pub mod threading;
mod taskrunner;
pub mod threading;
@@ -6,7 +6,7 @@ pub struct Task {
}
impl Task {
pub fn new() {}
// pub const fn new() {}
pub fn run() {}
}
pub const fn run() {}
}
@@ -1,5 +1,5 @@
use x86_64::VirtAddr;
use crate::arch::x86_64::memory::allocation::stack_alloc::StackBounds;
use x86_64::VirtAddr;
mod switch;
@@ -10,8 +10,6 @@ pub struct Thread {
stack_bounds: Option<StackBounds>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub struct ThreadId(u64);