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 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;

View File

@ -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>,

View File

@ -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]");
} }

View File

@ -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();
} }