Skip to content

Commit

Permalink
changed VGA_BUFFER_ADDRESS to PhysAddr
Browse files Browse the repository at this point in the history
  • Loading branch information
jounathaen committed Oct 31, 2024
1 parent dcea246 commit 40d7893
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/arch/x86_64/kernel/vga.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const ATTRIBUTE_BLACK: u8 = 0x00;
const ATTRIBUTE_LIGHTGREY: u8 = 0x07;
const COLS: usize = 80;
const ROWS: usize = 25;
const VGA_BUFFER_ADDRESS: u64 = 0xB8000;
const VGA_BUFFER_ADDRESS: PhysAddr = PhysAddr::new(0xB8000);

static VGA_SCREEN: SpinMutex<VgaScreen> = SpinMutex::new(VgaScreen::new());

Expand Down Expand Up @@ -47,7 +47,7 @@ unsafe impl Send for VgaScreen {}
impl VgaScreen {
const fn new() -> Self {
Self {
buffer: VGA_BUFFER_ADDRESS as *mut _,
buffer: VGA_BUFFER_ADDRESS.as_u64() as *mut _,
current_col: 0,
current_row: 0,
is_initialized: false,
Expand All @@ -59,8 +59,8 @@ impl VgaScreen {
let mut flags = PageTableEntryFlags::empty();
flags.device().writable().execute_disable();
paging::map::<BasePageSize>(
VirtAddr::new(VGA_BUFFER_ADDRESS),
PhysAddr::new(VGA_BUFFER_ADDRESS),
VirtAddr::new(VGA_BUFFER_ADDRESS.as_u64()),
VGA_BUFFER_ADDRESS,
1,
flags,
);
Expand Down

0 comments on commit 40d7893

Please sign in to comment.