This commit is contained in:
Cadey Ratio 2020-03-26 11:06:17 -04:00
parent de4e20adb4
commit ab988326ba
4 changed files with 14 additions and 12 deletions

View File

@ -10,14 +10,13 @@ use x86_64::{
};
pub mod bump;
pub mod linked_list;
pub mod fixed_size_block;
pub mod linked_list;
use fixed_size_block::FixedSizeBlockAllocator;
#[global_allocator]
static ALLOCATOR: Locked<FixedSizeBlockAllocator> = Locked::new(
FixedSizeBlockAllocator::new());
static ALLOCATOR: Locked<FixedSizeBlockAllocator> = Locked::new(FixedSizeBlockAllocator::new());
pub struct Dummy;

View File

@ -1,6 +1,9 @@
use super::Locked;
use alloc::alloc::{GlobalAlloc, Layout};
use core::{mem, ptr::{self, NonNull}};
use core::{
mem,
ptr::{self, NonNull},
};
struct ListNode {
next: Option<&'static mut ListNode>,

View File

@ -20,15 +20,15 @@ pub fn current_time() -> DateTime<Utc> {
}
#[cfg(test)]
use crate::{serial_print, serial_println, println};
use crate::{println, serial_print, serial_println};
#[test_case]
fn test_current_time() {
serial_print!("current time... ");
let now = current_time();
println!("{:?}", now);
serial_print!("current time... ");
let now = current_time();
println!("{:?}", now);
assert_ne!(now.month(), 0);
assert_ne!(now.month(), 0);
serial_println!("[ok]");
serial_println!("[ok]");
}

View File

@ -6,9 +6,9 @@
extern crate alloc;
use alloc::string::ToString;
use bootloader::{entry_point, BootInfo};
use core::panic::PanicInfo;
use alloc::string::ToString;
use xe_os::{clock, init, println, wasm};
entry_point!(kernel_main);