Format manually
This commit is contained in:
parent
6d3c77056c
commit
80bd36b4c4
6 changed files with 21 additions and 13 deletions
|
@ -179,13 +179,21 @@ extern "C" fn _start() -> ! {
|
||||||
// rawmemorymap's sections into a pointer to those sections.
|
// rawmemorymap's sections into a pointer to those sections.
|
||||||
|
|
||||||
for ele in &mut *memorysections {
|
for ele in &mut *memorysections {
|
||||||
(*ele) = core::mem::transmute::<aphrodite::boot::MemoryMapping, aphrodite::multiboot2::MemorySection>(Into::<MemoryMapping>::into(*ele))
|
(*ele) = core::mem::transmute::<
|
||||||
|
aphrodite::boot::MemoryMapping,
|
||||||
|
aphrodite::multiboot2::MemorySection,
|
||||||
|
>(
|
||||||
|
Into::<MemoryMapping>::into(*ele)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
MM = MemoryMap {
|
MM = MemoryMap {
|
||||||
version: (*rawmemorymap).entry_version,
|
version: (*rawmemorymap).entry_version,
|
||||||
entry_size: (*rawmemorymap).entry_size,
|
entry_size: (*rawmemorymap).entry_size,
|
||||||
sections: core::mem::transmute::<&mut [aphrodite::multiboot2::MemorySection], &[aphrodite::boot::MemoryMapping]>(memorysections),
|
sections: core::mem::transmute::<
|
||||||
|
&mut [aphrodite::multiboot2::MemorySection],
|
||||||
|
&[aphrodite::boot::MemoryMapping],
|
||||||
|
>(memorysections),
|
||||||
};
|
};
|
||||||
let mm2 = aphrodite::boot::MemoryMap {
|
let mm2 = aphrodite::boot::MemoryMap {
|
||||||
len: MM.sections.len() as u64,
|
len: MM.sections.len() as u64,
|
||||||
|
|
|
@ -99,9 +99,7 @@ impl dyn TextDisplay + '_ {
|
||||||
pub struct NoneTextDisplay {}
|
pub struct NoneTextDisplay {}
|
||||||
|
|
||||||
impl TextDisplay for NoneTextDisplay {
|
impl TextDisplay for NoneTextDisplay {
|
||||||
fn get_size(&self) -> Result<(u32, u32), crate::Error<'static>> {
|
fn get_size(&self) -> Result<(u32, u32), crate::Error<'static>> { Ok((1, 1)) }
|
||||||
Ok((1,1))
|
|
||||||
}
|
|
||||||
fn write_char(&self, _: (u32, u32), _: u8, _: Color) -> Result<(), crate::Error<'static>> {
|
fn write_char(&self, _: (u32, u32), _: u8, _: Color) -> Result<(), crate::Error<'static>> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
#![deny(rustdoc::invalid_html_tags)]
|
#![deny(rustdoc::invalid_html_tags)]
|
||||||
#![deny(rustdoc::invalid_rust_codeblocks)]
|
#![deny(rustdoc::invalid_rust_codeblocks)]
|
||||||
#![deny(unsafe_op_in_unsafe_fn)]
|
#![deny(unsafe_op_in_unsafe_fn)]
|
||||||
|
|
||||||
#![feature(ptr_metadata)]
|
#![feature(ptr_metadata)]
|
||||||
#![feature(const_trait_impl)]
|
#![feature(const_trait_impl)]
|
||||||
#![feature(f128)]
|
#![feature(f128)]
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
use crate::{display::TextDisplay, output::*};
|
use crate::display::TextDisplay;
|
||||||
|
use crate::output::*;
|
||||||
|
|
||||||
use core::alloc::{Allocator, Layout};
|
use core::alloc::{Allocator, Layout};
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,4 @@ use crate::display::TextDisplay;
|
||||||
|
|
||||||
mod memmapalloc;
|
mod memmapalloc;
|
||||||
|
|
||||||
pub fn run(display: &dyn TextDisplay) {
|
pub fn run(display: &dyn TextDisplay) { memmapalloc::run(display); }
|
||||||
memmapalloc::run(display);
|
|
||||||
}
|
|
||||||
|
|
|
@ -114,7 +114,9 @@ pub fn parse_pc_screen_font(data: RawPCScreenFont) -> Result<PCScreenFont, crate
|
||||||
flags: data.flags,
|
flags: data.flags,
|
||||||
height: data.height,
|
height: data.height,
|
||||||
width: data.width,
|
width: data.width,
|
||||||
glyphs: Vec::from(core::mem::transmute::<&[u8], &[Glyph]>(data.glyphs.as_slice())),
|
glyphs: Vec::from(core::mem::transmute::<&[u8], &[Glyph]>(
|
||||||
|
data.glyphs.as_slice(),
|
||||||
|
)),
|
||||||
unitable: Some(unitable),
|
unitable: Some(unitable),
|
||||||
};
|
};
|
||||||
return Ok(out);
|
return Ok(out);
|
||||||
|
@ -125,7 +127,9 @@ pub fn parse_pc_screen_font(data: RawPCScreenFont) -> Result<PCScreenFont, crate
|
||||||
flags: data.flags,
|
flags: data.flags,
|
||||||
height: data.height,
|
height: data.height,
|
||||||
width: data.width,
|
width: data.width,
|
||||||
glyphs: Vec::from(core::mem::transmute::<&[u8], &[Glyph]>(data.glyphs.as_slice())),
|
glyphs: Vec::from(core::mem::transmute::<&[u8], &[Glyph]>(
|
||||||
|
data.glyphs.as_slice(),
|
||||||
|
)),
|
||||||
unitable: None,
|
unitable: None,
|
||||||
};
|
};
|
||||||
Ok(out)
|
Ok(out)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue