use strict provenance api
This commit is contained in:
1 parent
868844f710
commit
b0dffe7bc8
1 file changed
+2
-1
+2
-1
@@ -2,6 +2,7 @@ use core::{fmt, ptr};
|
|||||||
|
|
||||||
use crate::spin::Spinlock;
|
use crate::spin::Spinlock;
|
||||||
|
|
||||||
|
const VGA_ADDR: usize = 0xb8000;
|
||||||
const VGA_WIDTH: usize = 80;
|
const VGA_WIDTH: usize = 80;
|
||||||
const VGA_HEIGHT: usize = 25;
|
const VGA_HEIGHT: usize = 25;
|
||||||
|
|
||||||
@@ -28,7 +29,7 @@ macro_rules! vga_println {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn vga_init() {
|
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();
|
let mut guard = VGA.lock();
|
||||||
*guard = Some(vga_buf);
|
*guard = Some(vga_buf);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user