use strict provenance api

refactor
pantonshire 5 months ago
parent 868844f710
commit b0dffe7bc8

@ -2,6 +2,7 @@ use core::{fmt, ptr};
use crate::spin::Spinlock;
const VGA_ADDR: usize = 0xb8000;
const VGA_WIDTH: usize = 80;
const VGA_HEIGHT: usize = 25;
@ -28,7 +29,7 @@ macro_rules! vga_println {
}
pub fn vga_init() {
let vga_buf = unsafe { VgaBuf::new(0xb8000 as *mut u16) };
let vga_buf = unsafe { VgaBuf::new(ptr::with_exposed_provenance_mut::<u16>(VGA_ADDR)) };
let mut guard = VGA.lock();
*guard = Some(vga_buf);
}

Loading…
Cancel
Save