diff --git a/kernel/src/arch/x86_64/driver/vga.rs b/kernel/src/arch/x86_64/driver/vga.rs index a1ea621..b4f096b 100644 --- a/kernel/src/arch/x86_64/driver/vga.rs +++ b/kernel/src/arch/x86_64/driver/vga.rs @@ -1,15 +1,10 @@ -use core::ptr::Unique; use core::fmt; use spin::Mutex; use volatile::Volatile; +use lazy_static::lazy_static; use x86_64::instructions::port::Port; use crate::logging::Color; use crate::consts::KERNEL_OFFSET; -use lazy_static::lazy_static; - -pub const VGA_BUFFER: Unique = unsafe { - Unique::new_unchecked((KERNEL_OFFSET + 0xb8000) as *mut _) -}; #[derive(Debug, Clone, Copy)] struct ColorCode(u8); @@ -73,8 +68,7 @@ impl VgaBuffer { lazy_static! { pub static ref VGA_WRITER: Mutex = Mutex::new( - // It is the only user of VGA_BUFFER. So it's safe. - VgaWriter::new(unsafe{ &mut *VGA_BUFFER.as_ptr() }) + VgaWriter::new(unsafe{ &mut *((KERNEL_OFFSET + 0xb8000) as *mut VgaBuffer) }) ); } diff --git a/kernel/src/lib.rs b/kernel/src/lib.rs index c13f0cd..6513ac9 100644 --- a/kernel/src/lib.rs +++ b/kernel/src/lib.rs @@ -1,16 +1,10 @@ -#![feature(ptr_internals)] #![feature(lang_items)] -#![feature(const_fn)] #![feature(alloc)] #![feature(naked_functions)] #![feature(asm)] #![feature(optin_builtin_traits)] #![feature(panic_info_message)] #![feature(global_asm)] -#![feature(compiler_builtins_lib)] -#![feature(raw)] -#![feature(vec_resize_default)] -#![feature(extern_crate_item_prelude)] #![no_std] // just keep it ...