Compare commits
2 Commits
49f1821f9c
...
6e64101d09
Author | SHA1 | Date | |
---|---|---|---|
6e64101d09 | |||
88fd29ea1a |
@ -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,11 +61,14 @@ 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::new();
|
let mut executor = EXECUTOR.try_lock().unwrap();
|
||||||
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,7 +1,15 @@
|
|||||||
|
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