Compare commits
No commits in common. "6e64101d099f95e948ccfd77213dca8beabc54e0" and "49f1821f9c7d6e0d1814abd4c712cd2568ea9738" have entirely different histories.
6e64101d09
...
49f1821f9c
@ -21,7 +21,7 @@ use crate::fs::FileSystem;
|
|||||||
use core::panic::PanicInfo;
|
use core::panic::PanicInfo;
|
||||||
use drivers::vga::{self, Color, ColorCode};
|
use drivers::vga::{self, Color, ColorCode};
|
||||||
use multiboot2::BootInformation;
|
use multiboot2::BootInformation;
|
||||||
use task::{executor::EXECUTOR, keyboard, Task};
|
use task::{executor::Executor, keyboard, Task};
|
||||||
|
|
||||||
use alloc::sync::Arc;
|
use alloc::sync::Arc;
|
||||||
use core::cell::RefCell;
|
use core::cell::RefCell;
|
||||||
@ -61,14 +61,11 @@ pub extern "C" fn julios_main(multiboot_info_addr: usize) -> ! {
|
|||||||
println!("***JuliOS V0.1.0***");
|
println!("***JuliOS V0.1.0***");
|
||||||
serial_println!("Hello serial");
|
serial_println!("Hello serial");
|
||||||
|
|
||||||
let mut executor = EXECUTOR.try_lock().unwrap();
|
let mut executor = Executor::new();
|
||||||
executor.spawn(Task::new(drivers::atapi::init()));
|
executor.spawn(Task::new(drivers::atapi::init()));
|
||||||
executor.spawn(Task::new(keyboard::print_keypresses()));
|
executor.spawn(Task::new(keyboard::print_keypresses()));
|
||||||
executor.spawn(Task::new(get_file()));
|
executor.spawn(Task::new(get_file()));
|
||||||
executor.spawn(Task::new(proc::scheduler::scheduler_run()));
|
executor.spawn(Task::new(proc::scheduler::scheduler_run()));
|
||||||
|
|
||||||
EXECUTOR.force_unlock(); // Ouioui t'inquietes
|
|
||||||
|
|
||||||
executor.run();
|
executor.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,15 +1,7 @@
|
|||||||
use crate::utils::AsyncMutex;
|
|
||||||
|
|
||||||
use super::{Task, TaskId};
|
use super::{Task, TaskId};
|
||||||
|
|
||||||
use alloc::{collections::BTreeMap, sync::Arc, task::Wake};
|
use alloc::{collections::BTreeMap, sync::Arc, task::Wake};
|
||||||
use core::task::{Context, Poll, Waker};
|
use core::task::{Context, Poll, Waker};
|
||||||
use crossbeam_queue::ArrayQueue;
|
use crossbeam_queue::ArrayQueue;
|
||||||
use lazy_static::lazy_static;
|
|
||||||
|
|
||||||
lazy_static! {
|
|
||||||
pub static ref EXECUTOR: AsyncMutex<Executor> = AsyncMutex::new(Executor::new());
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct Executor {
|
pub struct Executor {
|
||||||
tasks: BTreeMap<TaskId, Task>,
|
tasks: BTreeMap<TaskId, Task>,
|
||||||
|
Loading…
Reference in New Issue
Block a user