@ -19,7 +19,7 @@ pub fn probe_fb_info(width : u32, height : u32, depth : u32) -> FramebufferResul
yoffset: 0,
depth: 24,
pitch: 1024, // TOKNOW
bus_addr: 0xf000_0000,
bus_addr: 0xfd00_0000,
screen_size: 1024 * 768 * 3,
};
Ok((fb_info, fb::ColorConfig::BGRA8888, KERNEL_OFFSET + 0xf000_0000))
@ -172,6 +172,11 @@ impl Framebuffer {
unsafe { self.buf.base_addr }
}
#[inline]
pub fn bus_addr(&self) -> usize {
self.fb_info.bus_addr as usize
/// Read pixel at `(x, y)`.
pub fn read(&self, x: u32, y: u32) -> u32 {
@ -58,16 +58,19 @@ impl Syscall<'_> {
info!("mmap path is {} ", &*file.path);
match &*file.path {
"/dev/fb0" => {
self.vm().push(
use crate::arch::board::fb::FRAME_BUFFER;
addr,
if let Some(fb) = FRAME_BUFFER.lock().as_mut() {
addr + len,
prot.to_attr(),
Linear::new(
( 0xfd00_0000 - addr ) as isize,
),
"mmap_file",
( fb.bus_addr() - addr ) as isize,
);
info!("mmap for /dev/fb0");
return Ok(addr);
},
_ => {