Skip to content

Commit

Permalink
Fix build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
neri committed Nov 15, 2023
1 parent 5559181 commit 8b48911
Show file tree
Hide file tree
Showing 28 changed files with 367 additions and 235 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# MEG-OS

***NOTE: IT IS CURRENTLY NOT POSSIBLE TO BUILD WITH THE LATEST NIGHTLY VERSION.***

![GitHub](https://img.shields.io/github/license/neri/maystorm) ![GitHub top language](https://img.shields.io/github/languages/top/neri/maystorm)

A hobby operating system written in Rust that supports WebAssembly.
Expand Down
36 changes: 18 additions & 18 deletions apps/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

79 changes: 53 additions & 26 deletions boot/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions boot/boot-efi/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ use uefi::{
prelude::*,
proto::console::gop,
table::{
boot::{OpenProtocolAttributes, OpenProtocolParams, SearchType},
boot::{MemoryType, OpenProtocolAttributes, OpenProtocolParams, SearchType},
cfg::{ACPI2_GUID, SMBIOS_GUID},
},
Identify,
};

//#define EFI_DTB_TABLE_GUID {0xb1b621d5, 0xf19c, 0x41a5, {0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0}}
const DTB_GUID: Guid = Guid::from_values(0xb1b621d5, 0xf19c, 0x41a5, 0x830b, 0xd9152c69aae0);
const DTB_GUID: Guid = Guid::from_bytes([
0xb1, 0xb6, 0x21, 0xd5, 0xf1, 0x9c, 0x41, 0xa5, 0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0,
]);

static KERNEL_PATH: &str = "/EFI/MEGOS/kernel.bin";
static INITRD_PATH: &str = "/EFI/MEGOS/initrd.img";
Expand Down Expand Up @@ -154,7 +156,7 @@ fn efi_main(handle: Handle, mut st: SystemTable<Boot>) -> Status {
// Exit Boot Services
//

let (_st, mm) = st.exit_boot_services();
let (_st, mm) = st.exit_boot_services(MemoryType::LOADER_DATA);

// ------------------------------------------------------------------------

Expand Down
14 changes: 10 additions & 4 deletions lib/meggl/src/bitmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ pub trait DrawRect: SetPixel {
}

fn draw_rect(&mut self, rect: Rect, color: Self::ColorType) {
let Ok(coords) = Coordinates::from_rect(rect) else { return };
let Ok(coords) = Coordinates::from_rect(rect) else {
return;
};
let width = rect.width();
let height = rect.height();
self.draw_hline(coords.left_top(), width, color);
Expand Down Expand Up @@ -190,7 +192,9 @@ pub trait DrawGlyph: SetPixel {
fn draw_glyph(&mut self, glyph: &[u8], size: Size, origin: Point, color: Self::ColorType) {
let stride = (size.width as usize + 7) / 8;

let Ok(mut coords) = Coordinates::from_rect(Rect::from((origin, size))) else { return };
let Ok(mut coords) = Coordinates::from_rect(Rect::from((origin, size))) else {
return;
};

let width = self.width() as isize;
let height = self.height() as isize;
Expand Down Expand Up @@ -250,7 +254,9 @@ pub trait DrawGlyph: SetPixel {
origin.x,
size.height,
size.width,
)) else { return };
)) else {
return;
};

if coords.right > width {
coords.right = width;
Expand All @@ -265,7 +271,7 @@ pub trait DrawGlyph: SetPixel {
let new_rect = Rect::from(coords);
let width = new_rect.height() as usize;
let height = new_rect.width();
drop(new_rect);

let w8 = width / 8;
let w7 = width & 7;
let mut cursor = 0;
Expand Down
2 changes: 1 addition & 1 deletion lib/megstd/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl Write for File {
}
}

#[derive(Clone)]
// #[derive(Clone)]
pub struct OpenOptions(fs_imp::OpenOptions);

impl OpenOptions {
Expand Down
2 changes: 2 additions & 0 deletions lib/megstd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ pub mod time;
pub mod uuid;

#[cfg(feature = "window")]
#[allow(unused_imports)]
pub mod window {
pub use crate::sys::window::*;
}

extern crate alloc;

pub use prelude::*;
#[allow(unused_imports)]
mod prelude {
pub use crate::{osstr::*, sys::prelude::*};
pub use alloc::{
Expand Down
Loading

0 comments on commit 8b48911

Please sign in to comment.