mirror of
https://github.com/iceHtwoO/novaOS.git
synced 2026-04-17 04:32:27 +00:00
feat: implement MMU core functionality
* feat: Implement a basic MMU configuration * feat: Enhance MMU by separating sections and configuring permissions * feat: Update MMU configuration and memory allocation functions * fix: Level 3 translation fault * docs: add code documentation * fix: linter * feat: map translation tables to kernel space * feat: move el1 stack to kernel VA space * feat: use virtual memory for heap allocation * docs: update Readme
This commit is contained in:
committed by
GitHub
parent
55f410e2bb
commit
f78388ee2c
@@ -24,8 +24,8 @@ pub struct FrameBuffer {
|
||||
pixel_depth: u32, // Bits per pixel
|
||||
pitch: u32, // Pixel per row
|
||||
rows: u32, // Rows
|
||||
start_addr: *mut u32,
|
||||
size: u32, //Bytes
|
||||
pub start_addr: *mut u32,
|
||||
pub size: u32, //Bytes
|
||||
}
|
||||
|
||||
pub const RED: u32 = 0x00FF0000;
|
||||
@@ -37,6 +37,9 @@ pub const YELLOW: u32 = 0x00FFFF00;
|
||||
impl FrameBuffer {
|
||||
pub fn draw_pixel(&self, x: u32, y: u32, color: u32) {
|
||||
let offset = x + y * self.pitch;
|
||||
if x >= self.pitch || y >= self.rows {
|
||||
return;
|
||||
}
|
||||
unsafe {
|
||||
write_volatile(self.start_addr.add(offset as usize), color);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user