Skip to content

Commit

Permalink
canary
Browse files Browse the repository at this point in the history
  • Loading branch information
neri committed Jan 10, 2022
1 parent d62d257 commit 1e85e92
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 25 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# MEG-OS codename Maystorm

My hobby operating system written in Rust, which Supports multitasking, multi-window, WebAssembly and simple applications.
A 2020s hobby operating system written in Rust that supports multitasking, multi-window, WebAssembly, and simple applications.

* [Documentation](https://meg-os.github.io/maystorm/kernel/)

## Feature

* A hobby OS written in Rust
* A hobby operating system written in Rust
* Not a POSIX clone system
* Support for WebAssembly

Expand Down
1 change: 1 addition & 0 deletions system/kernel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pub mod io;
pub mod log;
pub mod mem;
pub mod r;
pub mod res;
pub mod rt;
pub mod sync;
pub mod system;
Expand Down
28 changes: 14 additions & 14 deletions system/kernel/src/ui/res/icon.rs → system/kernel/src/res/icon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,51 +9,51 @@ impl IconManager {
pub fn bitmap<'a>(icon: r::Icons) -> Option<BoxedBitmap<'a>> {
match icon {
r::Icons::Apps => ImageLoader::from_qoi(include_bytes!(
"../../../../../ext/material-design-icons/ic_apps_black_24dp.qoi"
"../../../../ext/material-design-icons/ic_apps_black_24dp.qoi"
)),
r::Icons::Cancel => ImageLoader::from_qoi(include_bytes!(
"../../../../../ext/material-design-icons/ic_cancel_black_24dp.qoi"
"../../../../ext/material-design-icons/ic_cancel_black_24dp.qoi"
)),
r::Icons::Check => ImageLoader::from_qoi(include_bytes!(
"../../../../../ext/material-design-icons/ic_check_black_24dp.qoi"
"../../../../ext/material-design-icons/ic_check_black_24dp.qoi"
)),
r::Icons::ChevronLeft => ImageLoader::from_qoi(include_bytes!(
"../../../../../ext/material-design-icons/ic_chevron_left_black_24dp.qoi"
"../../../../ext/material-design-icons/ic_chevron_left_black_24dp.qoi"
)),
r::Icons::ChevronRight => ImageLoader::from_qoi(include_bytes!(
"../../../../../ext/material-design-icons/ic_chevron_right_black_24dp.qoi"
"../../../../ext/material-design-icons/ic_chevron_right_black_24dp.qoi"
)),
r::Icons::Close => ImageLoader::from_qoi(include_bytes!(
"../../../../../ext/material-design-icons/ic_close_black_24dp.qoi"
"../../../../ext/material-design-icons/ic_close_black_24dp.qoi"
)),
r::Icons::Delete => ImageLoader::from_qoi(include_bytes!(
"../../../../../ext/material-design-icons/ic_delete_black_24dp.qoi"
"../../../../ext/material-design-icons/ic_delete_black_24dp.qoi"
)),
r::Icons::Error => ImageLoader::from_qoi(include_bytes!(
"../../../../../ext/material-design-icons/ic_error_black_24dp.qoi"
"../../../../ext/material-design-icons/ic_error_black_24dp.qoi"
)),
r::Icons::Menu => ImageLoader::from_qoi(include_bytes!(
"../../../../../ext/material-design-icons/ic_menu_black_24dp.qoi"
"../../../../ext/material-design-icons/ic_menu_black_24dp.qoi"
)),
r::Icons::Info => ImageLoader::from_qoi(include_bytes!(
"../../../../../ext/material-design-icons/ic_info_outline_black_24dp.qoi"
"../../../../ext/material-design-icons/ic_info_outline_black_24dp.qoi"
)),
r::Icons::Usb => ImageLoader::from_qoi(include_bytes!(
"../../../../../ext/material-design-icons/ic_usb_black_24dp.qoi"
"../../../../ext/material-design-icons/ic_usb_black_24dp.qoi"
)),
r::Icons::Warning => ImageLoader::from_qoi(include_bytes!(
"../../../../../ext/material-design-icons/ic_warning_black_24dp.qoi"
"../../../../ext/material-design-icons/ic_warning_black_24dp.qoi"
)),
}
}

pub fn mask(icon: r::Icons) -> Option<OperationalBitmap> {
match icon {
r::Icons::Close => ImageLoader::from_qoi_mask(include_bytes!(
"../../../../../ext/material-design-icons/ic_close_black_24dp.qoi"
"../../../../ext/material-design-icons/ic_close_black_24dp.qoi"
)),
r::Icons::ChevronLeft => ImageLoader::from_qoi_mask(include_bytes!(
"../../../../../ext/material-design-icons/ic_chevron_left_black_24dp.qoi"
"../../../../ext/material-design-icons/ic_chevron_left_black_24dp.qoi"
)),
_ => None,
}
Expand Down
File renamed without changes.
10 changes: 6 additions & 4 deletions system/kernel/src/task/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,12 @@ impl Scheduler {

/// All threads will stop.
pub unsafe fn freeze(force: bool) -> Result<(), ()> {
let sch = Self::shared();
sch.is_frozen.store(true, Ordering::SeqCst);
if force {
let _ = Cpu::broadcast_schedule();
if Self::is_enabled() {
let sch = Self::shared();
sch.is_frozen.store(true, Ordering::SeqCst);
if force {
let _ = Cpu::broadcast_schedule();
}
}
Ok(())
}
Expand Down
1 change: 0 additions & 1 deletion system/kernel/src/ui/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! User Interface modules (windows, terminals, ...)
pub mod font;
pub mod res;
pub mod terminal;
pub mod text;
pub mod theme;
Expand Down
3 changes: 2 additions & 1 deletion system/kernel/src/ui/window.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
//! A Window System
use super::{font::*, res::icon::IconManager, text::*, theme::Theme};
use super::{font::*, text::*, theme::Theme};
use crate::{
io::hid_mgr::*,
res::icon::IconManager,
sync::atomicflags::*,
sync::RwLock,
sync::{fifo::*, semaphore::*},
Expand Down
5 changes: 2 additions & 3 deletions system/kernel/src/user/userenv.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
// User Environment

use crate::{
arch::cpu::*,
fs::*,
log::{EventManager, SimpleMessagePayload},
mem::*,
res::icon::IconManager,
sync::fifo::ConcurrentFifo,
system::*,
task::scheduler::*,
task::*,
ui::font::*,
ui::terminal::Terminal,
ui::text::*,
ui::theme::Theme,
ui::window::*,
ui::{res::icon::IconManager, terminal::Terminal},
*,
};
use ::alloc::{sync::Arc, vec::*};
Expand Down

0 comments on commit 1e85e92

Please sign in to comment.