rustfmt
This commit is contained in:
parent
de4e20adb4
commit
ab988326ba
|
@ -10,14 +10,13 @@ use x86_64::{
|
||||||
};
|
};
|
||||||
|
|
||||||
pub mod bump;
|
pub mod bump;
|
||||||
pub mod linked_list;
|
|
||||||
pub mod fixed_size_block;
|
pub mod fixed_size_block;
|
||||||
|
pub mod linked_list;
|
||||||
|
|
||||||
use fixed_size_block::FixedSizeBlockAllocator;
|
use fixed_size_block::FixedSizeBlockAllocator;
|
||||||
|
|
||||||
#[global_allocator]
|
#[global_allocator]
|
||||||
static ALLOCATOR: Locked<FixedSizeBlockAllocator> = Locked::new(
|
static ALLOCATOR: Locked<FixedSizeBlockAllocator> = Locked::new(FixedSizeBlockAllocator::new());
|
||||||
FixedSizeBlockAllocator::new());
|
|
||||||
|
|
||||||
pub struct Dummy;
|
pub struct Dummy;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
use super::Locked;
|
use super::Locked;
|
||||||
use alloc::alloc::{GlobalAlloc, Layout};
|
use alloc::alloc::{GlobalAlloc, Layout};
|
||||||
use core::{mem, ptr::{self, NonNull}};
|
use core::{
|
||||||
|
mem,
|
||||||
|
ptr::{self, NonNull},
|
||||||
|
};
|
||||||
|
|
||||||
struct ListNode {
|
struct ListNode {
|
||||||
next: Option<&'static mut ListNode>,
|
next: Option<&'static mut ListNode>,
|
||||||
|
|
12
src/clock.rs
12
src/clock.rs
|
@ -20,15 +20,15 @@ pub fn current_time() -> DateTime<Utc> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
use crate::{serial_print, serial_println, println};
|
use crate::{println, serial_print, serial_println};
|
||||||
|
|
||||||
#[test_case]
|
#[test_case]
|
||||||
fn test_current_time() {
|
fn test_current_time() {
|
||||||
serial_print!("current time... ");
|
serial_print!("current time... ");
|
||||||
let now = current_time();
|
let now = current_time();
|
||||||
println!("{:?}", now);
|
println!("{:?}", now);
|
||||||
|
|
||||||
assert_ne!(now.month(), 0);
|
assert_ne!(now.month(), 0);
|
||||||
|
|
||||||
serial_println!("[ok]");
|
serial_println!("[ok]");
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
|
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
|
|
||||||
|
use alloc::string::ToString;
|
||||||
use bootloader::{entry_point, BootInfo};
|
use bootloader::{entry_point, BootInfo};
|
||||||
use core::panic::PanicInfo;
|
use core::panic::PanicInfo;
|
||||||
use alloc::string::ToString;
|
|
||||||
use xe_os::{clock, init, println, wasm};
|
use xe_os::{clock, init, println, wasm};
|
||||||
|
|
||||||
entry_point!(kernel_main);
|
entry_point!(kernel_main);
|
||||||
|
@ -27,7 +27,7 @@ fn kernel_main(boot_info: &'static BootInfo) -> ! {
|
||||||
|
|
||||||
wasm::run();
|
wasm::run();
|
||||||
println!("[ ] success");
|
println!("[ ] success");
|
||||||
|
|
||||||
xe_os::hlt_loop();
|
xe_os::hlt_loop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue